Cesium.js 4.91 MB
Newer Older
forevertyler's avatar
forevertyler committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099
/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.127
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */

var Cesium=(()=>{var qCe=Object.create;var QM=Object.defineProperty;var $Ce=Object.getOwnPropertyDescriptor;var e1e=Object.getOwnPropertyNames;var t1e=Object.getPrototypeOf,n1e=Object.prototype.hasOwnProperty;var jM=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ld=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),i1e=(e,t)=>{for(var n in t)QM(e,n,{get:t[n],enumerable:!0})},fq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of e1e(t))!n1e.call(e,o)&&o!==n&&QM(e,o,{get:()=>t[o],enumerable:!(i=$Ce(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?qCe(t1e(e)):{},fq(t||!e||!e.__esModule?QM(n,"default",{value:e,enumerable:!0}):n,e)),o1e=e=>fq(QM({},"__esModule",{value:!0}),e);var S=ld(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFdTPU9iamVjdC5jcmVhdGU7dmFyIEJsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgWFM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgWVM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyICRTPU9iamVjdC5nZXRQcm90b3R5cGVPZixaUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBwcj0odD0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkodCx7Z2V0OihlLG4pPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6ZSlbbl19KTp0KShmdW5jdGlvbih0KXtpZih0eXBlb2YgcmVxdWlyZTwidSIpcmV0dXJuIHJlcXVpcmUuYXBwbHkodGhpcyxhcmd1bWVudHMpO3Rocm93IEVycm9yKCdEeW5hbWljIHJlcXVpcmUgb2YgIicrdCsnIiBpcyBub3Qgc3VwcG9ydGVkJyl9KSx1MT10PT5lPT57dmFyIG49dFtlXTtpZihuKXJldHVybiBuKCk7dGhyb3cgbmV3IEVycm9yKCJNb2R1bGUgbm90IGZvdW5kIGluIGJ1bmRsZTogIitlKX07dmFyIFo9KHQsZSk9PigpPT4odCYmKGU9dCh0PTApKSxlKTt2YXIgWG49KHQsZSk9PigpPT4oZXx8dCgoZT17ZXhwb3J0czp7fX0pLmV4cG9ydHMsZSksZS5leHBvcnRzKSxtZT0odCxlKT0+e2Zvcih2YXIgbiBpbiBlKUJsKHQsbix7Z2V0OmVbbl0sZW51bWVyYWJsZTohMH0pfSxsMT0odCxlLG4sbyk9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plLG5bM109dFszXSplLG5bNF09dFs0XSplLG5bNV09dFs1XSplLG5bNl09dFs2XSplLG5bN109dFs3XSplLG5bOF09dFs4XSplLG59O3d0Lm11bHRpcGx5QnlTY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUueCxuWzFdPXRbMV0qZS54LG5bMl09dFsyXSplLngsblszXT10WzNdKmUueSxuWzRdPXRbNF0qZS55LG5bNV09dFs1XSplLnksbls2XT10WzZdKmUueixuWzddPXRbN10qZS56LG5bOF09dFs4XSplLnosbn07d3QubXVsdGlwbHlCeVVuaWZvcm1TY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUsblsxXT10WzFdKmUsblsyXT10WzJdKmUsblszXT10WzNdKmUsbls0XT10WzRdKmUsbls1XT10WzVdKmUsbls2XT10WzZdKmUsbls3XT10WzddKmUsbls4XT10WzhdKmUsbn07d3QubmVnYXRlPWZ1bmN0aW9uKHQsZSl7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsZSksZVswXT0tdFswXSxlWzFdPS10WzFdLGVbMl09LXRbMl0sZVszXT0tdFszXSxlWzRdPS10WzRdLGVbNV09LXRbNV0sZVs2XT0tdFs2XSxlWzddPS10WzddLGVbOF09LXRbOF0sZX07d3QudHJhbnNwb3NlPWZ1bmN0aW9uKHQsZSl7eS50eXBlT2Yub2JqZWN0KCJtYXRyaXgiLHQpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixlKTtsZXQgbj10WzB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ndGg7aChlKT9lLmxlbmd0aD1uLzQ6ZT1uZXcgQXJyYXkobi80KTtmb3IobGV0IG89MDtvPG47bys9NCl7bGV0IHI9by80O2Vbcl09THQudW5wYWNrKHQsbyxlW3JdKX1yZXR1cm4gZX07THQuZnJvbUFycmF5PUx0LnVucGFjaztMdC5tYXhpbXVtQ29tcG9uZW50PWZ1bmN0aW9uKHQpe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsdCksTWF0aC5tYXgodC54LHQueSx0LnosdC53KX07THQubWluaW11bUNvbXBvbmVudD1mdW5jdGlvbih0KXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJjYXJ0ZXNpYW4iLHQpLE1hdGgubWluKHQueCx0LnksdC56LHQudyl9O0x0Lm1pbmltdW1CeUNvbXBvbmVudD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLHQpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWluKHQueCxlLngpLG4ueT1NYXRoLm1pbih0LnksZS55KSxuLno9TWF0aC5taW4odC56LGUueiksbi53PU1hdGgubWluKHQudyxlLncpLG59O0x0Lm1heGltdW1CeUNvbXBvbmVudD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLHQpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWF4KHQueCxlLngpLG4ueT1NYXRoLm1heCh0LnksZS55KSxuLno9TWF0aC5tYXgodC56LGUueiksbi53PU1hdGgubWF4KHQudyxlLncpLG59O0x0LmNsYW1wPWZ1bmN0aW9uKHQsZSxuLG8pe3kudHlwZU9mLm9iamVjdCgidmFsdWUiLHQpLHkudHlwZU9mLm9iamVjdCgibWluIixlKSx5LnR5cGVPZi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WQgcmVzdWx0IGlzIG5vdCBhIG51bWJlciIpO3JldHVybiBlfTtMdC5kb3Q9ZnVuY3Rpb24odCxlKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJsZWZ0Iix0KSx5LnR5cGVPZi5vYmplY3QoInJpZ2h0IixlKSx0LngqZS54K3QueSplLnkrdC56KmUueit0LncqZS53fTtMdC5tdWx0aXBseUNvbXBvbmVudHM9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54KmUueCxuLnk9dC55KmUueSxuLno9dC56KmUueixuLnc9dC53KmUudyxufTtMdC5kaXZpZGVDb21wb25lbnRzPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJsZWZ0Iix0KSx5LnR5cGVPZi5vYmplY3QoInJpZ2h0IixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PXQueC9lLngsbi55PXQueS9lLnksbi56PXQuei9lLnosbi53PXQudy9lLncsbn07THQuYWRkPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJsZWZ0Iix0KSx5LnR5cGVPZi5vYmplY3QoInJpZ2h0IixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PXQueCtlLngsbi55PXQueStlLnksbi56PXQueitlLnosbi53PXQudytlLncsbn07THQuc3VidHJhY3Q9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54LWUueCxuLnk9dC55LWUueSxuLno9dC56LWUueixuLnc9dC53LWUudyxufTtMdC5tdWx0aXBseUJ5U2N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diksdz1sLmF0dHJpYnV0ZXMsQz1sLmluZGljZXMsTj1jLmF0dHJpYnV0ZXMsST1jLmluZGljZXMpO2xldCBMPWEuYWRkKEQsdixsTSk7dy5wb3NpdGlvbi52YWx1ZXMucHVzaChPLngsTy55LE8ueixPLngsTy55LE8ueiksdy5wb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksdy5wb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksdy5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2gocltiKjNdLHJbYiozKzFdLHJbYiozKzJdKSx3LnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChyW2IqMyszXSxyW2IqMys0XSxyW2IqMys1XSksdy5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goTy54LE8ueSxPLnosTy54LE8ueSxPLnopLHcubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSx3Lm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksdy5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLHcubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxhLm5lZ2F0ZSh2LHYpLGEuYWRkKEQsdixMKSxOLnBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLnBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLnBvc2l0aW9uLnZhbHVlcy5wdXNoKEUueCxFLnksRS56LEUueCxFLnksRS56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksTi5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksTi5uZXh0UG9zaXRpb24udmFsdWV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ZT09PWZlLlRPUClGPUYuZmlsbCgxLDAsYy8yKTtlbHNle2xldCBqPWUub2Zmc2V0QXR0cmlidXRlPT09ZmUuTk9ORT8wOjE7Rj1GLmZpbGwoail9UC5hcHBseU9mZnNldD1uZXcgc3Qoe2NvbXBvbmVudERhdGF0eXBlOm50LlVOU0lHTkVEX0JZVEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZToxLHZhbHVlczpGfSl9cmV0dXJuIFB9ZnVuY3Rpb24geFQodCl7bGV0IGU9bmV3IEFycmF5KDEyKih0Kih0KzEpKS02KSxuPTAsbyxyLGkscyxmO2ZvcihvPTAsaT0xLHM9MDtzPDM7cysrKWVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWk7Zm9yKHM9MjtzPHQrMTsrK3Mpe2ZvcihpPXMqKHMrMSktMSxvPShzLTEpKnMtMSxlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pLHI9MipzLGY9MDtmPHItMTsrK2YpZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pO2VbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWl9Zm9yKHI9dCoyLCsraSwrK28scz0wO3M8ci0xOysrcyllW24rK109aSxlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWk7Zm9yKGVbbisrXT1pLGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkrKyxlW24rK109bysrLGVbbisrXT1vLCsrbyxzPXQtMTtzPjE7LS1zKXtmb3IoZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSxyPTIqcyxmPTA7ZjxyLTE7KytmKWVbbisrXT1pLGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtlW24rK109bysrLGVbbisrXT1vKyssZVtuKytdPWkrK31mb3Iocz0wO3M8MztzKyspZVtuKytdPW8rKyxlW24rK109byxlW24rK109aTtyZXR1c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V0IFM9MDtTPGk7KytTKWdvLmNvbXB1dGVQb3NpdGlvbihlLG8sbi5zdCxBLFMsYixUKSxkW18rK109Yi54LGRbXysrXT1iLnksZFtfKytdPWIueixuLnN0JiYobVtnKytdPVQueCxtW2crK109VC55LE89TWF0aC5taW4oTyxULngpLEU9TWF0aC5taW4oRSxULnkpLHc9TWF0aC5tYXgodyxULngpLEM9TWF0aC5tYXgoQyxULnkpKTtpZihzJiYoZ28uY29tcHV0ZVBvc2l0aW9uKGUsbyxuLnN0LDAsMCxiLFQpLGRbXysrXT1iLngsZFtfKytdPWIueSxkW18rK109Yi56LG4uc3QmJihtW2crK109VC54LG1bZysrXT1ULnksTz1ULngsRT1ULnksdz1ULngsQz1ULnkpKSxmJiYoZ28uY29tcHV0ZVBvc2l0aW9uKGUsbyxuLnN0LHItMSwwLGIsVCksZFtfKytdPWIueCxkW18rK109Yi55LGRbX109Yi56LG4uc3QmJihtW2crK109VC54LG1bZ109VC55LE89TWF0aC5taW4oTyxULngpLEU9TWF0aC5taW4oRSxULnkpLHc9TWF0aC5tYXgodyxULngpLEM9TWF0aC5tYXgoQyxULnkpKSksbi5zdCYmKE88MHx8RTwwfHx3PjF8fEM+MSkpZm9yKGxldCBBPTA7QTxtLmxlbmd0aDtBKz0yKW1bQV09KG1bQV0tTykvKHctTyksbVtBKzFdPShtW0ErMV0tRSkvKEMtRSk7bGV0IE49YUIoZCxuLG8sZS50YW5nZW50Um90YXRpb25NYXRyaXgpLEk9NiooaS0xKSoobC0xKTtzJiYoSSs9MyooaS0xKSksZiYmKEkrPTMqKGktMSkpO2xldCBEPUR0LmNyZWF0ZVR5cGVkQXJyYXkocCxJKSx2PTAsTD0wLFU7Zm9yKFU9MDtVPGwtMTsrK1Upe2ZvcihsZXQgQT0wO0E8aS0xOysrQSl7bGV0IFM9dixQPVMraSxGPVArMSxqPVMrMTtEW0wrK109UyxEW0wrK109UCxEW0wrK109aixEW0wrK109aixEW0wrK109UCxEW0wrK109RiwrK3Z9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ZW4oKCk9PkhnKCkpfSxJVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PllnKCkpfSx2Vj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnQxKCkpfSxMVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmUxKCkpfSxEVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pm8xKCkpfTtyZXR1cm4gUVMoRlYpO30pKCk7Cg==")});var qM=ld((AVt,bq)=>{var MVt=T(S()),xp=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};xp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};xp.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};xp.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};xp.prototype.random_int31=function(){return this.random_int()>>>1};xp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};xp.prototype.random=function(){return this.random_int()*(1/4294967296)};xp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};xp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};bq.exports=xp});var Uq=ld((BS,OS)=>{var CZt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof BS=="object"&&BS&&!BS.nodeType&&BS,n=typeof OS=="object"&&OS&&!OS.nodeType&&OS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,h=72,p=128,g="-",f=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,R=String.fromCharCode,G;function I(U){throw new RangeError(C[U])}function v(U,Y){for(var k=U.length,H=[];k--;)H[k]=Y(U[k]);return H}function P(U,Y){var k=U.split("@"),H="";k.length>1&&(H=k[0]+"@",U=k[1]),U=U.replace(_,".");var K=U.split("."),te=v(K,Y).join(".");return H+te}function w(U){for(var Y=[],k=0,H=U.length,K,te;k<H;)K=U.charCodeAt(k++),K>=55296&&K<=56319&&k<H?(te=U.charCodeAt(k++),(te&64512)==56320?Y.push(((K&1023)<<10)+(te&1023)+65536):(Y.push(K),k--)):Y.push(K);return Y}function M(U){return v(U,function(Y){var k="";return Y>65535&&(Y-=65536,k+=R(Y>>>10&1023|55296),Y=56320|Y&1023),k+=R(Y),k}).join("")}function b(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function Z(U,Y){return U+22+75*(U<26)-((Y!=0)<<5)}function E(U,Y,k){var H=0;for(U=k?L(U/u):U>>1,U+=L(U/Y);U>V*c>>1;H+=s)U=L(U/V);return L(H+(V+1)*U/(U+d))}function X(U){var Y=[],k=U.length,H,K=0,te=p,z=h,j,ee,fe,Te,de,xe,Ce,Ie,Le;for(j=U.lastIndexOf(g),j<0&&(j=0),ee=0;ee<j;++ee)U.charCodeAt(ee)>=128&&I("not-basic"),Y.push(U.charCodeAt(ee));for(fe=j>0?j+1:0;fe<k;){for(Te=K,de=1,xe=s;fe>=k&&I("invalid-input"),Ce=b(U.charCodeAt(fe++)),(Ce>=s||Ce>L((r-K)/de))&&I("overflow"),K+=Ce*de,Ie=xe<=z?a:xe>=z+c?c:xe-z,!(Ce<Ie);xe+=s)Le=s-Ie,de>L(r/Le)&&I("overflow"),de*=Le;H=Y.length+1,z=E(K-Te,H,Te==0),L(K/H)>r-te&&I("overflow"),te+=L(K/H),K%=H,Y.splice(K++,0,te)}return M(Y)}function F(U){var Y,k,H,K,te,z,j,ee,fe,Te,de,xe=[],Ce,Ie,Le,Ne;for(U=w(U),Ce=U.length,Y=p,k=0,te=h,z=0;z<Ce;++z)de=U[z],de<128&&xe.push(R(de));for(H=K=xe.length,K&&xe.push(g);H<Ce;){for(j=r,z=0;z<Ce;++z)de=U[z],de>=Y&&de<j&&(j=de);for(Ie=H+1,j-Y>L((r-k)/Ie)&&I("overflow"),k+=(j-Y)*Ie,Y=j,z=0;z<Ce;++z)if(de=U[z],de<Y&&++k>r&&I("overflow"),de==Y){for(ee=k,fe=s;Te=fe<=te?a:fe>=te+c?c:fe-te,!(ee<Te);fe+=s)Ne=ee-Te,Le=s-Te,xe.push(R(Z(Te+Ne%Le,0))),ee=L(Ne/Le);xe.push(R(Z(ee,0))),te=E(k,Ie,H==K),k=0,++H}++k,++Y}return xe.join("")}function N(U){return P(U,function(Y){return f.test(Y)?X(Y.slice(4).toLowerCase()):Y})}function O(U){return P(U,function(Y){return x.test(Y)?"xn--"+F(Y):Y})}if(o={version:"1.3.2",ucs2:{decode:w,encode:M},decode:X,encode:F,toASCII:O,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(OS.exports==t)n.exports=o;else for(G in o)o.hasOwnProperty(G)&&(t[G]=o[G]);else e.punycode=o})(BS)});var Bq=ld((Dq,yN)=>{var VZt=T(S());/*!
 * URI.js - Mutating URLs
 * IPv6 Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof yN=="object"&&yN.exports?yN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Dq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d<a&&s[d]!=="";d++);if(d<c)for(s.splice(d,1,"0000");s.length<c;)s.splice(d,0,"0000");for(var u,h=0;h<c;h++){u=s[h].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[h]=u.join("")}var g=-1,f=0,x=0,_=-1,C=!1;for(h=0;h<c;h++)C?s[h]==="0"?x+=1:(C=!1,x>f&&(g=_,f=x)):s[h]==="0"&&(C=!0,_=h,x=1);x>f&&(g=_,f=x),f>1&&s.splice(g,f,""),a=s.length;var V="";for(s[0]===""&&(V=":"),h=0;h<a&&(V+=s[h],h!==a-1);h++)V+=":";return s[a-1]===""&&(V+=":"),V}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Yq=ld((Oq,xN)=>{var LZt=T(S());/*!
 * URI.js - Mutating URLs
 * Second Level Domain (SLD) Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof xN=="object"&&xN.exports?xN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Oq,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var dd=ld((Hq,_N)=>{var RZt=T(S());/*!
 * URI.js - Mutating URLs
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof _N=="object"&&_N.exports?_N.exports=t(Uq(),Bq(),Yq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Hq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(Z,E){var X=arguments.length>=1,F=arguments.length>=2;if(!(this instanceof r))return X?F?new r(Z,E):new r(Z):new r;if(Z===void 0){if(X)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?Z=location.href+"":Z=""}if(Z===null&&X)throw new TypeError("null is not a valid argument for URI");return this.href(Z),E!==void 0?this.absoluteTo(E):this}function s(Z){return/^[0-9]+$/.test(Z)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(Z){return Z.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(Z){return Z===void 0?"Undefined":String(Object.prototype.toString.call(Z)).slice(8,-1)}function h(Z){return u(Z)==="Array"}function p(Z,E){var X={},F,N;if(u(E)==="RegExp")X=null;else if(h(E))for(F=0,N=E.length;F<N;F++)X[E[F]]=!0;else X[E]=!0;for(F=0,N=Z.length;F<N;F++){var O=X&&X[Z[F]]!==void 0||!X&&E.test(Z[F]);O&&(Z.splice(F,1),N--,F--)}return Z}function g(Z,E){var X,F;if(h(E)){for(X=0,F=E.length;X<F;X++)if(!g(Z,E[X]))return!1;return!0}var N=u(E);for(X=0,F=Z.length;X<F;X++)if(N==="RegExp"){if(typeof Z[X]=="string"&&Z[X].match(E))return!0}else if(Z[X]===E)return!0;return!1}function f(Z,E){if(!h(Z)||!h(E)||Z.length!==E.length)return!1;Z.sort(),E.sort();for(var X=0,F=Z.length;X<F;X++)if(Z[X]!==E[X])return!1;return!0}function x(Z){var E=/^\/+|\/+$/g;return Z.replace(E,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(Z){if(!(!Z||!Z.nodeName)){var E=Z.nodeName.toLowerCase();if(!(E==="input"&&Z.type!=="image"))return r.domAttributes[E]}};function _(Z){return escape(Z)}function C(Z){return encodeURIComponent(Z).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(Z,E){var X=r.encode(Z+"");return E===void 0&&(E=r.escapeQuerySpace),E?X.replace(/%20/g,"+"):X},r.decodeQuery=function(Z,E){Z+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?Z.replace(/\+/g,"%20"):Z)}catch{return Z}};var V={encode:"encode",decode:"decode"},L,R=function(Z,E){return function(X){try{return r[E](X+"").replace(r.characters[Z][E].expression,function(F){return r.characters[Z][E].map[F]})}catch{return X}}};for(L in V)r[L+"PathSegment"]=R("pathname",V[L]),r[L+"UrnPathSegment"]=R("urnpath",V[L]);var G=function(Z,E,X){return function(F){var N;X?N=function(k){return r[E](r[X](k))}:N=r[E];for(var O=(F+"").split(Z),U=0,Y=O.length;U<Y;U++)O[U]=N(O[U]);return O.join(Z)}};r.decodePath=G("/","decodePathSegment"),r.decodeUrnPath=G(":","decodeUrnPathSegment"),r.recodePath=G("/","encodePathSegment","decode"),r.recodeUrnPath=G(":","encodeUrnPathSegment","decode"),r.encodeReserved=R("reserved","encode"),r.parse=function(Z,E){var X;return E||(E={preventInvalidHostname:r.preventInvalidHostname}),Z=Z.replace(r.leading_whitespace_expression,""),Z=Z.replace(r.ascii_tab_whitespace,""),X=Z.indexOf("#"),X>-1&&(E.fragment=Z.substring(X+1)||null,Z=Z.substring(0,X)),X=Z.indexOf("?"),X>-1&&(E.query=Z.substring(X+1)||null,Z=Z.substring(0,X)),Z=Z.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),Z=Z.replace(/^[/\\]{2,}/i,"//"),Z.substring(0,2)==="//"?(E.protocol=null,Z=Z.substring(2),Z=r.parseAuthority(Z,E)):(X=Z.indexOf(":"),X>-1&&(E.protocol=Z.substring(0,X)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:Z.substring(X+1,X+3).replace(/\\/g,"/")==="//"?(Z=Z.substring(X+3),Z=r.parseAuthority(Z,E)):(Z=Z.substring(X+1),E.urn=!0))),E.path=Z,E},r.parseHost=function(Z,E){Z||(Z=""),Z=Z.replace(/\\/g,"/");var X=Z.indexOf("/"),F,N;if(X===-1&&(X=Z.length),Z.charAt(0)==="[")F=Z.indexOf("]"),E.hostname=Z.substring(1,F)||null,E.port=Z.substring(F+2,X)||null,E.port==="/"&&(E.port=null);else{var O=Z.indexOf(":"),U=Z.indexOf("/"),Y=Z.indexOf(":",O+1);Y!==-1&&(U===-1||Y<U)?(E.hostname=Z.substring(0,X)||null,E.port=null):(N=Z.substring(0,X).split(":"),E.hostname=N[0]||null,E.port=N[1]||null)}return E.hostname&&Z.substring(X).charAt(0)!=="/"&&(X++,Z="/"+Z),E.preventInvalidHostname&&r.ensureValidHostname(E.hostname,E.protocol),E.port&&r.ensureValidPort(E.port),Z.substring(X)||"/"},r.parseAuthority=function(Z,E){return Z=r.parseUserinfo(Z,E),r.parseHost(Z,E)},r.parseUserinfo=function(Z,E){var X=Z,F=Z.indexOf("\\");F!==-1&&(Z=Z.replace(/\\/g,"/"));var N=Z.indexOf("/"),O=Z.lastIndexOf("@",N>-1?N:Z.length-1),U;return O>-1&&(N===-1||O<N)?(U=Z.substring(0,O).split(":"),E.username=U[0]?r.decode(U[0]):null,U.shift(),E.password=U[0]?r.decode(U.join(":")):null,Z=X.substring(O+1)):(E.username=null,E.password=null),Z},r.parseQuery=function(Z,E){if(!Z)return{};if(Z=Z.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!Z)return{};for(var X={},F=Z.split("&"),N=F.length,O,U,Y,k=0;k<N;k++)O=F[k].split("="),U=r.decodeQuery(O.shift(),E),Y=O.length?r.decodeQuery(O.join("="),E):null,U!=="__proto__"&&(c.call(X,U)?((typeof X[U]=="string"||X[U]===null)&&(X[U]=[X[U]]),X[U].push(Y)):X[U]=Y);return X},r.build=function(Z){var E="",X=!1;return Z.protocol&&(E+=Z.protocol+":"),!Z.urn&&(E||Z.hostname)&&(E+="//",X=!0),E+=r.buildAuthority(Z)||"",typeof Z.path=="string"&&(Z.path.charAt(0)!=="/"&&X&&(E+="/"),E+=Z.path),typeof Z.query=="string"&&Z.query&&(E+="?"+Z.query),typeof Z.fragment=="string"&&Z.fragment&&(E+="#"+Z.fragment),E},r.buildHost=function(Z){var E="";if(Z.hostname)r.ip6_expression.test(Z.hostname)?E+="["+Z.hostname+"]":E+=Z.hostname;else return"";return Z.port&&(E+=":"+Z.port),E},r.buildAuthority=function(Z){return r.buildUserinfo(Z)+r.buildHost(Z)},r.buildUserinfo=function(Z){var E="";return Z.username&&(E+=r.encode(Z.username)),Z.password&&(E+=":"+r.encode(Z.password)),E&&(E+="@"),E},r.buildQuery=function(Z,E,X){var F="",N,O,U,Y;for(O in Z)if(O!=="__proto__"&&c.call(Z,O))if(h(Z[O]))for(N={},U=0,Y=Z[O].length;U<Y;U++)Z[O][U]!==void 0&&N[Z[O][U]+""]===void 0&&(F+="&"+r.buildQueryParameter(O,Z[O][U],X),E!==!0&&(N[Z[O][U]+""]=!0));else Z[O]!==void 0&&(F+="&"+r.buildQueryParameter(O,Z[O],X));return F.substring(1)},r.buildQueryParameter=function(Z,E,X){return r.encodeQuery(Z,X)+(E!==null?"="+r.encodeQuery(E,X):"")},r.addQuery=function(Z,E,X){if(typeof E=="object")for(var F in E)c.call(E,F)&&r.addQuery(Z,F,E[F]);else if(typeof E=="string"){if(Z[E]===void 0){Z[E]=X;return}else typeof Z[E]=="string"&&(Z[E]=[Z[E]]);h(X)||(X=[X]),Z[E]=(Z[E]||[]).concat(X)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(Z,E,X){if(typeof E=="object")for(var F in E)c.call(E,F)&&r.setQuery(Z,F,E[F]);else if(typeof E=="string")Z[E]=X===void 0?null:X;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(Z,E,X){var F,N,O;if(h(E))for(F=0,N=E.length;F<N;F++)Z[E[F]]=void 0;else if(u(E)==="RegExp")for(O in Z)E.test(O)&&(Z[O]=void 0);else if(typeof E=="object")for(O in E)c.call(E,O)&&r.removeQuery(Z,O,E[O]);else if(typeof E=="string")X!==void 0?u(X)==="RegExp"?!h(Z[E])&&X.test(Z[E])?Z[E]=void 0:Z[E]=p(Z[E],X):Z[E]===String(X)&&(!h(X)||X.length===1)?Z[E]=void 0:h(Z[E])&&(Z[E]=p(Z[E],X)):Z[E]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(Z,E,X,F){switch(u(E)){case"String":break;case"RegExp":for(var N in Z)if(c.call(Z,N)&&E.test(N)&&(X===void 0||r.hasQuery(Z,N,X)))return!0;return!1;case"Object":for(var O in E)if(c.call(E,O)&&!r.hasQuery(Z,O,E[O]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(X)){case"Undefined":return E in Z;case"Boolean":var U=!!(h(Z[E])?Z[E].length:Z[E]);return X===U;case"Function":return!!X(Z[E],E,Z);case"Array":if(!h(Z[E]))return!1;var Y=F?g:f;return Y(Z[E],X);case"RegExp":return h(Z[E])?F?g(Z[E],X):!1:!!(Z[E]&&Z[E].match(X));case"Number":X=String(X);case"String":return h(Z[E])?F?g(Z[E],X):!1:Z[E]===X;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var Z=[],E=[],X=0,F=0;F<arguments.length;F++){var N=new r(arguments[F]);Z.push(N);for(var O=N.segment(),U=0;U<O.length;U++)typeof O[U]=="string"&&E.push(O[U]),O[U]&&X++}if(!E.length||!X)return new r("");var Y=new r("").segment(E);return(Z[0].path()===""||Z[0].path().slice(0,1)==="/")&&Y.path("/"+Y.path()),Y.normalize()},r.commonPath=function(Z,E){var X=Math.min(Z.length,E.length),F;for(F=0;F<X;F++)if(Z.charAt(F)!==E.charAt(F)){F--;break}return F<1?Z.charAt(0)===E.charAt(0)&&Z.charAt(0)==="/"?"/":"":((Z.charAt(F)!=="/"||E.charAt(F)!=="/")&&(F=Z.substring(0,F).lastIndexOf("/")),Z.substring(0,F+1))},r.withinString=function(Z,E,X){X||(X={});var F=X.start||r.findUri.start,N=X.end||r.findUri.end,O=X.trim||r.findUri.trim,U=X.parens||r.findUri.parens,Y=/[a-z0-9-]=["']?$/i;for(F.lastIndex=0;;){var k=F.exec(Z);if(!k)break;var H=k.index;if(X.ignoreHtml){var K=Z.slice(Math.max(H-3,0),H);if(K&&Y.test(K))continue}for(var te=H+Z.slice(H).search(N),z=Z.slice(H,te),j=-1;;){var ee=U.exec(z);if(!ee)break;var fe=ee.index+ee[0].length;j=Math.max(j,fe)}if(j>-1?z=z.slice(0,j)+z.slice(j).replace(O,""):z=z.replace(O,""),!(z.length<=k[0].length)&&!(X.ignore&&X.ignore.test(z))){te=H+z.length;var Te=E(z,H,te,Z);if(Te===void 0){F.lastIndex=te;continue}Te=String(Te),Z=Z.slice(0,H)+Te+Z.slice(te),F.lastIndex=H+Te.length}}return F.lastIndex=0,Z},r.ensureValidHostname=function(Z,E){var X=!!Z,F=!!E,N=!1;if(F&&(N=g(r.hostProtocols,E)),N&&!X)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(Z&&Z.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(Z).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(Z){if(Z){var E=Number(Z);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+Z+'" is not a valid port')}},r.noConflict=function(Z){if(Z){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(Z){return Z===!0?this._deferred_build=!0:(Z===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(Z){return function(E,X){return E===void 0?this._parts[Z]||"":(this._parts[Z]=E||null,this.build(!X),this)}}function v(Z,E){return function(X,F){return X===void 0?this._parts[Z]||"":(X!==null&&(X=X+"",X.charAt(0)===E&&(X=X.substring(1))),this._parts[Z]=X,this.build(!F),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(Z,E){var X=this.query(Z,E);return typeof X=="string"&&X.length?"?"+X:X},a.hash=function(Z,E){var X=this.fragment(Z,E);return typeof X=="string"&&X.length?"#"+X:X},a.pathname=function(Z,E){if(Z===void 0||Z===!0){var X=this._parts.path||(this._parts.hostname?"/":"");return Z?(this._parts.urn?r.decodeUrnPath:r.decodePath)(X):X}else return this._parts.urn?this._parts.path=Z?r.recodeUrnPath(Z):"":this._parts.path=Z?r.recodePath(Z):"/",this.build(!E),this},a.path=a.pathname,a.href=function(Z,E){var X;if(Z===void 0)return this.toString();this._string="",this._parts=r._parts();var F=Z instanceof r,N=typeof Z=="object"&&(Z.hostname||Z.path||Z.pathname);if(Z.nodeName){var O=r.getDomAttribute(Z);Z=Z[O]||"",N=!1}if(!F&&N&&Z.pathname!==void 0&&(Z=Z.toString()),typeof Z=="string"||Z instanceof String)this._parts=r.parse(String(Z),this._parts);else if(F||N){var U=F?Z._parts:Z;for(X in U)X!=="query"&&c.call(this._parts,X)&&(this._parts[X]=U[X]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},a.is=function(Z){var E=!1,X=!1,F=!1,N=!1,O=!1,U=!1,Y=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,X=r.ip4_expression.test(this._parts.hostname),F=r.ip6_expression.test(this._parts.hostname),E=X||F,N=!E,O=N&&n&&n.has(this._parts.hostname),U=N&&r.idn_expression.test(this._parts.hostname),Y=N&&r.punycode_expression.test(this._parts.hostname)),Z.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return N;case"sld":return O;case"ip":return E;case"ip4":case"ipv4":case"inet4":return X;case"ip6":case"ipv6":case"inet6":return F;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var P=a.protocol,w=a.port,M=a.hostname;a.protocol=function(Z,E){if(Z&&(Z=Z.replace(/:(\/\/)?$/,""),!Z.match(r.protocol_expression)))throw new TypeError('Protocol "'+Z+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,Z,E)},a.scheme=a.protocol,a.port=function(Z,E){return this._parts.urn?Z===void 0?"":this:(Z!==void 0&&(Z===0&&(Z=null),Z&&(Z+="",Z.charAt(0)===":"&&(Z=Z.substring(1)),r.ensureValidPort(Z))),w.call(this,Z,E))},a.hostname=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z!==void 0){var X={preventInvalidHostname:this._parts.preventInvalidHostname},F=r.parseHost(Z,X);if(F!=="/")throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-]');Z=X.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(Z,this._parts.protocol)}return M.call(this,Z,E)},a.origin=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0){var X=this.protocol(),F=this.authority();return F?(X?X+"://":"")+this.authority():""}else{var N=r(Z);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var X=r.parseHost(Z,this._parts);if(X!=="/")throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var X=r.parseAuthority(Z,this._parts);if(X!=="/")throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0){var X=r.buildUserinfo(this._parts);return X&&X.substring(0,X.length-1)}else return Z[Z.length-1]!=="@"&&(Z+="@"),r.parseUserinfo(Z,this._parts),this.build(!E),this},a.resource=function(Z,E){var X;return Z===void 0?this.path()+this.search()+this.hash():(X=r.parse(Z),this._parts.path=X.path,this._parts.query=X.query,this._parts.fragment=X.fragment,this.build(!E),this)},a.subdomain=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,X)||""}else{var F=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,F),O=new RegExp("^"+d(N));if(Z&&Z.charAt(Z.length-1)!=="."&&(Z+="."),Z.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return Z&&r.ensureValidHostname(Z,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(O,Z),this.build(!E),this}},a.domain=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(typeof Z=="boolean"&&(E=Z,Z=void 0),Z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.match(/\./g);if(X&&X.length<2)return this._parts.hostname;var F=this._parts.hostname.length-this.tld(E).length-1;return F=this._parts.hostname.lastIndexOf(".",F-1)+1,this._parts.hostname.substring(F)||""}else{if(!Z)throw new TypeError("cannot set domain empty");if(Z.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(Z,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=Z;else{var N=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,Z)}return this.build(!E),this}},a.tld=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(typeof Z=="boolean"&&(E=Z,Z=void 0),Z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.lastIndexOf("."),F=this._parts.hostname.substring(X+1);return E!==!0&&n&&n.list[F.toLowerCase()]&&n.get(this._parts.hostname)||F}else{var N;if(Z)if(Z.match(/[^a-zA-Z0-9-]/))if(n&&n.is(Z))N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,Z);else throw new TypeError('TLD "'+Z+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,Z)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0||Z===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var X=this._parts.path.length-this.filename().length-1,F=this._parts.path.substring(0,X)||(this._parts.hostname?"/":"");return Z?r.decodePath(F):F}else{var N=this._parts.path.length-this.filename().length,O=this._parts.path.substring(0,N),U=new RegExp("^"+d(O));return this.is("relative")||(Z||(Z="/"),Z.charAt(0)!=="/"&&(Z="/"+Z)),Z&&Z.charAt(Z.length-1)!=="/"&&(Z+="/"),Z=r.recodePath(Z),this._parts.path=this._parts.path.replace(U,Z),this.build(!E),this}},a.filename=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(typeof Z!="string"){if(!this._parts.path||this._parts.path==="/")return"";var X=this._parts.path.lastIndexOf("/"),F=this._parts.path.substring(X+1);return Z?r.decodePathSegment(F):F}else{var N=!1;Z.charAt(0)==="/"&&(Z=Z.substring(1)),Z.match(/\.?\//)&&(N=!0);var O=new RegExp(d(this.filename())+"$");return Z=r.recodePath(Z),this._parts.path=this._parts.path.replace(O,Z),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0||Z===!0){if(!this._parts.path||this._parts.path==="/")return"";var X=this.filename(),F=X.lastIndexOf("."),N,O;return F===-1?"":(N=X.substring(F+1),O=/^[a-z0-9%]+$/i.test(N)?N:"",Z?r.decodePathSegment(O):O)}else{Z.charAt(0)==="."&&(Z=Z.substring(1));var U=this.suffix(),Y;if(U)Z?Y=new RegExp(d(U)+"$"):Y=new RegExp(d("."+U)+"$");else{if(!Z)return this;this._parts.path+="."+r.recodePath(Z)}return Y&&(Z=r.recodePath(Z),this._parts.path=this._parts.path.replace(Y,Z)),this.build(!E),this}},a.segment=function(Z,E,X){var F=this._parts.urn?":":"/",N=this.path(),O=N.substring(0,1)==="/",U=N.split(F);if(Z!==void 0&&typeof Z!="number"&&(X=E,E=Z,Z=void 0),Z!==void 0&&typeof Z!="number")throw new Error('Bad segment "'+Z+'", must be 0-based integer');if(O&&U.shift(),Z<0&&(Z=Math.max(U.length+Z,0)),E===void 0)return Z===void 0?U:U[Z];if(Z===null||U[Z]===void 0)if(h(E)){U=[];for(var Y=0,k=E.length;Y<k;Y++)!E[Y].length&&(!U.length||!U[U.length-1].length)||(U.length&&!U[U.length-1].length&&U.pop(),U.push(x(E[Y])))}else(E||typeof E=="string")&&(E=x(E),U[U.length-1]===""?U[U.length-1]=E:U.push(E));else E?U[Z]=x(E):U.splice(Z,1);return O&&U.unshift(""),this.path(U.join(F),X)},a.segmentCoded=function(Z,E,X){var F,N,O;if(typeof Z!="number"&&(X=E,E=Z,Z=void 0),E===void 0){if(F=this.segment(Z,E,X),!h(F))F=F!==void 0?r.decode(F):void 0;else for(N=0,O=F.length;N<O;N++)F[N]=r.decode(F[N]);return F}if(!h(E))E=typeof E=="string"||E instanceof String?r.encode(E):E;else for(N=0,O=E.length;N<O;N++)E[N]=r.encode(E[N]);return this.segment(Z,E,X)};var b=a.query;return a.query=function(Z,E){if(Z===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof Z=="function"){var X=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),F=Z.call(this,X);return this._parts.query=r.buildQuery(F||X,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this}else return Z!==void 0&&typeof Z!="string"?(this._parts.query=r.buildQuery(Z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this):b.call(this,Z,E)},a.setQuery=function(Z,E,X){var F=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof Z=="string"||Z instanceof String)F[Z]=E!==void 0?E:null;else if(typeof Z=="object")for(var N in Z)c.call(Z,N)&&(F[N]=Z[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof Z!="string"&&(X=E),this.build(!X),this},a.addQuery=function(Z,E,X){var F=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(F,Z,E===void 0?null:E),this._parts.query=r.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof Z!="string"&&(X=E),this.build(!X),this},a.removeQuery=function(Z,E,X){var F=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(F,Z,E),this._parts.query=r.buildQuery(F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof Z!="string"&&(X=E),this.build(!X),this},a.hasQuery=function(Z,E,X){var F=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(F,Z,E,X)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(Z){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!Z)),this},a.normalizeHostname=function(Z){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!Z)),this},a.normalizePort=function(Z){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!Z)),this},a.normalizePath=function(Z){var E=this._parts.path;if(!E)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!Z),this;if(this._parts.path==="/")return this;E=r.recodePath(E);var X,F="",N,O;for(E.charAt(0)!=="/"&&(X=!0,E="/"+E),(E.slice(-3)==="/.."||E.slice(-2)==="/.")&&(E+="/"),E=E.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),X&&(F=E.substring(1).match(/^(\.\.\/)+/)||"",F&&(F=F[0]));N=E.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){E=E.substring(3);continue}O=E.substring(0,N).lastIndexOf("/"),O===-1&&(O=N),E=E.substring(0,O)+E.substring(N+3)}return X&&this.is("relative")&&(E=F+E.substring(1)),this._parts.path=E,this.build(!Z),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(Z){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!Z)),this},a.normalizeFragment=function(Z){return this._parts.fragment||(this._parts.fragment=null,this.build(!Z)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var Z=r.encode,E=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=Z,r.decode=E}return this},a.unicode=function(){var Z=r.encode,E=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=Z,r.decode=E}return this},a.readable=function(){var Z=this.clone();Z.username("").password("").normalize();var E="";if(Z._parts.protocol&&(E+=Z._parts.protocol+"://"),Z._parts.hostname&&(Z.is("punycode")&&e?(E+=e.toUnicode(Z._parts.hostname),Z._parts.port&&(E+=":"+Z._parts.port)):E+=Z.host()),Z._parts.hostname&&Z._parts.path&&Z._parts.path.charAt(0)!=="/"&&(E+="/"),E+=Z.path(!0),Z._parts.query){for(var X="",F=0,N=Z._parts.query.split("&"),O=N.length;F<O;F++){var U=(N[F]||"").split("=");X+="&"+r.decodeQuery(U[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),U[1]!==void 0&&(X+="="+r.decodeQuery(U[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}E+="?"+X.substring(1)}return E+=r.decodeQuery(Z.hash(),!0),E},a.absoluteTo=function(Z){var E=this.clone(),X=["protocol","username","password","hostname","port"],F,N,O;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(Z instanceof r||(Z=new r(Z)),E._parts.protocol||(E._parts.protocol=Z._parts.protocol,this._parts.hostname))return E;for(N=0;O=X[N];N++)E._parts[O]=Z._parts[O];return E._parts.path?(E._parts.path.substring(-2)===".."&&(E._parts.path+="/"),E.path().charAt(0)!=="/"&&(F=Z.directory(),F=F||(Z.path().indexOf("/")===0?"/":""),E._parts.path=(F?F+"/":"")+E._parts.path,E.normalizePath())):(E._parts.path=Z._parts.path,E._parts.query||(E._parts.query=Z._parts.query)),E.build(),E},a.relativeTo=function(Z){var E=this.clone().normalize(),X,F,N,O,U;if(E._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(Z=new r(Z).normalize(),X=E._parts,F=Z._parts,O=E.path(),U=Z.path(),O.charAt(0)!=="/")throw new Error("URI is already relative");if(U.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(X.protocol===F.protocol&&(X.protocol=null),X.username!==F.username||X.password!==F.password||X.protocol!==null||X.username!==null||X.password!==null)return E.build();if(X.hostname===F.hostname&&X.port===F.port)X.hostname=null,X.port=null;else return E.build();if(O===U)return X.path="",E.build();if(N=r.commonPath(O,U),!N)return E.build();var Y=F.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return X.path=Y+X.path.substring(N.length)||"./",E.build()},a.equals=function(Z){var E=this.clone(),X=new r(Z),F={},N={},O={},U,Y,k;if(E.normalize(),X.normalize(),E.toString()===X.toString())return!0;if(U=E.query(),Y=X.query(),E.query(""),X.query(""),E.toString()!==X.toString()||U.length!==Y.length)return!1;F=r.parseQuery(U,this._parts.escapeQuerySpace),N=r.parseQuery(Y,this._parts.escapeQuerySpace);for(k in F)if(c.call(F,k)){if(h(F[k])){if(!f(F[k],N[k]))return!1}else if(F[k]!==N[k])return!1;O[k]=!0}for(k in N)if(c.call(N,k)&&!O[k])return!1;return!0},a.preventInvalidHostname=function(Z){return this._parts.preventInvalidHostname=!!Z,this},a.duplicateQueryParameters=function(Z){return this._parts.duplicateQueryParameters=!!Z,this},a.escapeQuerySpace=function(Z){return this._parts.escapeQuerySpace=!!Z,this},r})});var UH=ld((exports,module)=>{var Ken=T(S());/*!
 * protobuf.js v7.4.0 (c) 2016, daniel wirtz
 * compiled thu, 22 aug 2024 20:30:39 utc
 * licensed under the bsd-3-clause license
 * see: https://github.com/dcodeio/protobuf.js for details
 */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(h,p){s[a]=function(f){if(d)if(d=!1,f)p(f);else{for(var x=new Array(arguments.length-1),_=0;_<x.length;)x[_++]=arguments[_];h.apply(null,x)}};try{o.apply(r||null,s)}catch(g){d&&(d=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(d){var u=d.length;if(!u)return 0;for(var h=0;--u%4>1&&d.charAt(u)==="=";)++h;return Math.ceil(d.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,h){for(var p=null,g=[],f=0,x=0,_;u<h;){var C=d[u++];switch(x){case 0:g[f++]=o[C>>2],_=(C&3)<<4,x=1;break;case 1:g[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:g[f++]=o[_|C>>6],g[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return x&&(g[f++]=o[_],g[f++]=61,x===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,h){for(var p=h,g=0,f,x=0;x<d.length;){var _=d.charCodeAt(x++);if(_===61&&g>1)break;if((_=r[_])===undefined)throw Error(a);switch(g){case 0:f=_,g=1;break;case 1:u[h++]=f<<2|(_&48)>>4,f=_,g=2;break;case 2:u[h++]=(f&15)<<4|(_&60)>>2,f=_,g=3;break;case 3:u[h++]=(f&3)<<6|_,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var d=new Float32Array([-0]),u=new Uint8Array(d.buffer),h=u[3]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3]}function g(_,C,V){d[0]=_,C[V]=u[3],C[V+1]=u[2],C[V+2]=u[1],C[V+3]=u[0]}c.writeFloatLE=h?p:g,c.writeFloatBE=h?g:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],d[0]}function x(_,C){return u[3]=_[C],u[2]=_[C+1],u[1]=_[C+2],u[0]=_[C+3],d[0]}c.readFloatLE=h?f:x,c.readFloatBE=h?x:f}():function(){function d(h,p,g,f){var x=p<0?1:0;if(x&&(p=-p),p===0)h(1/p>0?0:2147483648,g,f);else if(isNaN(p))h(2143289344,g,f);else if(p>34028234663852886e22)h((x<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)h((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,f);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;h((x<<31|_+127<<23|C)>>>0,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(h,p,g){var f=h(p,g),x=(f>>31)*2+1,_=f>>>23&255,C=f&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),h=u[7]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3],C[V+4]=u[4],C[V+5]=u[5],C[V+6]=u[6],C[V+7]=u[7]}function g(_,C,V){d[0]=_,C[V]=u[7],C[V+1]=u[6],C[V+2]=u[5],C[V+3]=u[4],C[V+4]=u[3],C[V+5]=u[2],C[V+6]=u[1],C[V+7]=u[0]}c.writeDoubleLE=h?p:g,c.writeDoubleBE=h?g:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],u[4]=_[C+4],u[5]=_[C+5],u[6]=_[C+6],u[7]=_[C+7],d[0]}function x(_,C){return u[7]=_[C],u[6]=_[C+1],u[5]=_[C+2],u[4]=_[C+3],u[3]=_[C+4],u[2]=_[C+5],u[1]=_[C+6],u[0]=_[C+7],d[0]}c.readDoubleLE=h?f:x,c.readDoubleBE=h?x:f}():function(){function d(h,p,g,f,x,_){var C=f<0?1:0;if(C&&(f=-f),f===0)h(0,x,_+p),h(1/f>0?0:2147483648,x,_+g);else if(isNaN(f))h(0,x,_+p),h(2146959360,x,_+g);else if(f>17976931348623157e292)h(0,x,_+p),h((C<<31|2146435072)>>>0,x,_+g);else{var V;if(f<22250738585072014e-324)V=f/5e-324,h(V>>>0,x,_+p),h((C<<31|V/4294967296)>>>0,x,_+g);else{var L=Math.floor(Math.log(f)/Math.LN2);L===1024&&(L=1023),V=f*Math.pow(2,-L),h(V*4503599627370496>>>0,x,_+p),h((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(h,p,g,f,x){var _=h(f,x+p),C=h(f,x+g),V=(C>>31)*2+1,L=C>>>20&2047,R=4294967296*(C&1048575)+_;return L===2047?R?NaN:V*(1/0):L===0?V*5e-324*R:V*Math.pow(2,L-1075)*(R+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var d=null,u=[],h=0,p;s<a;)p=r[s++],p<128?u[h++]=p:p>191&&p<224?u[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[h++]=55296+(p>>10),u[h++]=56320+(p&1023)):u[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),h=0);return d?(h&&d.push(String.fromCharCode.apply(String,u.slice(0,h))),d.join("")):String.fromCharCode.apply(String,u.slice(0,h))},i.write=function(r,s,a){for(var c=a,d,u,h=0;h<r.length;++h)d=r.charCodeAt(h),d<128?s[a++]=d:d<2048?(s[a++]=d>>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++h,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,x){return RangeError("index out of range: "+f.pos+" + "+(x||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},u=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(_)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function h(){var f=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,f}if(this.len-this.pos>4){for(;x<5;++x)if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,x){return(f[x-4]|f[x-3]<<8|f[x-2]<<16|f[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[x](!1)},uint64:function(){return h.call(this)[x](!0)},sint64:function(){return h.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var h=this;if(!u)return i.asPromise(r,h,s,a,c,d);if(!h.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(g,f){if(g)return h.emit("error",g,s),u(g);if(f===null)return h.end(!0),undefined;if(!(f instanceof c))try{f=c[h.responseDelimited?"decodeDelimited":"decode"](f)}catch(x){return h.emit("error",x,s),u(x)}return h.emit("data",f,s),u(null,f)})}catch(p){return h.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var h=d>>>0,p=(d-h)/4294967296>>>0;return u&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,h=~this.hi>>>0;return u||(h=h+1>>>0),-(u+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u<d.length;++u)(s[d[u]]===undefined||!c)&&(s[d[u]]=a[d[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,d){if(!(this instanceof a))return new a(c,d);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&o(this,d)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},d=0;d<a.length;++d)c[a[d]]=1;return function(){for(var u=Object.keys(this),h=u.length-1;h>-1;--h)if(c[u[h]]===1&&this[u[h]]!==undefined&&this[u[h]]!==null)return u[h]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d<a.length;++d)a[d]!==c&&delete this[a[d]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,d){return new s(c,d)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(L,R,G){this.fn=L,this.len=R,this.next=undefined,this.val=G}function d(){}function u(L){this.head=L.head,this.tail=L.tail,this.len=L.len,this.next=L.states}function h(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(R){return new i.Array(R)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(R,G,I){return this.tail=this.tail.next=new c(R,G,I),this.len+=G,this};function g(L,R,G){R[G]=L&255}function f(L,R,G){for(;L>127;)R[G++]=L&127|128,L>>>=7;R[G]=L}function x(L,R){this.len=L,this.next=undefined,this.val=R}x.prototype=Object.create(c.prototype),x.prototype.fn=f,h.prototype.uint32=function(R){return this.len+=(this.tail=this.tail.next=new x((R=R>>>0)<128?1:R<16384?2:R<2097152?3:R<268435456?4:5,R)).len,this},h.prototype.int32=function(R){return R<0?this._push(_,10,r.fromNumber(R)):this.uint32(R)},h.prototype.sint32=function(R){return this.uint32((R<<1^R>>31)>>>0)};function _(L,R,G){for(;L.hi;)R[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)R[G++]=L.lo&127|128,L.lo=L.lo>>>7;R[G++]=L.lo}h.prototype.uint64=function(R){var G=r.from(R);return this._push(_,G.length(),G)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(R){var G=r.from(R).zzEncode();return this._push(_,G.length(),G)},h.prototype.bool=function(R){return this._push(g,1,R?1:0)};function C(L,R,G){R[G]=L&255,R[G+1]=L>>>8&255,R[G+2]=L>>>16&255,R[G+3]=L>>>24}h.prototype.fixed32=function(R){return this._push(C,4,R>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(R){var G=r.from(R);return this._push(C,4,G.lo)._push(C,4,G.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(R){return this._push(i.float.writeFloatLE,4,R)},h.prototype.double=function(R){return this._push(i.float.writeDoubleLE,8,R)};var V=i.Array.prototype.set?function(R,G,I){G.set(R,I)}:function(R,G,I){for(var v=0;v<R.length;++v)G[I+v]=R[v]};h.prototype.bytes=function(R){var G=R.length>>>0;if(!G)return this._push(g,1,0);if(i.isString(R)){var I=h.alloc(G=s.length(R));s.decode(R,I,0),R=I}return this.uint32(G)._push(V,G,R)},h.prototype.string=function(R){var G=a.length(R);return G?this.uint32(G)._push(a.write,G,R):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},h.prototype.ldelim=function(){var R=this.head,G=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=R.next,this.tail=G,this.len+=I),this},h.prototype.finish=function(){for(var R=this.head.next,G=this.constructor.alloc(this.len),I=0;R;)R.fn(R.val,G,I),I+=R.len,R=R.next;return G},h._configure=function(L){o=L,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var h=0;h<c.length;)d[u++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var d=c.length>>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var Pse=ld((Lz,Rz)=>{var ncn=T(S());(function(e,t){typeof Lz=="object"&&typeof Rz<"u"?Rz.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(Lz,function(){"use strict";function e(_,C,V,L,R){(function G(I,v,P,w,M){for(;w>P;){if(w-P>600){var b=w-P+1,Z=v-P+1,E=Math.log(b),X=.5*Math.exp(2*E/3),F=.5*Math.sqrt(E*X*(b-X)/b)*(Z-b/2<0?-1:1),N=Math.max(P,Math.floor(v-Z*X/b+F)),O=Math.min(w,Math.floor(v+(b-Z)*X/b+F));G(I,v,N,O,M)}var U=I[v],Y=P,k=w;for(t(I,P,v),M(I[w],U)>0&&t(I,P,w);Y<k;){for(t(I,Y,k),Y++,k--;M(I[Y],U)<0;)Y++;for(;M(I[k],U)>0;)k--}M(I[P],U)===0?t(I,P,k):t(I,++k,w),k<=v&&(P=k+1),v<=k&&(w=k-1)}})(_,C,V||0,L||_.length-1,R||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _<C?-1:_>C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L<C.length;L++)if(V(_,C[L]))return L;return-1}function r(_,C){s(_,0,_.children.length,C,_)}function s(_,C,V,L,R){R||(R=f(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var G=C;G<V;G++){var I=_.children[G];a(R,_.leaf?L(I):I)}return R}function a(_,C){return _.minX=Math.min(_.minX,C.minX),_.minY=Math.min(_.minY,C.minY),_.maxX=Math.max(_.maxX,C.maxX),_.maxY=Math.max(_.maxY,C.maxY),_}function c(_,C){return _.minX-C.minX}function d(_,C){return _.minY-C.minY}function u(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function h(_){return _.maxX-_.minX+(_.maxY-_.minY)}function p(_,C){return _.minX<=C.minX&&_.minY<=C.minY&&C.maxX<=_.maxX&&C.maxY<=_.maxY}function g(_,C){return C.minX<=_.maxX&&C.minY<=_.maxY&&C.maxX>=_.minX&&C.maxY>=_.minY}function f(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,R){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var I=C+Math.ceil((V-C)/L/2)*L;e(_,I,C,V,R),G.push(C,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!g(_,C))return V;for(var L=this.toBBox,R=[];C;){for(var G=0;G<C.children.length;G++){var I=C.children[G],v=C.leaf?L(I):I;g(_,v)&&(C.leaf?V.push(I):p(_,v)?this._all(I,V):R.push(I))}C=R.pop()}return V},i.prototype.collides=function(_){var C=this.data;if(!g(_,C))return!1;for(var V=[];C;){for(var L=0;L<C.children.length;L++){var R=C.children[L],G=C.leaf?this.toBBox(R):R;if(g(_,G)){if(C.leaf||p(_,G))return!0;V.push(R)}}C=V.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var C=0;C<_.length;C++)this.insert(_[C]);return this}var V=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===V.height)this._splitRoot(this.data,V);else{if(this.data.height<V.height){var L=this.data;this.data=V,V=L}this._insert(V,this.data.height-V.height-1,!0)}else this.data=V;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(_,C){if(!_)return this;for(var V,L,R,G=this.data,I=this.toBBox(_),v=[],P=[];G||v.length;){if(G||(G=v.pop(),L=v[v.length-1],V=P.pop(),R=!0),G.leaf){var w=o(_,G.children,C);if(w!==-1)return G.children.splice(w,1),v.push(G),this._condense(v),this}R||G.leaf||!p(G,I)?L?(V++,G=L.children[V],R=!1):G=null:(v.push(G),P.push(V),V=0,L=G,G=G.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,C){return _.minX-C.minX},i.prototype.compareMinY=function(_,C){return _.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,C){for(var V=[];_;)_.leaf?C.push.apply(C,_.children):V.push.apply(V,_.children),_=V.pop();return C},i.prototype._build=function(_,C,V,L){var R,G=V-C+1,I=this._maxEntries;if(G<=I)return r(R=f(_.slice(C,V+1)),this.toBBox),R;L||(L=Math.ceil(Math.log(G)/Math.log(I)),I=Math.ceil(G/Math.pow(I,L-1))),(R=f([])).leaf=!1,R.height=L;var v=Math.ceil(G/I),P=v*Math.ceil(Math.sqrt(I));x(_,C,V,P,this.compareMinX);for(var w=C;w<=V;w+=P){var M=Math.min(w+P-1,V);x(_,w,M,v,this.compareMinY);for(var b=w;b<=M;b+=v){var Z=Math.min(b+v-1,M);R.children.push(this._build(_,b,Z,L-1))}}return r(R,this.toBBox),R},i.prototype._chooseSubtree=function(_,C,V,L){for(;L.push(C),!C.leaf&&L.length-1!==V;){for(var R=1/0,G=1/0,I=void 0,v=0;v<C.children.length;v++){var P=C.children[v],w=u(P),M=(b=_,Z=P,(Math.max(Z.maxX,b.maxX)-Math.min(Z.minX,b.minX))*(Math.max(Z.maxY,b.maxY)-Math.min(Z.minY,b.minY))-w);M<G?(G=M,R=w<R?w:R,I=P):M===G&&w<R&&(R=w,I=P)}C=I||C.children[0]}var b,Z;return C},i.prototype._insert=function(_,C,V){var L=V?_:this.toBBox(_),R=[],G=this._chooseSubtree(L,this.data,C,R);for(G.children.push(_),a(G,L);C>=0&&R[C].children.length>this._maxEntries;)this._split(R,C),C--;this._adjustParentBBoxes(L,R,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,R=this._minEntries;this._chooseSplitAxis(V,R,L);var G=this._chooseSplitIndex(V,R,L),I=f(V.children.splice(G,V.children.length-G));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),C?_[C-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(_,C){this.data=f([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,R,G,I,v,P,w,M=1/0,b=1/0,Z=C;Z<=V-C;Z++){var E=s(_,0,Z,this.toBBox),X=s(_,Z,V,this.toBBox),F=(R=E,G=X,I=void 0,v=void 0,P=void 0,w=void 0,I=Math.max(R.minX,G.minX),v=Math.max(R.minY,G.minY),P=Math.min(R.maxX,G.maxX),w=Math.min(R.maxY,G.maxY),Math.max(0,P-I)*Math.max(0,w-v)),N=u(E)+u(X);F<M?(M=F,L=Z,b=N<b?N:b):F===M&&N<b&&(b=N,L=Z)}return L||V-C},i.prototype._chooseSplitAxis=function(_,C,V){var L=_.leaf?this.compareMinX:c,R=_.leaf?this.compareMinY:d;this._allDistMargin(_,C,V,L)<this._allDistMargin(_,C,V,R)&&_.children.sort(L)},i.prototype._allDistMargin=function(_,C,V,L){_.children.sort(L);for(var R=this.toBBox,G=s(_,0,C,R),I=s(_,V-C,V,R),v=h(G)+h(I),P=C;P<V-C;P++){var w=_.children[P];a(G,_.leaf?R(w):w),v+=h(G)}for(var M=V-C-1;M>=C;M--){var b=_.children[M];a(I,_.leaf?R(b):b),v+=h(I)}return v},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var kme=ld((b7n,Nme)=>{"use strict";var g7n=T(S());Nme.exports=A8e;var kP=1e20;function A8e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,h,p,g,f,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,x=Math.floor(d.length/u);f<x;f++)c[f]=d[f*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var _=Array(r*s),C=Array(r*s),V=Array(a),L=Array(a),R=Array(a+1),G=Array(a);for(f=0,x=r*s;f<x;f++){var I=c[f];_[f]=I===1?0:I===0?kP:Math.pow(Math.max(0,.5-I),2),C[f]=I===1?kP:I===0?0:Math.pow(Math.max(0,I-.5),2)}Ame(_,r,s,V,L,G,R),Ame(C,r,s,V,L,G,R);var v=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,x=r*s;f<x;f++)v[f]=Math.min(Math.max(1-((_[f]-C[f])/i+n),0),1);return v}function Ame(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Mme(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Mme(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Mme(e,t,n,i,o){n[0]=0,i[0]=-kP,i[1]=+kP;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+kP}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Yme=ld((F7n,oU)=>{var A7n=T(S());function K8e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,h=11,p=12,g=13,f=14,x=15,_=16,C=17,V=0,L=1,R=2,G=3,I=4;function v(b,Z){return 55296<=b.charCodeAt(Z)&&b.charCodeAt(Z)<=56319&&56320<=b.charCodeAt(Z+1)&&b.charCodeAt(Z+1)<=57343}function P(b,Z){Z===void 0&&(Z=0);var E=b.charCodeAt(Z);if(55296<=E&&E<=56319&&Z<b.length-1){var X=E,F=b.charCodeAt(Z+1);return 56320<=F&&F<=57343?(X-55296)*1024+(F-56320)+65536:X}if(56320<=E&&E<=57343&&Z>=1){var X=b.charCodeAt(Z-1),F=E;return 55296<=X&&X<=56319?(X-55296)*1024+(F-56320)+65536:F}return E}function w(b,Z,E){var X=[b].concat(Z).concat([E]),F=X[X.length-2],N=E,O=X.lastIndexOf(f);if(O>1&&X.slice(1,O).every(function(k){return k==i})&&[i,g,C].indexOf(b)==-1)return R;var U=X.lastIndexOf(o);if(U>0&&X.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(F)==-1)return X.filter(function(k){return k==o}).length%2==1?G:I;if(F==e&&N==t)return V;if(F==n||F==e||F==t)return N==f&&Z.every(function(k){return k==i})?R:L;if(N==n||N==e||N==t)return L;if(F==s&&(N==s||N==a||N==d||N==u))return V;if((F==d||F==a)&&(N==a||N==c))return V;if((F==u||F==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(F==p)return V;var Y=X.indexOf(i)!=-1?X.lastIndexOf(i)-1:X.length-2;return[g,C].indexOf(X[Y])!=-1&&X.slice(Y+1,-1).every(function(k){return k==i})&&N==f||F==x&&[_,C].indexOf(N)!=-1?V:Z.indexOf(o)!=-1?R:F==o&&N==o?V:L}this.nextBreak=function(b,Z){if(Z===void 0&&(Z=0),Z<0)return 0;if(Z>=b.length-1)return b.length;for(var E=M(P(b,Z)),X=[],F=Z+1;F<b.length;F++)if(!v(b,F-1)){var N=M(P(b,F));if(w(E,X,N))return F;X.push(N)}return b.length},this.splitGraphemes=function(b){for(var Z=[],E=0,X;(X=this.nextBreak(b,E))<b.length;)Z.push(b.slice(E,X)),E=X;return E<b.length&&Z.push(b.slice(E)),Z},this.iterateGraphemes=function(b){var Z=0,E={next:function(){var X,F;return(F=this.nextBreak(b,Z))<b.length?(X=b.slice(Z,F),Z=F,{value:X,done:!1}):Z<b.length?(X=b.slice(Z),Z=b.length,{value:X,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(E[Symbol.iterator]=function(){return E}),E},this.countGraphemes=function(b){for(var Z=0,E=0,X;(X=this.nextBreak(b,E))<b.length;)E=X,Z++;return E<b.length&&Z++,Z};function M(b){return 1536<=b&&b<=1541||b==1757||b==1807||b==2274||b==3406||b==69821||70082<=b&&b<=70083||b==72250||72326<=b&&b<=72329||b==73030?p:b==13?e:b==10?t:0<=b&&b<=9||11<=b&&b<=12||14<=b&&b<=31||127<=b&&b<=159||b==173||b==1564||b==6158||b==8203||8206<=b&&b<=8207||b==8232||b==8233||8234<=b&&b<=8238||8288<=b&&b<=8292||b==8293||8294<=b&&b<=8303||55296<=b&&b<=57343||b==65279||65520<=b&&b<=65528||65529<=b&&b<=65531||113824<=b&&b<=113827||119155<=b&&b<=119162||b==917504||b==917505||917506<=b&&b<=917535||917632<=b&&b<=917759||918e3<=b&&b<=921599?n:768<=b&&b<=879||1155<=b&&b<=1159||1160<=b&&b<=1161||1425<=b&&b<=1469||b==1471||1473<=b&&b<=1474||1476<=b&&b<=1477||b==1479||1552<=b&&b<=1562||1611<=b&&b<=1631||b==1648||1750<=b&&b<=1756||1759<=b&&b<=1764||1767<=b&&b<=1768||1770<=b&&b<=1773||b==1809||1840<=b&&b<=1866||1958<=b&&b<=1968||2027<=b&&b<=2035||2070<=b&&b<=2073||2075<=b&&b<=2083||2085<=b&&b<=2087||2089<=b&&b<=2093||2137<=b&&b<=2139||2260<=b&&b<=2273||2275<=b&&b<=2306||b==2362||b==2364||2369<=b&&b<=2376||b==2381||2385<=b&&b<=2391||2402<=b&&b<=2403||b==2433||b==2492||b==2494||2497<=b&&b<=2500||b==2509||b==2519||2530<=b&&b<=2531||2561<=b&&b<=2562||b==2620||2625<=b&&b<=2626||2631<=b&&b<=2632||2635<=b&&b<=2637||b==2641||2672<=b&&b<=2673||b==2677||2689<=b&&b<=2690||b==2748||2753<=b&&b<=2757||2759<=b&&b<=2760||b==2765||2786<=b&&b<=2787||2810<=b&&b<=2815||b==2817||b==2876||b==2878||b==2879||2881<=b&&b<=2884||b==2893||b==2902||b==2903||2914<=b&&b<=2915||b==2946||b==3006||b==3008||b==3021||b==3031||b==3072||3134<=b&&b<=3136||3142<=b&&b<=3144||3146<=b&&b<=3149||3157<=b&&b<=3158||3170<=b&&b<=3171||b==3201||b==3260||b==3263||b==3266||b==3270||3276<=b&&b<=3277||3285<=b&&b<=3286||3298<=b&&b<=3299||3328<=b&&b<=3329||3387<=b&&b<=3388||b==3390||3393<=b&&b<=3396||b==3405||b==3415||3426<=b&&b<=3427||b==3530||b==3535||3538<=b&&b<=3540||b==3542||b==3551||b==3633||3636<=b&&b<=3642||3655<=b&&b<=3662||b==3761||3764<=b&&b<=3769||3771<=b&&b<=3772||3784<=b&&b<=3789||3864<=b&&b<=3865||b==3893||b==3895||b==3897||3953<=b&&b<=3966||3968<=b&&b<=3972||3974<=b&&b<=3975||3981<=b&&b<=3991||3993<=b&&b<=4028||b==4038||4141<=b&&b<=4144||4146<=b&&b<=4151||4153<=b&&b<=4154||4157<=b&&b<=4158||4184<=b&&b<=4185||4190<=b&&b<=4192||4209<=b&&b<=4212||b==4226||4229<=b&&b<=4230||b==4237||b==4253||4957<=b&&b<=4959||5906<=b&&b<=5908||5938<=b&&b<=5940||5970<=b&&b<=5971||6002<=b&&b<=6003||6068<=b&&b<=6069||6071<=b&&b<=6077||b==6086||6089<=b&&b<=6099||b==6109||6155<=b&&b<=6157||6277<=b&&b<=6278||b==6313||6432<=b&&b<=6434||6439<=b&&b<=6440||b==6450||6457<=b&&b<=6459||6679<=b&&b<=6680||b==6683||b==6742||6744<=b&&b<=6750||b==6752||b==6754||6757<=b&&b<=6764||6771<=b&&b<=6780||b==6783||6832<=b&&b<=6845||b==6846||6912<=b&&b<=6915||b==6964||6966<=b&&b<=6970||b==6972||b==6978||7019<=b&&b<=7027||7040<=b&&b<=7041||7074<=b&&b<=7077||7080<=b&&b<=7081||7083<=b&&b<=7085||b==7142||7144<=b&&b<=7145||b==7149||7151<=b&&b<=7153||7212<=b&&b<=7219||7222<=b&&b<=7223||7376<=b&&b<=7378||7380<=b&&b<=7392||7394<=b&&b<=7400||b==7405||b==7412||7416<=b&&b<=7417||7616<=b&&b<=7673||7675<=b&&b<=7679||b==8204||8400<=b&&b<=8412||8413<=b&&b<=8416||b==8417||8418<=b&&b<=8420||8421<=b&&b<=8432||11503<=b&&b<=11505||b==11647||11744<=b&&b<=11775||12330<=b&&b<=12333||12334<=b&&b<=12335||12441<=b&&b<=12442||b==42607||42608<=b&&b<=42610||42612<=b&&b<=42621||42654<=b&&b<=42655||42736<=b&&b<=42737||b==43010||b==43014||b==43019||43045<=b&&b<=43046||43204<=b&&b<=43205||43232<=b&&b<=43249||43302<=b&&b<=43309||43335<=b&&b<=43345||43392<=b&&b<=43394||b==43443||43446<=b&&b<=43449||b==43452||b==43493||43561<=b&&b<=43566||43569<=b&&b<=43570||43573<=b&&b<=43574||b==43587||b==43596||b==43644||b==43696||43698<=b&&b<=43700||43703<=b&&b<=43704||43710<=b&&b<=43711||b==43713||43756<=b&&b<=43757||b==43766||b==44005||b==44008||b==44013||b==64286||65024<=b&&b<=65039||65056<=b&&b<=65071||65438<=b&&b<=65439||b==66045||b==66272||66422<=b&&b<=66426||68097<=b&&b<=68099||68101<=b&&b<=68102||68108<=b&&b<=68111||68152<=b&&b<=68154||b==68159||68325<=b&&b<=68326||b==69633||69688<=b&&b<=69702||69759<=b&&b<=69761||69811<=b&&b<=69814||69817<=b&&b<=69818||69888<=b&&b<=69890||69927<=b&&b<=69931||69933<=b&&b<=69940||b==70003||70016<=b&&b<=70017||70070<=b&&b<=70078||70090<=b&&b<=70092||70191<=b&&b<=70193||b==70196||70198<=b&&b<=70199||b==70206||b==70367||70371<=b&&b<=70378||70400<=b&&b<=70401||b==70460||b==70462||b==70464||b==70487||70502<=b&&b<=70508||70512<=b&&b<=70516||70712<=b&&b<=70719||70722<=b&&b<=70724||b==70726||b==70832||70835<=b&&b<=70840||b==70842||b==70845||70847<=b&&b<=70848||70850<=b&&b<=70851||b==71087||71090<=b&&b<=71093||71100<=b&&b<=71101||71103<=b&&b<=71104||71132<=b&&b<=71133||71219<=b&&b<=71226||b==71229||71231<=b&&b<=71232||b==71339||b==71341||71344<=b&&b<=71349||b==71351||71453<=b&&b<=71455||71458<=b&&b<=71461||71463<=b&&b<=71467||72193<=b&&b<=72198||72201<=b&&b<=72202||72243<=b&&b<=72248||72251<=b&&b<=72254||b==72263||72273<=b&&b<=72278||72281<=b&&b<=72283||72330<=b&&b<=72342||72344<=b&&b<=72345||72752<=b&&b<=72758||72760<=b&&b<=72765||b==72767||72850<=b&&b<=72871||72874<=b&&b<=72880||72882<=b&&b<=72883||72885<=b&&b<=72886||73009<=b&&b<=73014||b==73018||73020<=b&&b<=73021||73023<=b&&b<=73029||b==73031||92912<=b&&b<=92916||92976<=b&&b<=92982||94095<=b&&b<=94098||113821<=b&&b<=113822||b==119141||119143<=b&&b<=119145||119150<=b&&b<=119154||119163<=b&&b<=119170||119173<=b&&b<=119179||119210<=b&&b<=119213||119362<=b&&b<=119364||121344<=b&&b<=121398||121403<=b&&b<=121452||b==121461||b==121476||121499<=b&&b<=121503||121505<=b&&b<=121519||122880<=b&&b<=122886||122888<=b&&b<=122904||122907<=b&&b<=122913||122915<=b&&b<=122916||122918<=b&&b<=122922||125136<=b&&b<=125142||125252<=b&&b<=125258||917536<=b&&b<=917631||917760<=b&&b<=917999?i:127462<=b&&b<=127487?o:b==2307||b==2363||2366<=b&&b<=2368||2377<=b&&b<=2380||2382<=b&&b<=2383||2434<=b&&b<=2435||2495<=b&&b<=2496||2503<=b&&b<=2504||2507<=b&&b<=2508||b==2563||2622<=b&&b<=2624||b==2691||2750<=b&&b<=2752||b==2761||2763<=b&&b<=2764||2818<=b&&b<=2819||b==2880||2887<=b&&b<=2888||2891<=b&&b<=2892||b==3007||3009<=b&&b<=3010||3014<=b&&b<=3016||3018<=b&&b<=3020||3073<=b&&b<=3075||3137<=b&&b<=3140||3202<=b&&b<=3203||b==3262||3264<=b&&b<=3265||3267<=b&&b<=3268||3271<=b&&b<=3272||3274<=b&&b<=3275||3330<=b&&b<=3331||3391<=b&&b<=3392||3398<=b&&b<=3400||3402<=b&&b<=3404||3458<=b&&b<=3459||3536<=b&&b<=3537||3544<=b&&b<=3550||3570<=b&&b<=3571||b==3635||b==3763||3902<=b&&b<=3903||b==3967||b==4145||4155<=b&&b<=4156||4182<=b&&b<=4183||b==4228||b==6070||6078<=b&&b<=6085||6087<=b&&b<=6088||6435<=b&&b<=6438||6441<=b&&b<=6443||6448<=b&&b<=6449||6451<=b&&b<=6456||6681<=b&&b<=6682||b==6741||b==6743||6765<=b&&b<=6770||b==6916||b==6965||b==6971||6973<=b&&b<=6977||6979<=b&&b<=6980||b==7042||b==7073||7078<=b&&b<=7079||b==7082||b==7143||7146<=b&&b<=7148||b==7150||7154<=b&&b<=7155||7204<=b&&b<=7211||7220<=b&&b<=7221||b==7393||7410<=b&&b<=7411||b==7415||43043<=b&&b<=43044||b==43047||43136<=b&&b<=43137||43188<=b&&b<=43203||43346<=b&&b<=43347||b==43395||43444<=b&&b<=43445||43450<=b&&b<=43451||43453<=b&&b<=43456||43567<=b&&b<=43568||43571<=b&&b<=43572||b==43597||b==43755||43758<=b&&b<=43759||b==43765||44003<=b&&b<=44004||44006<=b&&b<=44007||44009<=b&&b<=44010||b==44012||b==69632||b==69634||b==69762||69808<=b&&b<=69810||69815<=b&&b<=69816||b==69932||b==70018||70067<=b&&b<=70069||70079<=b&&b<=70080||70188<=b&&b<=70190||70194<=b&&b<=70195||b==70197||70368<=b&&b<=70370||70402<=b&&b<=70403||b==70463||70465<=b&&b<=70468||70471<=b&&b<=70472||70475<=b&&b<=70477||70498<=b&&b<=70499||70709<=b&&b<=70711||70720<=b&&b<=70721||b==70725||70833<=b&&b<=70834||b==70841||70843<=b&&b<=70844||b==70846||b==70849||71088<=b&&b<=71089||71096<=b&&b<=71099||b==71102||71216<=b&&b<=71218||71227<=b&&b<=71228||b==71230||b==71340||71342<=b&&b<=71343||b==71350||71456<=b&&b<=71457||b==71462||72199<=b&&b<=72200||b==72249||72279<=b&&b<=72280||b==72343||b==72751||b==72766||b==72873||b==72881||b==72884||94033<=b&&b<=94078||b==119142||b==119149?r:4352<=b&&b<=4447||43360<=b&&b<=43388?s:4448<=b&&b<=4519||55216<=b&&b<=55238?a:4520<=b&&b<=4607||55243<=b&&b<=55291?c:b==44032||b==44060||b==44088||b==44116||b==44144||b==44172||b==44200||b==44228||b==44256||b==44284||b==44312||b==44340||b==44368||b==44396||b==44424||b==44452||b==44480||b==44508||b==44536||b==44564||b==44592||b==44620||b==44648||b==44676||b==44704||b==44732||b==44760||b==44788||b==44816||b==44844||b==44872||b==44900||b==44928||b==44956||b==44984||b==45012||b==45040||b==45068||b==45096||b==45124||b==45152||b==45180||b==45208||b==45236||b==45264||b==45292||b==45320||b==45348||b==45376||b==45404||b==45432||b==45460||b==45488||b==45516||b==45544||b==45572||b==45600||b==45628||b==45656||b==45684||b==45712||b==45740||b==45768||b==45796||b==45824||b==45852||b==45880||b==45908||b==45936||b==45964||b==45992||b==46020||b==46048||b==46076||b==46104||b==46132||b==46160||b==46188||b==46216||b==46244||b==46272||b==46300||b==46328||b==46356||b==46384||b==46412||b==46440||b==46468||b==46496||b==46524||b==46552||b==46580||b==46608||b==46636||b==46664||b==46692||b==46720||b==46748||b==46776||b==46804||b==46832||b==46860||b==46888||b==46916||b==46944||b==46972||b==47e3||b==47028||b==47056||b==47084||b==47112||b==47140||b==47168||b==47196||b==47224||b==47252||b==47280||b==47308||b==47336||b==47364||b==47392||b==47420||b==47448||b==47476||b==47504||b==47532||b==47560||b==47588||b==47616||b==47644||b==47672||b==47700||b==47728||b==47756||b==47784||b==47812||b==47840||b==47868||b==47896||b==47924||b==47952||b==47980||b==48008||b==48036||b==48064||b==48092||b==48120||b==48148||b==48176||b==48204||b==48232||b==48260||b==48288||b==48316||b==48344||b==48372||b==48400||b==48428||b==48456||b==48484||b==48512||b==48540||b==48568||b==48596||b==48624||b==48652||b==48680||b==48708||b==48736||b==48764||b==48792||b==48820||b==48848||b==48876||b==48904||b==48932||b==48960||b==48988||b==49016||b==49044||b==49072||b==49100||b==49128||b==49156||b==49184||b==49212||b==49240||b==49268||b==49296||b==49324||b==49352||b==49380||b==49408||b==49436||b==49464||b==49492||b==49520||b==49548||b==49576||b==49604||b==49632||b==49660||b==49688||b==49716||b==49744||b==49772||b==49800||b==49828||b==49856||b==49884||b==49912||b==49940||b==49968||b==49996||b==50024||b==50052||b==50080||b==50108||b==50136||b==50164||b==50192||b==50220||b==50248||b==50276||b==50304||b==50332||b==50360||b==50388||b==50416||b==50444||b==50472||b==50500||b==50528||b==50556||b==50584||b==50612||b==50640||b==50668||b==50696||b==50724||b==50752||b==50780||b==50808||b==50836||b==50864||b==50892||b==50920||b==50948||b==50976||b==51004||b==51032||b==51060||b==51088||b==51116||b==51144||b==51172||b==51200||b==51228||b==51256||b==51284||b==51312||b==51340||b==51368||b==51396||b==51424||b==51452||b==51480||b==51508||b==51536||b==51564||b==51592||b==51620||b==51648||b==51676||b==51704||b==51732||b==51760||b==51788||b==51816||b==51844||b==51872||b==51900||b==51928||b==51956||b==51984||b==52012||b==52040||b==52068||b==52096||b==52124||b==52152||b==52180||b==52208||b==52236||b==52264||b==52292||b==52320||b==52348||b==52376||b==52404||b==52432||b==52460||b==52488||b==52516||b==52544||b==52572||b==52600||b==52628||b==52656||b==52684||b==52712||b==52740||b==52768||b==52796||b==52824||b==52852||b==52880||b==52908||b==52936||b==52964||b==52992||b==53020||b==53048||b==53076||b==53104||b==53132||b==53160||b==53188||b==53216||b==53244||b==53272||b==53300||b==53328||b==53356||b==53384||b==53412||b==53440||b==53468||b==53496||b==53524||b==53552||b==53580||b==53608||b==53636||b==53664||b==53692||b==53720||b==53748||b==53776||b==53804||b==53832||b==53860||b==53888||b==53916||b==53944||b==53972||b==54e3||b==54028||b==54056||b==54084||b==54112||b==54140||b==54168||b==54196||b==54224||b==54252||b==54280||b==54308||b==54336||b==54364||b==54392||b==54420||b==54448||b==54476||b==54504||b==54532||b==54560||b==54588||b==54616||b==54644||b==54672||b==54700||b==54728||b==54756||b==54784||b==54812||b==54840||b==54868||b==54896||b==54924||b==54952||b==54980||b==55008||b==55036||b==55064||b==55092||b==55120||b==55148||b==55176?d:44033<=b&&b<=44059||44061<=b&&b<=44087||44089<=b&&b<=44115||44117<=b&&b<=44143||44145<=b&&b<=44171||44173<=b&&b<=44199||44201<=b&&b<=44227||44229<=b&&b<=44255||44257<=b&&b<=44283||44285<=b&&b<=44311||44313<=b&&b<=44339||44341<=b&&b<=44367||44369<=b&&b<=44395||44397<=b&&b<=44423||44425<=b&&b<=44451||44453<=b&&b<=44479||44481<=b&&b<=44507||44509<=b&&b<=44535||44537<=b&&b<=44563||44565<=b&&b<=44591||44593<=b&&b<=44619||44621<=b&&b<=44647||44649<=b&&b<=44675||44677<=b&&b<=44703||44705<=b&&b<=44731||44733<=b&&b<=44759||44761<=b&&b<=44787||44789<=b&&b<=44815||44817<=b&&b<=44843||44845<=b&&b<=44871||44873<=b&&b<=44899||44901<=b&&b<=44927||44929<=b&&b<=44955||44957<=b&&b<=44983||44985<=b&&b<=45011||45013<=b&&b<=45039||45041<=b&&b<=45067||45069<=b&&b<=45095||45097<=b&&b<=45123||45125<=b&&b<=45151||45153<=b&&b<=45179||45181<=b&&b<=45207||45209<=b&&b<=45235||45237<=b&&b<=45263||45265<=b&&b<=45291||45293<=b&&b<=45319||45321<=b&&b<=45347||45349<=b&&b<=45375||45377<=b&&b<=45403||45405<=b&&b<=45431||45433<=b&&b<=45459||45461<=b&&b<=45487||45489<=b&&b<=45515||45517<=b&&b<=45543||45545<=b&&b<=45571||45573<=b&&b<=45599||45601<=b&&b<=45627||45629<=b&&b<=45655||45657<=b&&b<=45683||45685<=b&&b<=45711||45713<=b&&b<=45739||45741<=b&&b<=45767||45769<=b&&b<=45795||45797<=b&&b<=45823||45825<=b&&b<=45851||45853<=b&&b<=45879||45881<=b&&b<=45907||45909<=b&&b<=45935||45937<=b&&b<=45963||45965<=b&&b<=45991||45993<=b&&b<=46019||46021<=b&&b<=46047||46049<=b&&b<=46075||46077<=b&&b<=46103||46105<=b&&b<=46131||46133<=b&&b<=46159||46161<=b&&b<=46187||46189<=b&&b<=46215||46217<=b&&b<=46243||46245<=b&&b<=46271||46273<=b&&b<=46299||46301<=b&&b<=46327||46329<=b&&b<=46355||46357<=b&&b<=46383||46385<=b&&b<=46411||46413<=b&&b<=46439||46441<=b&&b<=46467||46469<=b&&b<=46495||46497<=b&&b<=46523||46525<=b&&b<=46551||46553<=b&&b<=46579||46581<=b&&b<=46607||46609<=b&&b<=46635||46637<=b&&b<=46663||46665<=b&&b<=46691||46693<=b&&b<=46719||46721<=b&&b<=46747||46749<=b&&b<=46775||46777<=b&&b<=46803||46805<=b&&b<=46831||46833<=b&&b<=46859||46861<=b&&b<=46887||46889<=b&&b<=46915||46917<=b&&b<=46943||46945<=b&&b<=46971||46973<=b&&b<=46999||47001<=b&&b<=47027||47029<=b&&b<=47055||47057<=b&&b<=47083||47085<=b&&b<=47111||47113<=b&&b<=47139||47141<=b&&b<=47167||47169<=b&&b<=47195||47197<=b&&b<=47223||47225<=b&&b<=47251||47253<=b&&b<=47279||47281<=b&&b<=47307||47309<=b&&b<=47335||47337<=b&&b<=47363||47365<=b&&b<=47391||47393<=b&&b<=47419||47421<=b&&b<=47447||47449<=b&&b<=47475||47477<=b&&b<=47503||47505<=b&&b<=47531||47533<=b&&b<=47559||47561<=b&&b<=47587||47589<=b&&b<=47615||47617<=b&&b<=47643||47645<=b&&b<=47671||47673<=b&&b<=47699||47701<=b&&b<=47727||47729<=b&&b<=47755||47757<=b&&b<=47783||47785<=b&&b<=47811||47813<=b&&b<=47839||47841<=b&&b<=47867||47869<=b&&b<=47895||47897<=b&&b<=47923||47925<=b&&b<=47951||47953<=b&&b<=47979||47981<=b&&b<=48007||48009<=b&&b<=48035||48037<=b&&b<=48063||48065<=b&&b<=48091||48093<=b&&b<=48119||48121<=b&&b<=48147||48149<=b&&b<=48175||48177<=b&&b<=48203||48205<=b&&b<=48231||48233<=b&&b<=48259||48261<=b&&b<=48287||48289<=b&&b<=48315||48317<=b&&b<=48343||48345<=b&&b<=48371||48373<=b&&b<=48399||48401<=b&&b<=48427||48429<=b&&b<=48455||48457<=b&&b<=48483||48485<=b&&b<=48511||48513<=b&&b<=48539||48541<=b&&b<=48567||48569<=b&&b<=48595||48597<=b&&b<=48623||48625<=b&&b<=48651||48653<=b&&b<=48679||48681<=b&&b<=48707||48709<=b&&b<=48735||48737<=b&&b<=48763||48765<=b&&b<=48791||48793<=b&&b<=48819||48821<=b&&b<=48847||48849<=b&&b<=48875||48877<=b&&b<=48903||48905<=b&&b<=48931||48933<=b&&b<=48959||48961<=b&&b<=48987||48989<=b&&b<=49015||49017<=b&&b<=49043||49045<=b&&b<=49071||49073<=b&&b<=49099||49101<=b&&b<=49127||49129<=b&&b<=49155||49157<=b&&b<=49183||49185<=b&&b<=49211||49213<=b&&b<=49239||49241<=b&&b<=49267||49269<=b&&b<=49295||49297<=b&&b<=49323||49325<=b&&b<=49351||49353<=b&&b<=49379||49381<=b&&b<=49407||49409<=b&&b<=49435||49437<=b&&b<=49463||49465<=b&&b<=49491||49493<=b&&b<=49519||49521<=b&&b<=49547||49549<=b&&b<=49575||49577<=b&&b<=49603||49605<=b&&b<=49631||49633<=b&&b<=49659||49661<=b&&b<=49687||49689<=b&&b<=49715||49717<=b&&b<=49743||49745<=b&&b<=49771||49773<=b&&b<=49799||49801<=b&&b<=49827||49829<=b&&b<=49855||49857<=b&&b<=49883||49885<=b&&b<=49911||49913<=b&&b<=49939||49941<=b&&b<=49967||49969<=b&&b<=49995||49997<=b&&b<=50023||50025<=b&&b<=50051||50053<=b&&b<=50079||50081<=b&&b<=50107||50109<=b&&b<=50135||50137<=b&&b<=50163||50165<=b&&b<=50191||50193<=b&&b<=50219||50221<=b&&b<=50247||50249<=b&&b<=50275||50277<=b&&b<=50303||50305<=b&&b<=50331||50333<=b&&b<=50359||50361<=b&&b<=50387||50389<=b&&b<=50415||50417<=b&&b<=50443||50445<=b&&b<=50471||50473<=b&&b<=50499||50501<=b&&b<=50527||50529<=b&&b<=50555||50557<=b&&b<=50583||50585<=b&&b<=50611||50613<=b&&b<=50639||50641<=b&&b<=50667||50669<=b&&b<=50695||50697<=b&&b<=50723||50725<=b&&b<=50751||50753<=b&&b<=50779||50781<=b&&b<=50807||50809<=b&&b<=50835||50837<=b&&b<=50863||50865<=b&&b<=50891||50893<=b&&b<=50919||50921<=b&&b<=50947||50949<=b&&b<=50975||50977<=b&&b<=51003||51005<=b&&b<=51031||51033<=b&&b<=51059||51061<=b&&b<=51087||51089<=b&&b<=51115||51117<=b&&b<=51143||51145<=b&&b<=51171||51173<=b&&b<=51199||51201<=b&&b<=51227||51229<=b&&b<=51255||51257<=b&&b<=51283||51285<=b&&b<=51311||51313<=b&&b<=51339||51341<=b&&b<=51367||51369<=b&&b<=51395||51397<=b&&b<=51423||51425<=b&&b<=51451||51453<=b&&b<=51479||51481<=b&&b<=51507||51509<=b&&b<=51535||51537<=b&&b<=51563||51565<=b&&b<=51591||51593<=b&&b<=51619||51621<=b&&b<=51647||51649<=b&&b<=51675||51677<=b&&b<=51703||51705<=b&&b<=51731||51733<=b&&b<=51759||51761<=b&&b<=51787||51789<=b&&b<=51815||51817<=b&&b<=51843||51845<=b&&b<=51871||51873<=b&&b<=51899||51901<=b&&b<=51927||51929<=b&&b<=51955||51957<=b&&b<=51983||51985<=b&&b<=52011||52013<=b&&b<=52039||52041<=b&&b<=52067||52069<=b&&b<=52095||52097<=b&&b<=52123||52125<=b&&b<=52151||52153<=b&&b<=52179||52181<=b&&b<=52207||52209<=b&&b<=52235||52237<=b&&b<=52263||52265<=b&&b<=52291||52293<=b&&b<=52319||52321<=b&&b<=52347||52349<=b&&b<=52375||52377<=b&&b<=52403||52405<=b&&b<=52431||52433<=b&&b<=52459||52461<=b&&b<=52487||52489<=b&&b<=52515||52517<=b&&b<=52543||52545<=b&&b<=52571||52573<=b&&b<=52599||52601<=b&&b<=52627||52629<=b&&b<=52655||52657<=b&&b<=52683||52685<=b&&b<=52711||52713<=b&&b<=52739||52741<=b&&b<=52767||52769<=b&&b<=52795||52797<=b&&b<=52823||52825<=b&&b<=52851||52853<=b&&b<=52879||52881<=b&&b<=52907||52909<=b&&b<=52935||52937<=b&&b<=52963||52965<=b&&b<=52991||52993<=b&&b<=53019||53021<=b&&b<=53047||53049<=b&&b<=53075||53077<=b&&b<=53103||53105<=b&&b<=53131||53133<=b&&b<=53159||53161<=b&&b<=53187||53189<=b&&b<=53215||53217<=b&&b<=53243||53245<=b&&b<=53271||53273<=b&&b<=53299||53301<=b&&b<=53327||53329<=b&&b<=53355||53357<=b&&b<=53383||53385<=b&&b<=53411||53413<=b&&b<=53439||53441<=b&&b<=53467||53469<=b&&b<=53495||53497<=b&&b<=53523||53525<=b&&b<=53551||53553<=b&&b<=53579||53581<=b&&b<=53607||53609<=b&&b<=53635||53637<=b&&b<=53663||53665<=b&&b<=53691||53693<=b&&b<=53719||53721<=b&&b<=53747||53749<=b&&b<=53775||53777<=b&&b<=53803||53805<=b&&b<=53831||53833<=b&&b<=53859||53861<=b&&b<=53887||53889<=b&&b<=53915||53917<=b&&b<=53943||53945<=b&&b<=53971||53973<=b&&b<=53999||54001<=b&&b<=54027||54029<=b&&b<=54055||54057<=b&&b<=54083||54085<=b&&b<=54111||54113<=b&&b<=54139||54141<=b&&b<=54167||54169<=b&&b<=54195||54197<=b&&b<=54223||54225<=b&&b<=54251||54253<=b&&b<=54279||54281<=b&&b<=54307||54309<=b&&b<=54335||54337<=b&&b<=54363||54365<=b&&b<=54391||54393<=b&&b<=54419||54421<=b&&b<=54447||54449<=b&&b<=54475||54477<=b&&b<=54503||54505<=b&&b<=54531||54533<=b&&b<=54559||54561<=b&&b<=54587||54589<=b&&b<=54615||54617<=b&&b<=54643||54645<=b&&b<=54671||54673<=b&&b<=54699||54701<=b&&b<=54727||54729<=b&&b<=54755||54757<=b&&b<=54783||54785<=b&&b<=54811||54813<=b&&b<=54839||54841<=b&&b<=54867||54869<=b&&b<=54895||54897<=b&&b<=54923||54925<=b&&b<=54951||54953<=b&&b<=54979||54981<=b&&b<=55007||55009<=b&&b<=55035||55037<=b&&b<=55063||55065<=b&&b<=55091||55093<=b&&b<=55119||55121<=b&&b<=55147||55149<=b&&b<=55175||55177<=b&&b<=55203?u:b==9757||b==9977||9994<=b&&b<=9997||b==127877||127938<=b&&b<=127940||b==127943||127946<=b&&b<=127948||128066<=b&&b<=128067||128070<=b&&b<=128080||b==128110||128112<=b&&b<=128120||b==128124||128129<=b&&b<=128131||128133<=b&&b<=128135||b==128170||128372<=b&&b<=128373||b==128378||b==128400||128405<=b&&b<=128406||128581<=b&&b<=128583||128587<=b&&b<=128591||b==128675||128692<=b&&b<=128694||b==128704||b==128716||129304<=b&&b<=129308||129310<=b&&b<=129311||b==129318||129328<=b&&b<=129337||129341<=b&&b<=129342||129489<=b&&b<=129501?g:127995<=b&&b<=127999?f:b==8205?x:b==9792||b==9794||9877<=b&&b<=9878||b==9992||b==10084||b==127752||b==127806||b==127859||b==127891||b==127908||b==127912||b==127979||b==127981||b==128139||128187<=b&&b<=128188||b==128295||b==128300||b==128488||b==128640||b==128658?_:128102<=b&&b<=128105?C:h}return this}typeof oU<"u"&&oU.exports&&(oU.exports=K8e)});var qSe=ld((iio,dO)=>{var oio=T(S());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=c(u,h.inputOffset||0,p),f=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,x=r(g,h.pixelType||Float32Array,h.encodedMaskData,f,h.returnMask),_={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),h.returnEncodedMask&&g.mask&&(_.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(_.fileInfo=s(g),h.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(g))),_};var r=function(u,h,p,g,f){var x=0,_=u.pixels.numBlocksX,C=u.pixels.numBlocksY,V=Math.floor(u.width/_),L=Math.floor(u.height/C),R=2*u.maxZError,G=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new h(u.width*u.height),f&&p&&(P=new Uint8Array(u.width*u.height));for(var w=new Float32Array(V*L),M,b,Z=0;Z<=C;Z++){var E=Z!==C?L:u.height%C;if(E!==0)for(var X=0;X<=_;X++){var F=X!==_?V:u.width%_;if(F!==0){var N=Z*u.width*L+X*V,O=u.width-F,U=u.pixels.blocks[x],Y,k,H;U.encoding<2?(U.encoding===0?Y=U.rawData:(d(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,R,w,u.pixels.maxValue),Y=w),k=0):U.encoding===2?H=0:H=U.offset;var K;if(p)for(b=0;b<E;b++){for(N&7&&(K=p[N>>3],K<<=N&7),M=0;M<F;M++)N&7||(K=p[N>>3]),K&128?(P&&(P[N]=1),I=U.encoding<2?Y[k++]:H,G=G>I?I:G,v[N++]=I):(P&&(P[N]=0),v[N++]=g),K<<=1;N+=O}else if(U.encoding<2)for(b=0;b<E;b++){for(M=0;M<F;M++)I=Y[k++],G=G>I?I:G,v[N++]=I;N+=O}else for(G=G>H?H:G,b=0;b<E;b++){for(M=0;M<F;M++)v[N++]=H;N+=O}if(U.encoding===1&&k!==U.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:v,resultMask:P,minValue:G}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var h=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},g=0;g<h;g++){var f=u.pixels.blocks[g];f.encoding===0?p.float32=!0:f.encoding===1?p[f.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(u,h,p){var g={},f=new Uint8Array(u,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,f),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var x=new DataView(u,h,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),h+=24,!p)if(x=new DataView(u,h,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var _=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(u,h,g.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var R=x.getUint8(V++);for(C=-C;C--;)_[L++]=R}C=x.getInt16(V,!0),V+=2}while(V<g.mask.numBytes);if(C!==-32768||L<_.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=_,h+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(u,h,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),h+=16;var G=g.pixels.numBlocksX,I=g.pixels.numBlocksY,v=G+(g.width%G>0?1:0),P=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(v*P);for(var w=0,M=0;M<P;M++)for(var b=0;b<v;b++){var Z=0,E=u.byteLength-h;x=new DataView(u,h,Math.min(10,E));var X={};g.pixels.blocks[w++]=X;var F=x.getUint8(0);if(Z++,X.encoding=F&63,X.encoding>3)throw"Invalid block encoding ("+X.encoding+")";if(X.encoding===2){h++;continue}if(F!==0&&F!==2){if(F>>=6,X.offsetType=F,F===2)X.offset=x.getInt8(1),Z++;else if(F===1)X.offset=x.getInt16(1,!0),Z+=2;else if(F===0)X.offset=x.getFloat32(1,!0),Z+=4;else throw"Invalid block offset type";if(X.encoding===1)if(F=x.getUint8(Z),Z++,X.bitsPerPixel=F&63,F>>=6,X.numValidPixelsType=F,F===2)X.numValidPixels=x.getUint8(Z),Z++;else if(F===1)X.numValidPixels=x.getUint16(Z,!0),Z+=2;else if(F===0)X.numValidPixels=x.getUint32(Z,!0),Z+=4;else throw"Invalid valid pixel count type"}if(h+=Z,X.encoding!==3){var N,O;if(X.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";N=new ArrayBuffer(U*4),O=new Uint8Array(N),O.set(new Uint8Array(u,h,U*4));var Y=new Float32Array(N);X.rawData=Y,h+=U*4}else if(X.encoding===1){var k=Math.ceil(X.numValidPixels*X.bitsPerPixel/8),H=Math.ceil(k/4);N=new ArrayBuffer(H*4),O=new Uint8Array(N),O.set(new Uint8Array(u,h,k)),X.stuffedData=new Uint32Array(N),h+=k}}}return g.eofOffset=h,g},d=function(u,h,p,g,f,x,_){var C=(1<<h)-1,V=0,L,R=0,G,I,v=Math.ceil((_-g)/f),P=u.length*4-Math.ceil(h*p/8);for(u[u.length-1]<<=8*P,L=0;L<p;L++){if(R===0&&(I=u[V++],R=32),R>=h)G=I>>>R-h&C,R-=h;else{var w=h-R;G=(I&C)<<w&C,I=u[V++],R=32-w,G+=I>>>R}x[L]=G<v?g+G*f:_}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,d,u,h,p,g,f,x){var _=(1<<u)-1,C=0,V,L=0,R,G,I,v,P=c.length*4-Math.ceil(u*h/8);if(c[c.length-1]<<=8*P,p)for(V=0;V<h;V++)L===0&&(G=c[C++],L=32),L>=u?(R=G>>>L-u&_,L-=u):(I=u-L,R=(G&_)<<I&_,G=c[C++],L=32-I,R+=G>>>L),d[V]=p[R];else for(v=Math.ceil((x-g)/f),V=0;V<h;V++)L===0&&(G=c[C++],L=32),L>=u?(R=G>>>L-u&_,L-=u):(I=u-L,R=(G&_)<<I&_,G=c[C++],L=32-I,R+=G>>>L),d[V]=R<v?g+R*f:x},unstuffLUT:function(c,d,u,h,p,g){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,R,G=[],I=c.length*4-Math.ceil(d*u/8);c[c.length-1]<<=8*I;var v=Math.ceil((g-h)/p);for(_=0;_<u;_++)V===0&&(R=c[x++],V=32),V>=d?(L=R>>>V-d&f,V-=d):(C=d-V,L=(R&f)<<C&f,R=c[x++],V=32-C,L+=R>>>V),G[_]=L<v?h+L*p:g;return G.unshift(h),G},unstuff2:function(c,d,u,h,p,g,f,x){var _=(1<<u)-1,C=0,V,L=0,R=0,G,I,v;if(p)for(V=0;V<h;V++)L===0&&(I=c[C++],L=32,R=0),L>=u?(G=I>>>R&_,L-=u,R+=u):(v=u-L,G=I>>>R&_,I=c[C++],L=32-v,G|=(I&(1<<v)-1)<<u-v,R=v),d[V]=p[G];else{var P=Math.ceil((x-g)/f);for(V=0;V<h;V++)L===0&&(I=c[C++],L=32,R=0),L>=u?(G=I>>>R&_,L-=u,R+=u):(v=u-L,G=I>>>R&_,I=c[C++],L=32-v,G|=(I&(1<<v)-1)<<u-v,R=v),d[V]=G<P?g+G*f:x}return d},unstuffLUT2:function(c,d,u,h,p,g){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,R=0,G,I=[],v=Math.ceil((g-h)/p);for(_=0;_<u;_++)V===0&&(G=c[x++],V=32,R=0),V>=d?(L=G>>>R&f,V-=d,R+=d):(C=d-V,L=G>>>R&f,G=c[x++],V=32-C,L|=(G&(1<<C)-1)<<d-C,R=C),I[_]=L<v?h+L*p:g;return I.unshift(h),I},originalUnstuff:function(c,d,u,h){var p=(1<<u)-1,g=0,f,x=0,_,C,V,L=c.length*4-Math.ceil(u*h/8);for(c[c.length-1]<<=8*L,f=0;f<h;f++)x===0&&(C=c[g++],x=32),x>=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<<V&p,C=c[g++],x=32-V,_+=C>>>x),d[f]=_;return d},originalUnstuff2:function(c,d,u,h){var p=(1<<u)-1,g=0,f,x=0,_=0,C,V,L;for(f=0;f<h;f++)x===0&&(V=c[g++],x=32,_=0),x>=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[g++],x=32-L,C|=(V&(1<<L)-1)<<u-L,_=L),d[f]=C;return d}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var d=65535,u=65535,h=c.length,p=Math.floor(h/2),g=0;p;){var f=p>=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return h&1&&(u+=d+=c[g]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,h=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var x,_;if(f>=3&&(_=f>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,h=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),g=this.readSubArray(c,d.ptr,h,p),f=this.readSubArray(c,d.ptr+p,h,p);d.ptr+=2*p;var x,_=!0;for(x=0;x<u.numDims;x++)if(g[x]!==f[x]){_=!1;break}return u.minValues=g,u.maxValues=f,_},readSubArray:function(c,d,u,h){var p;if(u===Uint8Array)p=new Uint8Array(c,d,h);else{var g=new ArrayBuffer(h),f=new Uint8Array(g);f.set(new Uint8Array(c,d,h)),p=new u(g)}return p},readMask:function(c,d){var u=d.ptr,h=d.headerInfo,p=h.width*h.height,g=h.numValidPixel,f=new DataView(c,u,4),x={};if(x.numBytes=f.getUint32(0,!0),u+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var _,C;if(g===0)_=new Uint8Array(Math.ceil(p/8)),x.bitset=_,C=new Uint8Array(p),d.pixels.resultMask=C,u+=x.numBytes;else if(x.numBytes>0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,x.numBytes);var V=f.getInt16(0,!0),L=2,R=0,G=0;do{if(V>0)for(;V--;)_[R++]=f.getUint8(L++);else for(G=f.getUint8(L++),V=-V;V--;)_[R++]=G;V=f.getInt16(L,!0),L+=2}while(L<x.numBytes);if(V!==-32768||R<_.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var I=0,v=0;for(v=0;v<p;v++)v&7?(I=_[v>>3],I<<=v&7):I=_[v>>3],I&128&&(C[v]=1);d.pixels.resultMask=C,x.bitset=_,u+=x.numBytes}return d.ptr=u,d.mask=x,!0},readDataOneSweep:function(c,d,u){var h=d.ptr,p=d.headerInfo,g=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*g,C,V=d.pixels.resultMask;if(u===Uint8Array)C=new Uint8Array(c,h,_);else{var L=new ArrayBuffer(_),R=new Uint8Array(L);R.set(new Uint8Array(c,h,_)),C=new u(L)}if(C.length===f*g)d.pixels.resultPixels=C;else{d.pixels.resultPixels=new u(f*g);var G=0,I=0,v=0,P=0;if(g>1)for(v=0;v<g;v++)for(P=v*f,I=0;I<f;I++)V[I]&&(d.pixels.resultPixels[P+I]=C[G++]);else for(I=0;I<f;I++)V[I]&&(d.pixels.resultPixels[I]=C[G++])}return h+=_,d.ptr=h,!0},readHuffmanTree:function(c,d){var u=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,d.ptr,16);d.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),f=h.getInt32(8,!0),x=h.getInt32(12,!0);if(f>=x)return!1;var _=new Uint32Array(x-f);r.decodeBits(c,d,_);var C=[],V,L,R,G;for(V=f;V<x;V++)L=V-(V<g?0:g),C[L]={first:_[V-f],second:null};var I=c.byteLength-d.ptr,v=Math.ceil(I/4),P=new ArrayBuffer(v*4),w=new Uint8Array(P);w.set(new Uint8Array(c,d.ptr,I));var M=new Uint32Array(P),b=0,Z,E=0;for(Z=M[0],V=f;V<x;V++)L=V-(V<g?0:g),G=C[L].first,G>0&&(C[L].second=Z<<b>>>32-G,32-b>=G?(b+=G,b===32&&(b=0,E++,Z=M[E])):(b+=G-32,E++,Z=M[E],C[L].second|=Z>>>32-b));var X=0,F=0,N=new s;for(V=0;V<C.length;V++)C[V]!==void 0&&(X=Math.max(X,C[V].first));X>=u?F=u:F=X,X>=30&&console.log("WARning, large NUM LUT BITS IS "+X);var O=[],U,Y,k,H,K,te;for(V=f;V<x;V++)if(L=V-(V<g?0:g),G=C[L].first,G>0)if(U=[G,L],G<=F)for(Y=C[L].second<<F-G,k=1<<F-G,R=0;R<k;R++)O[Y|R]=U;else for(Y=C[L].second,te=N,H=G-1;H>=0;H--)K=Y>>>H&1,K?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),H===0&&!te.val&&(te.val=U[1]);return{decodeLut:O,numBitsLUTQick:F,numBitsLUT:X,tree:N,stuffedData:M,srcPtr:E,bitPos:b}},readHuffman:function(c,d,u){var h=d.headerInfo,p=h.numDims,g=d.headerInfo.height,f=d.headerInfo.width,x=f*g,_=this.readHuffmanTree(c,d),C=_.decodeLut,V=_.tree,L=_.stuffedData,R=_.srcPtr,G=_.bitPos,I=_.numBitsLUTQick,v=_.numBitsLUT,P=d.headerInfo.imageType===0?128:0,w,M,b,Z=d.pixels.resultMask,E,X,F,N,O,U,Y,k=0;G>0&&(R++,G=0);var H=L[R],K=d.encodeMode===1,te=new u(x*p),z=te,j;for(j=0;j<h.numDims;j++){if(p>1&&(z=new u(te.buffer,x*j,x),k=0),d.headerInfo.numValidPixel===f*g)for(U=0,N=0;N<g;N++)for(O=0;O<f;O++,U++){if(M=0,E=H<<G>>>32-I,X=E,32-G<I&&(E|=L[R+1]>>>64-G-I,X=E),C[X])M=C[X][1],G+=C[X][0];else for(E=H<<G>>>32-v,X=E,32-G<v&&(E|=L[R+1]>>>64-G-v,X=E),w=V,Y=0;Y<v;Y++)if(F=E>>>v-Y-1&1,w=F?w.right:w.left,!(w.left||w.right)){M=w.val,G=G+Y+1;break}G>=32&&(G-=32,R++,H=L[R]),b=M-P,K?(O>0?b+=k:N>0?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}else for(U=0,N=0;N<g;N++)for(O=0;O<f;O++,U++)if(Z[U]){if(M=0,E=H<<G>>>32-I,X=E,32-G<I&&(E|=L[R+1]>>>64-G-I,X=E),C[X])M=C[X][1],G+=C[X][0];else for(E=H<<G>>>32-v,X=E,32-G<v&&(E|=L[R+1]>>>64-G-v,X=E),w=V,Y=0;Y<v;Y++)if(F=E>>>v-Y-1&1,w=F?w.right:w.left,!(w.left||w.right)){M=w.val,G=G+Y+1;break}G>=32&&(G-=32,R++,H=L[R]),b=M-P,K?(O>0&&Z[U-1]?b+=k:N>0&&Z[U-f]?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}d.ptr=d.ptr+(R+1)*4+(G>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,h,p){{var g=d.headerInfo,f=g.fileVersion,x=0,_=new DataView(c,d.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,R=(C&32)>0,G=C&31,I=0;if(L===1)I=_.getUint8(x),x++;else if(L===2)I=_.getUint16(x,!0),x+=2;else if(L===4)I=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var v=2*g.maxZError,P,w,M,b,Z,E,X,F,N,O,U=g.numDims>1?g.maxValues[p]:g.zMax;if(R){for(d.counter.lut++,F=_.getUint8(x),N=G,x++,b=Math.ceil((F-1)*G/8),Z=Math.ceil(b/4),w=new ArrayBuffer(Z*4),M=new Uint8Array(w),d.ptr+=x,M.set(new Uint8Array(c,d.ptr,b)),X=new Uint32Array(w),d.ptr+=b,O=0;F-1>>>O;)O++;b=Math.ceil(I*O/8),Z=Math.ceil(b/4),w=new ArrayBuffer(Z*4),M=new Uint8Array(w),M.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?E=o.unstuffLUT2(X,G,F-1,h,v,U):E=o.unstuffLUT(X,G,F-1,h,v,U),f>=3?o.unstuff2(P,u,O,I,E):o.unstuff(P,u,O,I,E)}else d.counter.bitstuffer++,O=G,d.ptr+=x,O>0&&(b=Math.ceil(I*O/8),Z=Math.ceil(b/4),w=new ArrayBuffer(Z*4),M=new Uint8Array(w),M.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?h==null?o.originalUnstuff2(P,u,O,I):o.unstuff2(P,u,O,I,!1,h,v,U):h==null?o.originalUnstuff(P,u,O,I):o.unstuff(P,u,O,I,!1,h,v,U))}},readTiles:function(c,d,u){var h=d.headerInfo,p=h.width,g=h.height,f=h.microBlockSize,x=h.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(g/f);d.pixels.numBlocksY=V,d.pixels.numBlocksX=C,d.pixels.ptr=0;var L=0,R=0,G=0,I=0,v=0,P=0,w=0,M=0,b=0,Z=0,E=0,X=0,F=0,N=0,O=0,U=0,Y,k,H,K,te,z,j=new u(f*f),ee=g%f||f,fe=p%f||f,Te,de,xe=h.numDims,Ce,Ie=d.pixels.resultMask,Le=d.pixels.resultPixels;for(G=0;G<V;G++)for(v=G!==V-1?f:ee,I=0;I<C;I++)for(P=I!==C-1?f:fe,E=G*p*f+I*f,X=p-P,Ce=0;Ce<xe;Ce++){if(xe>1&&(Le=new u(d.pixels.resultPixels.buffer,p*g*Ce*_,p*g)),w=c.byteLength-d.ptr,Y=new DataView(c,d.ptr,Math.min(10,w)),k={},U=0,M=Y.getUint8(0),U++,b=M>>6&255,Z=M>>2&15,Z!==(I*f>>3&15))throw"integrity issue";if(z=M&3,z>3)throw d.ptr+=U,"Invalid block encoding ("+z+")";if(z===2){d.counter.constant++,d.ptr+=U;continue}else if(z===0){if(d.counter.uncompressed++,d.ptr+=U,F=v*P*_,N=c.byteLength-d.ptr,F=F<N?F:N,H=new ArrayBuffer(F%_===0?F:F+_-F%_),K=new Uint8Array(H),K.set(new Uint8Array(c,d.ptr,F)),te=new u(H),O=0,Ie)for(L=0;L<v;L++){for(R=0;R<P;R++)Ie[E]&&(Le[E]=te[O++]),E++;E+=X}else for(L=0;L<v;L++){for(R=0;R<P;R++)Le[E++]=te[O++];E+=X}d.ptr+=O*_}else if(Te=r.getDataTypeUsed(x,b),de=r.getOnePixel(k,U,Te,Y),U+=r.getDataTypeSize(Te),z===3)if(d.ptr+=U,d.counter.constantoffset++,Ie)for(L=0;L<v;L++){for(R=0;R<P;R++)Ie[E]&&(Le[E]=de),E++;E+=X}else for(L=0;L<v;L++){for(R=0;R<P;R++)Le[E++]=de;E+=X}else if(d.ptr+=U,r.decodeBits(c,d,j,de,Ce),U=0,Ie)for(L=0;L<v;L++){for(R=0;R<P;R++)Ie[E]&&(Le[E]=j[U++]),E++;E+=X}else for(L=0;L<v;L++){for(R=0;R<P;R++)Le[E++]=j[U++];E+=X}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var d=c.headerInfo.zMax,u=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*u,g=0,f=0,x=0,_=c.pixels.resultMask;if(_)if(u>1)for(g=0;g<u;g++)for(x=g*h,f=0;f<h;f++)_[f]&&(c.pixels.resultPixels[x+f]=d);else for(f=0;f<h;f++)_[f]&&(c.pixels.resultPixels[f]=d);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(d);else for(f=0;f<p;f++)c.pixels.resultPixels[f]=d},getDataTypeArray:function(c){var d;switch(c){case 0:d=Int8Array;break;case 1:d=Uint8Array;break;case 2:d=Int16Array;break;case 3:d=Uint16Array;break;case 4:d=Int32Array;break;case 5:d=Uint32Array;break;case 6:d=Float32Array;break;case 7:d=Float64Array;break;default:d=Float32Array}return d},getPixelType:function(c){var d;switch(c){case 0:d="S8";break;case 1:d="U8";break;case 2:d="S16";break;case 3:d="U16";break;case 4:d="S32";break;case 5:d="U32";break;case 6:d="F32";break;case 7:d="F64";break;default:d="F32"}return d},isValidPixelValue:function(c,d){if(d==null)return!1;var u;switch(c){case 0:u=d>=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,h){var p=0;switch(u){case 0:p=h.getInt8(d);break;case 1:p=h.getUint8(d);break;case 2:p=h.getInt16(d,!0);break;case 3:p=h.getUint16(d,!0);break;case 4:p=h.getInt32(d,!0);break;case 5:p=h.getUInt32(d,!0);break;case 6:p=h.getFloat32(d,!0);break;case 7:p=h.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,h=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,f=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=g.width*g.height;if(p.pixels.resultPixels=new x(_*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(f>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||f<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var R;d.inputOffset?(R=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(R)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(R=p.headerInfo.blobSize-p.ptr,Math.abs(R)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var I=p.pixels.resultMask;for(h=0;h<_;h++)I[h]||(G.pixelData[h]=u);G.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var d=0,u=0,h={};for(h.ptr=0,h.pixels={};u<c.byteLength-58;)r.readHeaderInfo(c,h),u+=h.headerInfo.blobSize,d++,h.ptr=u;return d}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),d,u;if(c.trim()==="CntZImage")d=e,u=1;else if(c.substring(0,5)==="Lerc2")d=t,u=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,g,f=[],x,_,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var V=d.decode(o,{inputOffset:s,encodedMaskData:g,maskData:_,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=V.fileInfo.eofOffset,h===0&&(g=V.encodedMaskData,_=V.maskData,C.width=V.width,C.height=V.height,C.dimCount=V.dimCount||1,C.pixelType=V.pixelType||V.fileInfo.pixelType,C.mask=V.maskData),u>1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&f.push(V.maskData),h++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,R,G;if(u>1&&f.length>1){for(G=C.width*C.height,C.bandMasks=f,_=new Uint8Array(G),_.set(f[0]),L=1;L<f.length;L++)for(x=f[L],R=0;R<G;R++)_[R]=_[R]&x[R];C.maskData=_}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):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aaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTO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oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var BCe=ld((HIo,DCe)=>{var zIo=T(S()),{webm:q1t,mp4:$1t}=UCe(),tq=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,nq=()=>"wakeLock"in navigator,iq=class{constructor(){if(this.enabled=!1,nq()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else tq()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",q1t),this._addSourceToVideo(this.noSleepVideo,"mp4",$1t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return nq()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):tq()?(this.disable(),console.warn(`
        NoSleep enabled for older iOS devices. This can interrupt
        active or long-running network requests from completing successfully.
        See https://github.com/richtr/NoSleep.js/issues/15 for more details.
      `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){nq()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):tq()?this.noSleepTimer&&(console.warn(`
          NoSleep now disabled for older iOS devices.
        `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};DCe.exports=iq});var SVt={};i1e(SVt,{AlphaMode:()=>Wf,AlphaPipelineStage:()=>G2,AnchorPointDirect:()=>wW,AnchorPointIndirect:()=>FW,Animation:()=>TM,AnimationViewModel:()=>SM,Appearance:()=>io,ApproximateTerrainHeights:()=>di,ArcGISTiledElevationTerrainProvider:()=>BY,ArcGisBaseMapType:()=>Uh,ArcGisMapServerImageryProvider:()=>p0,ArcGisMapService:()=>tu,ArcType:()=>en,ArticulationStageType:()=>ac,AssociativeArray:()=>Gt,Atmosphere:()=>rT,AtmospherePipelineStage:()=>c2,AttributeCompression:()=>wn,AttributeType:()=>on,AutoExposure:()=>_A,AutomaticUniforms:()=>_p,Axis:()=>Po,AxisAlignedBoundingBox:()=>z0,B3dmLoader:()=>JW,B3dmParser:()=>HW,BaseLayerPicker:()=>lM,BaseLayerPickerViewModel:()=>cM,BatchTable:()=>y_,BatchTableHierarchy:()=>k_,BatchTexture:()=>il,BatchTexturePipelineStage:()=>E2,Billboard:()=>lo,BillboardCollection:()=>Fd,BillboardGraphics:()=>pc,BillboardLoadState:()=>os,BillboardTexture:()=>Nb,BillboardVisualizer:()=>AI,BingMapsGeocoderService:()=>YY,BingMapsImageryProvider:()=>zw,BingMapsStyle:()=>jV,BlendEquation:()=>Fa,BlendFunction:()=>Vo,BlendOption:()=>Ro,BlendingState:()=>un,BoundingRectangle:()=>Ke,BoundingSphere:()=>le,BoundingSphereState:()=>dt,BoundingVolumeSemantics:()=>nT,BoxEmitter:()=>B7,BoxGeometry:()=>Ea,BoxGeometryUpdater:()=>UX,BoxGraphics:()=>L_,BoxOutlineGeometry:()=>Am,BrdfLutGenerator:()=>SF,Buffer:()=>xt,BufferLoader:()=>Y_,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>P2,CallbackPositionProperty:()=>DX,CallbackProperty:()=>eh,Camera:()=>ro,CameraEventAggregator:()=>RA,CameraEventType:()=>Ai,CameraFlightPath:()=>VF,Cartesian2:()=>D,Cartesian3:()=>m,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>zY,CatmullRomSpline:()=>KY,Cesium3DContentGroup:()=>N_,Cesium3DTile:()=>nm,Cesium3DTileBatchTable:()=>bb,Cesium3DTileColorBlendMode:()=>Nl,Cesium3DTileContent:()=>O7,Cesium3DTileContentFactory:()=>yT,Cesium3DTileContentState:()=>Bo,Cesium3DTileContentType:()=>Es,Cesium3DTileFeature:()=>Os,Cesium3DTileFeatureTable:()=>uh,Cesium3DTileOptimizationHint:()=>$u,Cesium3DTileOptimizations:()=>uv,Cesium3DTilePass:()=>wo,Cesium3DTilePassState:()=>bm,Cesium3DTilePointFeature:()=>kb,Cesium3DTileRefine:()=>Uo,Cesium3DTileStyle:()=>RS,Cesium3DTileStyleEngine:()=>pv,Cesium3DTilesInspector:()=>pM,Cesium3DTilesInspectorViewModel:()=>fM,Cesium3DTilesVoxelProvider:()=>Y7,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>_v,Cesium3DTilesetCache:()=>mv,Cesium3DTilesetGraphics:()=>W_,Cesium3DTilesetHeatmap:()=>hv,Cesium3DTilesetMetadata:()=>LT,Cesium3DTilesetMostDetailedTraversal:()=>gv,Cesium3DTilesetSkipTraversal:()=>Cv,Cesium3DTilesetStatistics:()=>Sh,Cesium3DTilesetTraversal:()=>Qs,Cesium3DTilesetVisualizer:()=>Vv,CesiumInspector:()=>yM,CesiumInspectorViewModel:()=>gM,CesiumTerrainProvider:()=>Xx,CesiumWidget:()=>L9,Check:()=>xo,CheckerboardMaterialProperty:()=>q1,CircleEmitter:()=>w9,CircleGeometry:()=>aH,CircleOutlineGeometry:()=>cH,ClassificationModelDrawCommand:()=>LP,ClassificationPipelineStage:()=>I2,ClassificationPrimitive:()=>o1,ClassificationType:()=>Dn,ClearCommand:()=>ti,ClippingPlane:()=>iT,ClippingPlaneCollection:()=>fs,ClippingPolygon:()=>R1,ClippingPolygonCollection:()=>ah,Clock:()=>km,ClockRange:()=>vr,ClockStep:()=>fo,ClockViewModel:()=>sM,CloudCollection:()=>j7,CloudType:()=>vL,Color:()=>B,ColorBlendMode:()=>Tc,ColorGeometryInstanceAttribute:()=>Yt,ColorMaterialProperty:()=>Dt,Command:()=>U6,ComponentDatatype:()=>Q,Composite3DTileContent:()=>YX,CompositeEntityCollection:()=>CQ,CompositeMaterialProperty:()=>eV,CompositePositionProperty:()=>ba,CompositeProperty:()=>Lc,CompressedTextureBuffer:()=>mR,ComputeCommand:()=>wc,ComputeEngine:()=>uR,ConditionsExpression:()=>X9,ConeEmitter:()=>$7,ConstantPositionProperty:()=>$c,ConstantProperty:()=>Qn,ConstantSpline:()=>TE,ContentMetadata:()=>ov,Context:()=>oE,ContextLimits:()=>At,CoplanarPolygonGeometry:()=>GE,CoplanarPolygonGeometryLibrary:()=>Mp,CoplanarPolygonOutlineGeometry:()=>Eu,CornerType:()=>Pi,CorrelationGroup:()=>AW,CorridorGeometry:()=>Nx,CorridorGeometryLibrary:()=>ki,CorridorGeometryUpdater:()=>Rv,CorridorGraphics:()=>Z_,CorridorOutlineGeometry:()=>FE,Credit:()=>Ct,CreditDisplay:()=>GF,CubeMap:()=>xr,CubeMapFace:()=>SR,CubicRealPolynomial:()=>px,CullFace:()=>Ti,CullingVolume:()=>hs,CumulusCloud:()=>lu,CustomDataSource:()=>Wv,CustomHeightmapTerrainProvider:()=>GH,CustomShader:()=>yS,CustomShaderMode:()=>Fb,CustomShaderPipelineStage:()=>k2,CustomShaderTranslucencyMode:()=>Qg,CylinderGeometry:()=>AE,CylinderGeometryLibrary:()=>kx,CylinderGeometryUpdater:()=>Pv,CylinderGraphics:()=>G_,CylinderOutlineGeometry:()=>ME,CzmlDataSource:()=>kv,DataSource:()=>Yr,DataSourceClock:()=>Lh,DataSourceCollection:()=>Uv,DataSourceDisplay:()=>lw,DebugAppearance:()=>e6,DebugCameraPrimitive:()=>op,DebugInspector:()=>vA,DebugModelMatrixPrimitive:()=>A9,DefaultProxy:()=>WH,DepthFunction:()=>bc,DepthPlane:()=>PF,DequantizationPipelineStage:()=>D2,DerivedCommand:()=>rp,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>vF,DirectionalLight:()=>t6,DiscardEmptyTileImagePolicy:()=>qV,DiscardMissingTileImagePolicy:()=>Yw,DistanceDisplayCondition:()=>wt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Un,DoubleEndedPriorityQueue:()=>Dx,DoublyLinkedList:()=>DE,DracoLoader:()=>Sb,DrawCommand:()=>$e,DynamicAtmosphereLightingType:()=>Lb,DynamicEnvironmentMapManager:()=>Rb,DynamicGeometryBatch:()=>vT,DynamicGeometryUpdater:()=>oi,EarthOrientationParameters:()=>iR,EarthOrientationParametersSample:()=>v0,EasingFunction:()=>Fr,EllipseGeometry:()=>Hc,EllipseGeometryLibrary:()=>vl,EllipseGeometryUpdater:()=>Bv,EllipseGraphics:()=>E_,EllipseOutlineGeometry:()=>bd,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>Up,EllipsoidGeometry:()=>Us,EllipsoidGeometryUpdater:()=>Yv,EllipsoidGraphics:()=>I_,EllipsoidOutlineGeometry:()=>xd,EllipsoidPrimitive:()=>gF,EllipsoidRhumbLine:()=>Pa,EllipsoidSurfaceAppearance:()=>n6,EllipsoidTangentPlane:()=>Qr,EllipsoidTerrainProvider:()=>Tf,EllipsoidalOccluder:()=>Pp,Empty3DTileContent:()=>B1,EncodedCartesian3:()=>On,Entity:()=>$o,EntityCluster:()=>kd,EntityCollection:()=>js,EntityView:()=>uw,Event:()=>be,EventHelper:()=>ar,Expression:()=>Bu,ExpressionNodeType:()=>gt,ExtrapolationType:()=>_d,FeatureDetection:()=>Bt,FeatureIdPipelineStage:()=>Jg,Fog:()=>wF,ForEach:()=>We,FrameRateMonitor:()=>k9,FrameState:()=>FF,Framebuffer:()=>Wr,FramebufferManager:()=>fi,FrustumCommands:()=>UF,FrustumGeometry:()=>Ox,FrustumOutlineGeometry:()=>HE,Fullscreen:()=>br,FullscreenButton:()=>VM,FullscreenButtonViewModel:()=>CM,GeoJsonDataSource:()=>Ty,GeoJsonLoader:()=>QW,GeocodeType:()=>ug,Geocoder:()=>RM,GeocoderService:()=>vC,GeocoderViewModel:()=>LM,GeographicProjection:()=>Ei,GeographicTilingScheme:()=>Hi,Geometry:()=>lt,Geometry3DTileContent:()=>KX,GeometryAttribute:()=>Ge,GeometryAttributes:()=>mn,GeometryFactory:()=>kH,GeometryInstance:()=>Et,GeometryInstanceAttribute:()=>cc,GeometryOffsetAttribute:()=>rn,GeometryPipeline:()=>Fn,GeometryPipelineStage:()=>H2,GeometryType:()=>xu,GeometryUpdater:()=>ri,GeometryUpdaterSet:()=>AT,GeometryVisualizer:()=>qv,GetFeatureInfoFormat:()=>QT,Globe:()=>bF,GlobeDepth:()=>DF,GlobeSurfaceShaderSet:()=>Ow,GlobeSurfaceTile:()=>hm,GlobeSurfaceTileProvider:()=>sF,GlobeTranslucency:()=>aF,GlobeTranslucencyFramebuffer:()=>BF,GlobeTranslucencyState:()=>AF,GltfBufferViewLoader:()=>f1,GltfDracoLoader:()=>p1,GltfGpmLoader:()=>NW,GltfGpmLocal:()=>G1,GltfImageLoader:()=>b1,GltfIndexBufferLoader:()=>g1,GltfJsonLoader:()=>x1,GltfLoader:()=>dh,GltfLoaderUtil:()=>Dl,GltfMeshPrimitiveGpmLoader:()=>BW,GltfStructuralMetadataLoader:()=>PW,GltfTextureLoader:()=>_1,GltfVertexBufferLoader:()=>T1,GoogleEarthEnterpriseImageryProvider:()=>o6,GoogleEarthEnterpriseMapsProvider:()=>Qw,GoogleEarthEnterpriseMetadata:()=>Kp,GoogleEarthEnterpriseTerrainData:()=>wC,GoogleEarthEnterpriseTerrainProvider:()=>KH,GoogleEarthEnterpriseTileInformation:()=>zE,GoogleGeocoderService:()=>QH,GoogleMaps:()=>Hx,GpxDataSource:()=>pw,GregorianDate:()=>Sp,GridImageryProvider:()=>r6,GridMaterialProperty:()=>rV,GroundGeometryUpdater:()=>Yn,GroundPolylineGeometry:()=>zx,GroundPolylinePrimitive:()=>Jm,GroundPrimitive:()=>qc,GroupMetadata:()=>J1,HeadingPitchRange:()=>Pu,HeadingPitchRoll:()=>Ra,Heap:()=>$L,HeightReference:()=>Je,HeightmapEncoding:()=>Ru,HeightmapTerrainData:()=>Xa,HeightmapTessellator:()=>sC,HermitePolynomialApproximation:()=>JE,HermiteSpline:()=>q0,HilbertOrder:()=>FC,HomeButton:()=>GM,HomeButtonViewModel:()=>ZM,HorizontalOrigin:()=>_i,I3SBuildingSceneLayerExplorer:()=>Q6,I3SBuildingSceneLayerExplorerViewModel:()=>EM,I3SDataProvider:()=>Qh,I3SDecoder:()=>U9,I3SFeature:()=>D9,I3SField:()=>B9,I3SGeometry:()=>wL,I3SLayer:()=>XS,I3SNode:()=>FL,I3SStatistics:()=>H9,I3SSublayer:()=>K9,I3SSymbology:()=>Y9,I3dmLoader:()=>qW,I3dmParser:()=>jW,ITwinData:()=>l6,ITwinPlatform:()=>Vs,Iau2000Orientation:()=>jE,Iau2006XysData:()=>oR,Iau2006XysSample:()=>ux,IauOrientationAxes:()=>qE,IauOrientationParameters:()=>QE,ImageBasedLighting:()=>M_,ImageBasedLightingPipelineStage:()=>d2,ImageMaterialProperty:()=>Ig,Imagery:()=>oL,ImageryLayer:()=>Ya,ImageryLayerCollection:()=>cF,ImageryLayerFeatureInfo:()=>kh,ImageryProvider:()=>pl,ImageryState:()=>ci,Implicit3DTileContent:()=>V1,ImplicitAvailabilityBitstream:()=>m1,ImplicitMetadataView:()=>h1,ImplicitSubdivisionScheme:()=>ts,ImplicitSubtree:()=>eT,ImplicitSubtreeCache:()=>P9,ImplicitSubtreeMetadata:()=>JX,ImplicitTileCoordinates:()=>GT,ImplicitTileset:()=>ZT,IndexDatatype:()=>Ae,InfoBox:()=>XM,InfoBoxViewModel:()=>IM,InspectorShared:()=>za,InstanceAttributeSemantic:()=>is,InstancingPipelineStage:()=>V2,InterpolationAlgorithm:()=>lz,InterpolationType:()=>Ym,Intersect:()=>Ht,IntersectionTests:()=>qn,Intersections2D:()=>wp,Interval:()=>Ga,InvertClassification:()=>bL,Ion:()=>Mm,IonGeocodeProviderType:()=>Qp,IonGeocoderService:()=>Kx,IonImageryProvider:()=>b0,IonResource:()=>pd,IonWorldImageryStyle:()=>g0,Iso8601:()=>Be,JobScheduler:()=>MF,JobType:()=>Ma,JsonMetadataTable:()=>Zb,JulianDate:()=>q,KTX2Transcoder:()=>hR,KeyboardEventModifier:()=>Ds,KeyframeNode:()=>go,KmlCamera:()=>bw,KmlDataSource:()=>OT,KmlLookAt:()=>ww,KmlTour:()=>Fw,KmlTourFlyTo:()=>Aw,KmlTourWait:()=>Mw,Label:()=>ty,LabelCollection:()=>Af,LabelGraphics:()=>jm,LabelStyle:()=>Do,LabelVisualizer:()=>$v,LagrangePolynomialApproximation:()=>tI,LeapSecond:()=>Yi,Light:()=>d6,LightingModel:()=>vf,LightingPipelineStage:()=>K2,LinearApproximation:()=>Jx,LinearSpline:()=>j0,ManagedArray:()=>jc,MapMode2D:()=>nd,MapProjection:()=>fz,MapboxImageryProvider:()=>jw,MapboxStyleImageryProvider:()=>u6,Material:()=>zi,MaterialAppearance:()=>ao,MaterialPipelineStage:()=>Q2,MaterialProperty:()=>qo,Math:()=>W,Matrix2:()=>Ii,Matrix3:()=>$,Matrix4:()=>A,Megatexture:()=>LL,MeshPrimitiveGpmLocal:()=>DW,MetadataClass:()=>oh,MetadataClassProperty:()=>Ef,MetadataComponentType:()=>Ft,MetadataEntity:()=>Nn,MetadataEnum:()=>pW,MetadataEnumValue:()=>fW,MetadataPicking:()=>NF,MetadataPickingPipelineStage:()=>Pd,MetadataPipelineStage:()=>Hu,MetadataSchema:()=>Xd,MetadataSchemaLoader:()=>S1,MetadataSemantic:()=>tT,MetadataTable:()=>Ou,MetadataTableProperty:()=>jX,MetadataType:()=>ct,MipmapHint:()=>df,Model:()=>fh,Model3DTileContent:()=>wd,ModelAlphaOptions:()=>fP,ModelAnimation:()=>e2,ModelAnimationChannel:()=>$W,ModelAnimationCollection:()=>t2,ModelAnimationLoop:()=>Ol,ModelAnimationState:()=>mh,ModelArticulation:()=>m2,ModelArticulationStage:()=>u2,ModelClippingPlanesPipelineStage:()=>p2,ModelClippingPolygonsPipelineStage:()=>y2,ModelColorPipelineStage:()=>Kg,ModelComponents:()=>Sn,ModelDrawCommand:()=>RP,ModelDrawCommands:()=>EP,ModelFeature:()=>n2,ModelFeatureTable:()=>o2,ModelGraphics:()=>db,ModelLightingOptions:()=>SP,ModelMatrixUpdateStage:()=>L2,ModelNode:()=>x2,ModelRenderResources:()=>pP,ModelRuntimeNode:()=>Z2,ModelRuntimePrimitive:()=>mP,ModelSceneGraph:()=>IP,ModelSilhouettePipelineStage:()=>yP,ModelSkin:()=>hP,ModelSplitterPipelineStage:()=>_P,ModelStatistics:()=>XP,ModelType:()=>dr,ModelUtility:()=>Qt,ModelVisualizer:()=>ew,Moon:()=>xF,MorphTargetsPipelineStage:()=>q2,MorphWeightSpline:()=>pz,MortonOrder:()=>pg,Multiple3DTileContent:()=>av,MultisampleFramebuffer:()=>rE,NavigationHelpButton:()=>PM,NavigationHelpButtonViewModel:()=>WM,NearFarScalar:()=>kt,NeverTileDiscardPolicy:()=>h6,NodeRenderResources:()=>TP,NodeStatisticsPipelineStage:()=>R2,NodeTransformationProperty:()=>X_,OIT:()=>YF,Occluder:()=>iI,OffsetGeometryInstanceAttribute:()=>$i,OpenCageGeocoderService:()=>_z,OpenStreetMapImageryProvider:()=>X0,OrderedGroundPrimitiveCollection:()=>Dv,OrientedBoundingBox:()=>Gn,OrthographicFrustum:()=>an,OrthographicOffCenterFrustum:()=>Pr,Packable:()=>Tz,PackableForInterpolation:()=>Sz,Particle:()=>NL,ParticleBurst:()=>p6,ParticleEmitter:()=>b6,ParticleSystem:()=>g6,Pass:()=>Ee,PassState:()=>oc,PathGraphics:()=>ub,PathVisualizer:()=>nw,PeliasGeocoderService:()=>eI,PerInstanceColorAppearance:()=>dn,PerformanceDisplay:()=>_0,PerformanceWatchdog:()=>wM,PerformanceWatchdogViewModel:()=>vM,PerspectiveFrustum:()=>Vi,PerspectiveOffCenterFrustum:()=>Jc,PickDepth:()=>kF,PickDepthFramebuffer:()=>zF,PickFramebuffer:()=>JF,PickedMetadataInfo:()=>s9,Picking:()=>eA,PickingPipelineStage:()=>$2,PinBuilder:()=>jp,PixelDatatype:()=>je,PixelFormat:()=>it,Plane:()=>sn,PlaneGeometry:()=>aI,PlaneGeometryUpdater:()=>Hv,PlaneGraphics:()=>vX,PlaneOutlineGeometry:()=>cI,PntsLoader:()=>PP,PntsParser:()=>hT,PointCloud:()=>C9,PointCloudEyeDomeLighting:()=>Eb,PointCloudShading:()=>Pf,PointCloudStylingPipelineStage:()=>tP,PointGraphics:()=>P_,PointPrimitive:()=>Is,PointPrimitiveCollection:()=>nV,PointVisualizer:()=>ow,PolygonGeometry:()=>qp,PolygonGeometryLibrary:()=>kn,PolygonGeometryUpdater:()=>zv,PolygonGraphics:()=>qm,PolygonHierarchy:()=>va,PolygonOutlineGeometry:()=>lI,PolygonPipeline:()=>ii,Polyline:()=>Qu,PolylineArrowMaterialProperty:()=>aV,PolylineCollection:()=>gh,PolylineColorAppearance:()=>es,PolylineDashMaterialProperty:()=>lV,PolylineGeometry:()=>$p,PolylineGeometryUpdater:()=>sw,PolylineGlowMaterialProperty:()=>uV,PolylineGraphics:()=>gc,PolylineMaterialAppearance:()=>ua,PolylineOutlineMaterialProperty:()=>uy,PolylinePipeline:()=>vi,PolylineVisualizer:()=>cw,PolylineVolumeGeometry:()=>hI,PolylineVolumeGeometryLibrary:()=>Um,PolylineVolumeGeometryUpdater:()=>Kv,PolylineVolumeGraphics:()=>v_,PolylineVolumeOutlineGeometry:()=>bI,PositionProperty:()=>Qm,PositionPropertyArray:()=>t0,PostProcessStage:()=>ho,PostProcessStageCollection:()=>CA,PostProcessStageComposite:()=>od,PostProcessStageLibrary:()=>ru,PostProcessStageSampleMode:()=>ou,PostProcessStageTextureCache:()=>dS,PpeMetadata:()=>UW,PpeSource:()=>A6,PpeTexture:()=>kW,Primitive:()=>In,PrimitiveCollection:()=>ul,PrimitiveLoadPlan:()=>cT,PrimitiveOutlineGenerator:()=>aT,PrimitiveOutlinePipelineStage:()=>oP,PrimitivePipeline:()=>x_,PrimitiveRenderResources:()=>CP,PrimitiveState:()=>Sr,PrimitiveStatisticsPipelineStage:()=>rP,PrimitiveType:()=>we,ProjectionPicker:()=>DM,ProjectionPickerViewModel:()=>UM,Property:()=>J,PropertyArray:()=>hV,PropertyAttribute:()=>sT,PropertyAttributeProperty:()=>EW,PropertyBag:()=>tl,PropertyTable:()=>rl,PropertyTexture:()=>Gb,PropertyTextureProperty:()=>GW,ProviderViewModel:()=>as,Proxy:()=>Vz,QuadraticRealPolynomial:()=>Fc,QuadtreeOccluders:()=>lF,QuadtreePrimitive:()=>pF,QuadtreeTile:()=>dF,QuadtreeTileLoadState:()=>ea,QuadtreeTileProvider:()=>y6,QuantizedMeshTerrainData:()=>Ix,QuarticRealPolynomial:()=>bR,Quaternion:()=>ve,QuaternionSpline:()=>gI,Queue:()=>og,Ray:()=>pn,Rectangle:()=>ce,RectangleCollisionChecker:()=>t_,RectangleGeometry:()=>n_,RectangleGeometryLibrary:()=>Ls,RectangleGeometryUpdater:()=>Jv,RectangleGraphics:()=>$m,RectangleOutlineGeometry:()=>i_,ReferenceFrame:()=>Ui,ReferenceProperty:()=>n0,RenderState:()=>Ue,Renderbuffer:()=>fd,RenderbufferFormat:()=>Mc,Request:()=>Ho,RequestErrorEvent:()=>tf,RequestScheduler:()=>tc,RequestState:()=>jn,RequestType:()=>ds,Resource:()=>Ze,ResourceCache:()=>Ri,ResourceCacheKey:()=>Bl,ResourceCacheStatistics:()=>yW,ResourceLoader:()=>Ki,ResourceLoaderState:()=>yt,Rotation:()=>om,RuntimeError:()=>ae,S2Cell:()=>eb,SDFSettings:()=>Ks,SampledPositionProperty:()=>ga,SampledProperty:()=>Bd,Sampler:()=>qt,ScaledPositionProperty:()=>Bf,Scene:()=>c9,SceneFramebuffer:()=>iS,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>sP,SceneModePicker:()=>AM,SceneModePickerViewModel:()=>FM,SceneTransforms:()=>Di,SceneTransitioner:()=>LA,ScreenSpaceCameraController:()=>EA,ScreenSpaceEventHandler:()=>Cd,ScreenSpaceEventType:()=>xn,SelectedFeatureIdPipelineStage:()=>jg,SelectionIndicator:()=>kM,SelectionIndicatorViewModel:()=>NM,SensorVolumePortionToDisplay:()=>gV,ShaderBuilder:()=>Vx,ShaderCache:()=>$G,ShaderDestination:()=>ye,ShaderFunction:()=>cE,ShaderProgram:()=>$t,ShaderSource:()=>De,ShaderStruct:()=>aE,ShadowMap:()=>C0,ShadowMapShader:()=>cp,ShadowMode:()=>Tn,ShadowVolumeAppearance:()=>Ld,ShowGeometryInstanceAttribute:()=>_n,Simon1994PlanetaryPositions:()=>Y0,SimplePolylineGeometry:()=>Uz,SingleTileImageryProvider:()=>qw,SkinningPipelineStage:()=>cP,SkyAtmosphere:()=>u9,SkyBox:()=>f9,SpatialNode:()=>i9,Spdcf:()=>MW,SpecularEnvironmentCubeMap:()=>th,SphereEmitter:()=>_6,SphereGeometry:()=>Dz,SphereOutlineGeometry:()=>tb,Spherical:()=>TI,Spline:()=>no,SplitDirection:()=>kr,Splitter:()=>IL,StaticGeometryColorBatch:()=>cm,StaticGeometryPerMaterialBatch:()=>lm,StaticGroundGeometryColorBatch:()=>GV,StaticGroundGeometryPerMaterialBatch:()=>jv,StaticGroundPolylinePerMaterialBatch:()=>aw,StaticOutlineGeometryBatch:()=>XV,StencilConstants:()=>Ut,StencilFunction:()=>Bn,StencilOperation:()=>ht,SteppedSpline:()=>SI,Stereographic:()=>mc,StorageType:()=>Bg,StripeMaterialProperty:()=>pV,StripeOrientation:()=>Rh,StructuralMetadata:()=>Hs,StyleCommandsNeeded:()=>hh,StyleExpression:()=>T6,Sun:()=>_9,SunLight:()=>Xp,SunPostProcess:()=>WA,SupportedImageFormats:()=>vW,SvgPathBindingHandler:()=>oM,TaskProcessor:()=>yi,Terrain:()=>q9,TerrainData:()=>wm,TerrainEncoding:()=>sc,TerrainFillMesh:()=>cL,TerrainMesh:()=>Gu,TerrainOffsetProperty:()=>w_,TerrainProvider:()=>jr,TerrainQuantization:()=>ks,TerrainState:()=>mo,Texture:()=>vt,TextureAtlas:()=>Lx,TextureCache:()=>eE,TextureMagnificationFilter:()=>hi,TextureManager:()=>$A,TextureMinificationFilter:()=>jt,TexturePacker:()=>rC,TextureUniform:()=>w6,TextureWrap:()=>Vn,TileAvailability:()=>Fm,TileBoundingRegion:()=>Md,TileBoundingS2Cell:()=>lv,TileBoundingSphere:()=>Jb,TileBoundingVolume:()=>S6,TileCoordinatesImageryProvider:()=>eM,TileDiscardPolicy:()=>V6,TileEdge:()=>yn,TileImagery:()=>rL,TileMapServiceImageryProvider:()=>Fy,TileMetadata:()=>rv,TileOrientedBoundingBox:()=>Kl,TileProviderError:()=>Co,TileReplacementQueue:()=>uF,TileSelectionResult:()=>Jn,TileState:()=>L6,Tileset3DTileContent:()=>FP,TilesetMetadata:()=>dv,TilesetPipelineStage:()=>r2,TilingScheme:()=>Bz,TimeConstants:()=>Kn,TimeDynamicImagery:()=>jT,TimeDynamicPointCloud:()=>WL,TimeInterval:()=>Ln,TimeIntervalCollection:()=>Nr,TimeIntervalCollectionPositionProperty:()=>i0,TimeIntervalCollectionProperty:()=>o0,TimeStandard:()=>zn,Timeline:()=>YM,TimelineHighlightRange:()=>BM,TimelineTrack:()=>OM,Tipsify:()=>gR,ToggleButtonViewModel:()=>Jy,Tonemapper:()=>L0,TrackingReferenceFrame:()=>nb,Transforms:()=>Pt,TranslationRotationScale:()=>Vg,TranslucentTileClassification:()=>jF,TridiagonalSystemSolver:()=>mC,TrustedServers:()=>zS,TweenCollection:()=>hS,UniformState:()=>iE,UniformType:()=>CL,UrlTemplateImageryProvider:()=>Oa,VERSION:()=>TVt,VRButton:()=>zM,VRButtonViewModel:()=>HM,VRTheWorldTerrainProvider:()=>zz,VaryingType:()=>F6,Vector3DTileBatch:()=>Zf,Vector3DTileClampedPolylines:()=>nv,Vector3DTileContent:()=>iv,Vector3DTileGeometry:()=>yb,Vector3DTilePoints:()=>JP,Vector3DTilePolygons:()=>QP,Vector3DTilePolylines:()=>gT,Vector3DTilePrimitive:()=>B_,VelocityOrientationProperty:()=>wv,VelocityVectorProperty:()=>r0,VertexArray:()=>ni,VertexArrayFacade:()=>Wp,VertexAttributeSemantic:()=>ft,VertexFormat:()=>Xe,VerticalExaggeration:()=>Tr,VerticalExaggerationPipelineStage:()=>dP,VerticalOrigin:()=>An,VideoSynchronizer:()=>Kz,View:()=>sS,Viewer:()=>rq,ViewportQuad:()=>R6,Visibility:()=>cr,Visualizer:()=>Hj,VoxelBoxShape:()=>mp,VoxelCell:()=>wA,VoxelContent:()=>xS,VoxelCylinderShape:()=>hp,VoxelEllipsoidShape:()=>_S,VoxelInspector:()=>JM,VoxelInspectorViewModel:()=>KM,VoxelMetadataOrder:()=>Hh,VoxelPrimitive:()=>Hy,VoxelProvider:()=>G6,VoxelRenderResources:()=>QA,VoxelShape:()=>E6,VoxelShapeType:()=>Mi,VoxelTraversal:()=>o9,VulkanConstants:()=>Jz,WallGeometry:()=>RI,WallGeometryLibrary:()=>c_,WallGeometryUpdater:()=>Qv,WallGraphics:()=>mb,WallOutlineGeometry:()=>GI,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>eF,WebMapTileServiceImageryProvider:()=>nF,WebMercatorProjection:()=>Wi,WebMercatorTilingScheme:()=>qr,WindingOrder:()=>us,WireframeIndexGenerator:()=>qC,WireframePipelineStage:()=>uP,_shadersAcesTonemappingStage:()=>tA,_shadersAdditiveBlend:()=>IA,_shadersAdjustTranslucentFS:()=>gL,_shadersAllMaterialAppearanceFS:()=>MI,_shadersAllMaterialAppearanceVS:()=>NI,_shadersAmbientOcclusionGenerate:()=>nA,_shadersAmbientOcclusionModulate:()=>iA,_shadersAspectRampMaterial:()=>OI,_shadersAtmosphereCommon:()=>ch,_shadersAtmosphereStageFS:()=>s2,_shadersAtmosphereStageVS:()=>a2,_shadersBasicMaterialAppearanceFS:()=>kI,_shadersBasicMaterialAppearanceVS:()=>UI,_shadersBillboardCollectionFS:()=>AP,_shadersBillboardCollectionVS:()=>MP,_shadersBlackAndWhite:()=>oA,_shadersBloomComposite:()=>rA,_shadersBrdfLutGeneratorFS:()=>_F,_shadersBrightPass:()=>XA,_shadersBrightness:()=>sA,_shadersBumpMapMaterial:()=>YI,_shadersCPUStylingStageFS:()=>W2,_shadersCPUStylingStageVS:()=>X2,_shadersCheckerboardMaterial:()=>HI,_shadersCloudCollectionFS:()=>R9,_shadersCloudCollectionVS:()=>Z9,_shadersCloudNoiseFS:()=>G9,_shadersCloudNoiseVS:()=>E9,_shadersCompareAndPackTranslucentDepth:()=>QF,_shadersCompositeOITFS:()=>OF,_shadersCompositeTranslucentClassification:()=>rS,_shadersComputeIrradianceFS:()=>TW,_shadersComputeRadianceMapFS:()=>SW,_shadersContrastBias:()=>aA,_shadersConvolveSpecularMapFS:()=>CW,_shadersConvolveSpecularMapVS:()=>VW,_shadersCustomShaderStageFS:()=>w2,_shadersCustomShaderStageVS:()=>v2,_shadersCzmBuiltins:()=>Tx,_shadersDepthOfField:()=>cA,_shadersDepthPlaneFS:()=>EF,_shadersDepthPlaneVS:()=>IF,_shadersDepthView:()=>lA,_shadersDepthViewPacked:()=>v6,_shadersDotMaterial:()=>zI,_shadersEdgeDetection:()=>dA,_shadersElevationBandMaterial:()=>KI,_shadersElevationContourMaterial:()=>JI,_shadersElevationRampMaterial:()=>QI,_shadersEllipsoidFS:()=>dL,_shadersEllipsoidSurfaceAppearanceFS:()=>M9,_shadersEllipsoidSurfaceAppearanceVS:()=>N9,_shadersEllipsoidVS:()=>uL,_shadersFXAA:()=>hA,_shadersFXAA3_11:()=>xA,_shadersFadeMaterial:()=>jI,_shadersFeatureIdStageFS:()=>F2,_shadersFeatureIdStageVS:()=>A2,_shadersFilmicTonemapping:()=>uA,_shadersGaussianBlur1D:()=>By,_shadersGeometryStageFS:()=>B2,_shadersGeometryStageVS:()=>O2,_shadersGlobeFS:()=>Dw,_shadersGlobeVS:()=>Bw,_shadersGridMaterial:()=>qI,_shadersGroundAtmosphere:()=>KV,_shadersHSBToRGB:()=>bZ,_shadersHSLToRGB:()=>gZ,_shadersImageBasedLightingStageFS:()=>l2,_shadersInstancingStageCommon:()=>_2,_shadersInstancingStageVS:()=>T2,_shadersIntersectBox:()=>DA,_shadersIntersectClippingPlanes:()=>UA,_shadersIntersectCylinder:()=>BA,_shadersIntersectDepth:()=>kA,_shadersIntersectEllipsoid:()=>OA,_shadersIntersectLongitude:()=>SL,_shadersIntersection:()=>bS,_shadersIntersectionUtils:()=>NA,_shadersLegacyInstancingStageVS:()=>S2,_shadersLensFlare:()=>fA,_shadersLightingStageFS:()=>z2,_shadersMaterialStageFS:()=>J2,_shadersMegatexture:()=>JA,_shadersMetadataStageFS:()=>M2,_shadersMetadataStageVS:()=>N2,_shadersModelClippingPlanesStageFS:()=>f2,_shadersModelClippingPolygonsStageFS:()=>g2,_shadersModelClippingPolygonsStageVS:()=>b2,_shadersModelColorStageFS:()=>h2,_shadersModelFS:()=>GP,_shadersModelSilhouetteStageFS:()=>bP,_shadersModelSilhouetteStageVS:()=>gP,_shadersModelSplitterStageFS:()=>xP,_shadersModelVS:()=>ZP,_shadersModifiedReinhardTonemapping:()=>pA,_shadersMorphTargetsStageVS:()=>j2,_shadersNightVision:()=>bA,_shadersNormalMapMaterial:()=>$I,_shadersOctree:()=>KA,_shadersPassThrough:()=>id,_shadersPassThroughDepth:()=>ky,_shadersPbrNeutralTonemapping:()=>mA,_shadersPerInstanceColorAppearanceFS:()=>dX,_shadersPerInstanceColorAppearanceVS:()=>uX,_shadersPerInstanceFlatColorAppearanceFS:()=>g_,_shadersPerInstanceFlatColorAppearanceVS:()=>mX,_shadersPointCloudEyeDomeLighting:()=>OW,_shadersPointCloudStylingStageVS:()=>eP,_shadersPointPrimitiveCollectionFS:()=>dy,_shadersPointPrimitiveCollectionVS:()=>Zv,_shadersPolygonSignedDistanceFS:()=>xW,_shadersPolylineArrowMaterial:()=>eX,_shadersPolylineColorAppearanceVS:()=>TX,_shadersPolylineCommon:()=>Rd,_shadersPolylineDashMaterial:()=>tX,_shadersPolylineFS:()=>C_,_shadersPolylineGlowMaterial:()=>nX,_shadersPolylineMaterialAppearanceVS:()=>SX,_shadersPolylineOutlineMaterial:()=>iX,_shadersPolylineShadowVolumeFS:()=>gX,_shadersPolylineShadowVolumeMorphFS:()=>yX,_shadersPolylineShadowVolumeMorphVS:()=>xX,_shadersPolylineShadowVolumeVS:()=>_X,_shadersPolylineVS:()=>OP,_shadersPrimitiveOutlineStageFS:()=>iP,_shadersPrimitiveOutlineStageVS:()=>nP,_shadersRGBToHSB:()=>yZ,_shadersRGBToHSL:()=>xZ,_shadersRGBToXYZ:()=>_Z,_shadersReinhardTonemapping:()=>gA,_shadersReprojectWebMercatorFS:()=>iF,_shadersReprojectWebMercatorVS:()=>oF,_shadersRimLightingMaterial:()=>oX,_shadersSelectedFeatureIdStageCommon:()=>w1,_shadersShadowVolumeAppearanceFS:()=>n1,_shadersShadowVolumeAppearanceVS:()=>hX,_shadersShadowVolumeFS:()=>Eg,_shadersSilhouette:()=>yA,_shadersSkinningStageVS:()=>aP,_shadersSkyAtmosphereCommon:()=>RL,_shadersSkyAtmosphereFS:()=>l9,_shadersSkyAtmosphereVS:()=>d9,_shadersSkyBoxFS:()=>m9,_shadersSkyBoxVS:()=>h9,_shadersSlopeRampMaterial:()=>rX,_shadersStripeMaterial:()=>sX,_shadersSunFS:()=>p9,_shadersSunTextureFS:()=>b9,_shadersSunVS:()=>g9,_shadersTexturedMaterialAppearanceFS:()=>DI,_shadersTexturedMaterialAppearanceVS:()=>BI,_shadersVector3DTileClampedPolylinesFS:()=>ev,_shadersVector3DTileClampedPolylinesVS:()=>$P,_shadersVector3DTilePolylinesVS:()=>jP,_shadersVectorTileVS:()=>u1,_shadersVerticalExaggerationStageVS:()=>lP,_shadersViewportQuadFS:()=>I9,_shadersViewportQuadVS:()=>mx,_shadersVoxelFS:()=>AA,_shadersVoxelUtils:()=>FA,_shadersVoxelVS:()=>MA,_shadersWater:()=>cX,_shadersWaterMaskMaterial:()=>aX,_shadersXYZToRGB:()=>TZ,_shadersacesTonemapping:()=>SZ,_shadersalphaWeight:()=>CZ,_shadersantialias:()=>VZ,_shadersapplyHSBShift:()=>LZ,_shadersapproximateSphericalCoordinates:()=>RZ,_shadersapproximateTanh:()=>ZZ,_shadersbackFacing:()=>GZ,_shadersbranchFreeTernary:()=>EZ,_shaderscascadeColor:()=>IZ,_shaderscascadeDistance:()=>XZ,_shaderscascadeMatrix:()=>WZ,_shaderscascadeWeights:()=>PZ,_shadersclipPolygons:()=>vZ,_shaderscolumbusViewMorph:()=>wZ,_shaderscomputeAtmosphereColor:()=>FZ,_shaderscomputeGroundAtmosphereScattering:()=>AZ,_shaderscomputePosition:()=>MZ,_shaderscomputeScattering:()=>NZ,_shadersconvertUvToBox:()=>YA,_shadersconvertUvToCylinder:()=>HA,_shadersconvertUvToEllipsoid:()=>zA,_shaderscosineAndSine:()=>kZ,_shadersdecompressTextureCoordinates:()=>UZ,_shadersdegreesPerRadian:()=>VR,_shadersdepthClamp:()=>DZ,_shadersdepthRange:()=>LR,_shadersdepthRangeStruct:()=>cZ,_shaderseastNorthUpToEyeCoordinates:()=>BZ,_shadersellipsoidContainsPoint:()=>OZ,_shadersellipsoidTextureCoordinates:()=>YZ,_shadersepsilon1:()=>RR,_shadersepsilon2:()=>ZR,_shadersepsilon3:()=>GR,_shadersepsilon4:()=>ER,_shadersepsilon5:()=>IR,_shadersepsilon6:()=>XR,_shadersepsilon7:()=>WR,_shadersequalsEpsilon:()=>HZ,_shaderseyeOffset:()=>zZ,_shaderseyeToWindowCoordinates:()=>KZ,_shadersfastApproximateAtan:()=>JZ,_shadersfog:()=>QZ,_shadersgammaCorrect:()=>jZ,_shadersgeodeticSurfaceNormal:()=>qZ,_shadersgetDefaultMaterial:()=>$Z,_shadersgetDynamicAtmosphereLightDirection:()=>eG,_shadersgetLambertDiffuse:()=>tG,_shadersgetSpecular:()=>nG,_shadersgetWaterNoise:()=>iG,_shadershue:()=>oG,_shadersinfinity:()=>PR,_shadersinverseGamma:()=>rG,_shadersisEmpty:()=>sG,_shadersisFull:()=>aG,_shaderslatitudeToWebMercatorFraction:()=>cG,_shaderslineDistance:()=>lG,_shaderslinearToSrgb:()=>dG,_shadersluminance:()=>uG,_shadersmaterial:()=>lZ,_shadersmaterialInput:()=>dZ,_shadersmaximumComponent:()=>mG,_shadersmetersPerPixel:()=>hG,_shadersmodelMaterial:()=>uZ,_shadersmodelToWindowCoordinates:()=>fG,_shadersmodelVertexOutput:()=>mZ,_shadersmultiplyWithColorBalance:()=>pG,_shadersnearFarScalar:()=>bG,_shadersoctDecode:()=>gG,_shadersoneOverPi:()=>vR,_shadersoneOverTwoPi:()=>wR,_shaderspackDepth:()=>yG,_shaderspassCesium3DTile:()=>FR,_shaderspassCesium3DTileClassification:()=>AR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>MR,_shaderspassClassification:()=>NR,_shaderspassCompute:()=>kR,_shaderspassEnvironment:()=>UR,_shaderspassGlobe:()=>DR,_shaderspassOpaque:()=>BR,_shaderspassOverlay:()=>OR,_shaderspassTerrainClassification:()=>YR,_shaderspassTranslucent:()=>HR,_shaderspassVoxels:()=>zR,_shaderspbrLighting:()=>xG,_shaderspbrNeutralTonemapping:()=>_G,_shadersphong:()=>TG,_shaderspi:()=>KR,_shaderspiOverFour:()=>JR,_shaderspiOverSix:()=>QR,_shaderspiOverThree:()=>jR,_shaderspiOverTwo:()=>qR,_shadersplaneDistance:()=>SG,_shaderspointAlongRay:()=>CG,_shadersradiansPerDegree:()=>$R,_shadersray:()=>hZ,_shadersrayEllipsoidIntersectionInterval:()=>VG,_shadersraySegment:()=>fZ,_shadersraySphereIntersectionInterval:()=>LG,_shadersreadDepth:()=>RG,_shadersreadNonPerspective:()=>ZG,_shadersreverseLogDepth:()=>GG,_shadersround:()=>EG,_shaderssaturation:()=>IG,_shaderssceneMode2D:()=>eZ,_shaderssceneMode3D:()=>tZ,_shaderssceneModeColumbusView:()=>nZ,_shaderssceneModeMorphing:()=>iZ,_shadersshadowDepthCompare:()=>XG,_shadersshadowParameters:()=>pZ,_shadersshadowVisibility:()=>WG,_shaderssignNotZero:()=>PG,_shaderssolarRadius:()=>oZ,_shaderssphericalHarmonics:()=>vG,_shaderssrgbToLinear:()=>wG,_shaderstangentToEyeSpaceMatrix:()=>FG,_shaderstextureCube:()=>AG,_shadersthreePiOver2:()=>rZ,_shaderstransformPlane:()=>MG,_shaderstranslateRelativeToEye:()=>NG,_shaderstranslucentPhong:()=>kG,_shaderstranspose:()=>UG,_shaderstwoPi:()=>sZ,_shadersunpackClippingExtents:()=>DG,_shadersunpackDepth:()=>BG,_shadersunpackFloat:()=>OG,_shadersunpackUint:()=>YG,_shadersvalueTransform:()=>HG,_shadersvertexLogDepth:()=>zG,_shaderswebMercatorMaxLatitude:()=>aZ,_shaderswindowToEyeCoordinates:()=>KG,_shaderswriteDepthClamp:()=>JG,_shaderswriteLogDepth:()=>QG,_shaderswriteNonPerspective:()=>jG,addBuffer:()=>sW,addDefaults:()=>qX,addExtensionsRequired:()=>iW,addExtensionsUsed:()=>Yu,addPipelineExtras:()=>Ag,addToArray:()=>Zs,appendForwardSlash:()=>JL,arrayRemoveDuplicates:()=>To,barycentricCoordinates:()=>fx,binarySearch:()=>Xo,buildModuleUrl:()=>nn,buildVoxelDrawCommands:()=>qA,clone:()=>Ye,combine:()=>St,computeFlyToLocationForRectangle:()=>KT,createBillboardPointCallback:()=>pT,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>dM,createDefaultTerrainProviderViewModels:()=>uM,createElevationBandMaterial:()=>I6,createGooglePhotorealistic3DTileset:()=>X6,createGuid:()=>Hn,createMaterialPropertyDescriptor:()=>Wo,createOsmBuildingsAsync:()=>W6,createPropertyDescriptor:()=>ue,createRawPropertyDescriptor:()=>el,createTangentSpaceDebugPrimitive:()=>P6,createTaskProcessorWorker:()=>M6,createUniform:()=>cR,createUniformArray:()=>lR,createWorldBathymetryAsync:()=>EI,createWorldImageryAsync:()=>y0,createWorldTerrainAsync:()=>u_,decodeGoogleEarthEnterpriseData:()=>II,decodeVectorPolylinePositions:()=>XI,defaultValue:()=>y,defer:()=>Ll,defined:()=>l,demodernizeShader:()=>qG,deprecationWarning:()=>wa,destroyObject:()=>me,exportKml:()=>jj,findAccessorMinMax:()=>Q_,findContentMetadata:()=>xT,findGroupMetadata:()=>_T,findTileMetadata:()=>sv,forEachTextureInMaterial:()=>y1,formatError:()=>bf,freezeRenderState:()=>E3,getAbsoluteUri:()=>$h,getAccessorByteStride:()=>Ul,getBaseUri:()=>QL,getBinaryAccessor:()=>Gd,getClipAndStyleCode:()=>T9,getClippingFunction:()=>f0,getComponentReader:()=>Vb,getElement:()=>Xn,getExtensionFromUri:()=>ix,getFilenameFromUri:()=>ib,getImageFromTypedArray:()=>WI,getImagePixels:()=>Rm,getJsonFromTypedArray:()=>Jo,getMagic:()=>zm,getMetadataClassProperty:()=>r9,getMetadataProperty:()=>a9,getStringFromTypedArray:()=>Pl,getTimestamp:()=>xi,hasExtension:()=>si,heightReferenceOnEntityPropertyChanged:()=>hb,isBitSet:()=>lc,isBlobUri:()=>ox,isCrossOriginUrl:()=>F0,isDataUri:()=>Cp,isLeapYear:()=>Lm,knockout:()=>Se,knockout_3_5_1:()=>PS,knockout_es5:()=>iM,loadAndExecuteScript:()=>rx,loadCubeMap:()=>dE,loadImageFromTypedArray:()=>m_,loadKTX2:()=>Zl,mergeSort:()=>ob,moveTechniqueRenderStates:()=>nW,moveTechniquesToExtension:()=>oW,numberOfComponentsForType:()=>Id,objectToQuery:()=>sx,oneTimeWarning:()=>_t,parseBatchTable:()=>Wb,parseFeatureMetadataLegacy:()=>WW,parseGlb:()=>eW,parseResponseHeaders:()=>jL,parseStructuralMetadata:()=>XW,pickModel:()=>M1,pointInsideTriangle:()=>iK,preprocess3DTileContent:()=>Kb,processVoxelProperties:()=>jA,queryToObject:()=>ud,readAccessorPacked:()=>aW,removeExtension:()=>j_,removeExtensionsRequired:()=>$X,removeExtensionsUsed:()=>J_,removePipelineExtras:()=>tW,removeUnusedElements:()=>rW,resizeImageToNextPowerOfTwo:()=>Rg,sampleTerrain:()=>PI,sampleTerrainMostDetailed:()=>h_,scaleToGeodeticSurface:()=>nx,srgbToLinear:()=>f_,subdivideArray:()=>vI,subscribeAndEvaluate:()=>Ca,updateAccessorComponentTypes:()=>cW,updateVersion:()=>lW,usesExtension:()=>lr,viewerCesium3DTilesInspectorMixin:()=>sq,viewerCesiumInspectorMixin:()=>aq,viewerDragDropMixin:()=>lq,viewerPerformanceWatchdogMixin:()=>dq,viewerVoxelInspectorMixin:()=>uq,webGLConstantToGlslType:()=>sK,wrapFunction:()=>wI,writeTextToCanvas:()=>jx});var a2o=T(S(),1);var Lso=T(S(),1);var SLt=T(S(),1);var HVt=T(S(),1);var vVt=T(S(),1);var ZVt=T(S(),1);function r1e(e){return e!=null}var l=r1e;var IVt=T(S(),1);function ex(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(ex.prototype=Object.create(Error.prototype),ex.prototype.constructor=ex);ex.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};ex.throwInstantiationError=function(){throw new ex("This function defines an interface and should not be called directly.")};var pe=ex;var Ts={};Ts.typeOf={};function s1e(e){return`${e} is required, actual value was undefined`}function AS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ts.defined=function(e,t){if(!l(t))throw new pe(s1e(e))};Ts.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(AS(typeof t,"function",e))};Ts.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(AS(typeof t,"string",e))};Ts.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(AS(typeof t,"number",e))};Ts.typeOf.number.lessThan=function(e,t,n){if(Ts.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Ts.typeOf.number.lessThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThan=function(e,t,n){if(Ts.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Ts.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(AS(typeof t,"object",e))};Ts.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(AS(typeof t,"boolean",e))};Ts.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(AS(typeof t,"bigint",e))};Ts.typeOf.number.equals=function(e,t,n,i){if(Ts.typeOf.number(e,n),Ts.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var xo=Ts;var FVt=T(S(),1);function pq(e,t){return e??t}pq.EMPTY_OBJECT=Object.freeze({});var y=pq;var UVt=T(S(),1),kO=T(qM(),1);var at={};at.EPSILON1=.1;at.EPSILON2=.01;at.EPSILON3=.001;at.EPSILON4=1e-4;at.EPSILON5=1e-5;at.EPSILON6=1e-6;at.EPSILON7=1e-7;at.EPSILON8=1e-8;at.EPSILON9=1e-9;at.EPSILON10=1e-10;at.EPSILON11=1e-11;at.EPSILON12=1e-12;at.EPSILON13=1e-13;at.EPSILON14=1e-14;at.EPSILON15=1e-15;at.EPSILON16=1e-16;at.EPSILON17=1e-17;at.EPSILON18=1e-18;at.EPSILON19=1e-19;at.EPSILON20=1e-20;at.EPSILON21=1e-21;at.GRAVITATIONALPARAMETER=3986004418e5;at.SOLAR_RADIUS=6955e5;at.LUNAR_RADIUS=1737400;at.SIXTY_FOUR_KILOBYTES=64*1024;at.FOUR_GIGABYTES=4*1024*1024*1024;at.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});at.signNotZero=function(e){return e<0?-1:1};at.toSNorm=function(e,t){return t=y(t,255),Math.round((at.clamp(e,-1,1)*.5+.5)*t)};at.fromSNorm=function(e,t){return t=y(t,255),at.clamp(e,0,t)/t*2-1};at.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:at.clamp((e-t)/n,0,1)};at.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});at.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});at.lerp=function(e,t,n){return(1-n)*e+n*t};at.PI=Math.PI;at.ONE_OVER_PI=1/Math.PI;at.PI_OVER_TWO=Math.PI/2;at.PI_OVER_THREE=Math.PI/3;at.PI_OVER_FOUR=Math.PI/4;at.PI_OVER_SIX=Math.PI/6;at.THREE_PI_OVER_TWO=3*Math.PI/2;at.TWO_PI=2*Math.PI;at.ONE_OVER_TWO_PI=1/(2*Math.PI);at.RADIANS_PER_DEGREE=Math.PI/180;at.DEGREES_PER_RADIAN=180/Math.PI;at.RADIANS_PER_ARCSECOND=at.RADIANS_PER_DEGREE/3600;at.toRadians=function(e){return e*at.RADIANS_PER_DEGREE};at.toDegrees=function(e){return e*at.DEGREES_PER_RADIAN};at.convertLongitudeRange=function(e){let t=at.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};at.clampToLatitudeRange=function(e){return at.clamp(e,-1*at.PI_OVER_TWO,at.PI_OVER_TWO)};at.negativePiToPi=function(e){return e>=-at.PI&&e<=at.PI?e:at.zeroToTwoPi(e+at.PI)-at.PI};at.zeroToTwoPi=function(e){if(e>=0&&e<=at.TWO_PI)return e;let t=at.mod(e,at.TWO_PI);return Math.abs(t)<at.EPSILON14&&Math.abs(e)>at.EPSILON14?at.TWO_PI:t};at.mod=function(e,t){return at.sign(e)===at.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};at.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};at.lessThan=function(e,t,n){return e-t<-n};at.lessThanOrEquals=function(e,t,n){return e-t<n};at.greaterThan=function(e,t,n){return e-t>n};at.greaterThanOrEquals=function(e,t,n){return e-t>-n};var $M=[1];at.factorial=function(e){let t=$M.length;if(e>=t){let n=$M[t-1];for(let i=t;i<=e;i++){let o=n*i;$M.push(o),n=o}}return $M[e]};at.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};at.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};at.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};at.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};at.clamp=function(e,t,n){return e<t?t:e>n?n:e};var gq=new kO.default;at.setRandomNumberSeed=function(e){gq=new kO.default(e)};at.nextRandomNumber=function(){return gq.random()};at.randomBetween=function(e,t){return at.nextRandomNumber()*(t-e)+e};at.acosClamped=function(e){return Math.acos(at.clamp(e,-1,1))};at.asinClamped=function(e){return Math.asin(at.clamp(e,-1,1))};at.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};at.logBase=function(e,t){return Math.log(e)/Math.log(t)};at.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});at.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});at.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};at.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};at.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=at.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?at.PI_OVER_TWO-i:i,i=e<0?at.PI-i:i,i=t<0?-i:i,i};var W=at;function et(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}et.fromSpherical=function(e,t){l(t)||(t=new et);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};et.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new et(e,t,n)};et.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new et(e.x,e.y,e.z)};et.fromCartesian4=et.clone;et.packedLength=3;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new et),n.x=e[t++],n.y=e[t++],n.z=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)et.pack(e[o],t,o*3);return t};et.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=et.unpack(e,i,t[o])}return t};et.fromArray=et.unpack;et.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};et.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};et.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};et.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};et.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};et.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};et.magnitude=function(e){return Math.sqrt(et.magnitudeSquared(e))};var tN=new et;et.distance=function(e,t){return et.subtract(e,t,tN),et.magnitude(tN)};et.distanceSquared=function(e,t){return et.subtract(e,t,tN),et.magnitudeSquared(tN)};et.normalize=function(e,t){let n=et.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};et.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};et.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};et.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};et.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};et.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};et.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};et.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};et.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};et.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var yq=new et;et.lerp=function(e,t,n,i){return et.multiplyByScalar(t,n,yq),i=et.multiplyByScalar(e,1-n,i),et.add(yq,i,i)};var eN=new et,UO=new et;et.angleBetween=function(e,t){et.normalize(e,eN),et.normalize(t,UO);let n=et.dot(eN,UO),i=et.magnitude(et.cross(eN,UO,eN));return Math.atan2(i,n)};var a1e=new et;et.mostOrthogonalAxis=function(e,t){let n=et.normalize(e,a1e);return et.abs(n,n),n.x<=n.y?n.x<=n.z?t=et.clone(et.UNIT_X,t):t=et.clone(et.UNIT_Z,t):n.y<=n.z?t=et.clone(et.UNIT_Y,t):t=et.clone(et.UNIT_Z,t),t};et.projectVector=function(e,t,n){let i=et.dot(e,t)/et.dot(t,t);return et.multiplyByScalar(t,i,n)};et.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};et.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};et.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)};et.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,d=o*c-r*a,u=r*s-i*c,h=i*a-o*s;return n.x=d,n.y=u,n.z=h,n};et.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};et.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(e),t=W.toRadians(t),et.fromRadians(e,t,n,i,o)};var bu=new et,MS=new et;et._ellipsoidRadiiSquared=new et(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);et.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:et._ellipsoidRadiiSquared,s=Math.cos(t);bu.x=s*Math.cos(e),bu.y=s*Math.sin(e),bu.z=Math.sin(t),bu=et.normalize(bu,bu),et.multiplyComponents(r,bu,MS);let a=Math.sqrt(et.dot(bu,MS));return MS=et.divideByScalar(MS,a,MS),bu=et.multiplyByScalar(bu,n,bu),l(o)||(o=new et),et.add(MS,bu,o)};et.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromDegrees(r,s,0,t,n[a])}return n};et.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromRadians(r,s,0,t,n[a])}return n};et.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromDegrees(r,s,a,t,n[c])}return n};et.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromRadians(r,s,a,t,n[c])}return n};et.ZERO=Object.freeze(new et(0,0,0));et.ONE=Object.freeze(new et(1,1,1));et.UNIT_X=Object.freeze(new et(1,0,0));et.UNIT_Y=Object.freeze(new et(0,1,0));et.UNIT_Z=Object.freeze(new et(0,0,1));et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.prototype.equalsEpsilon=function(e,t,n){return et.equalsEpsilon(this,e,t,n)};et.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=et;var pLt=T(S(),1);var jVt=T(S(),1);function Tt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}Tt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Tt(e,t,n,i)};Tt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Tt(e.red,e.green,e.blue,e.alpha)};Tt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Tt(e.x,e.y,e.z,e.w)};Tt.packedLength=4;Tt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};Tt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Tt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};Tt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Tt.pack(e[o],t,o*4);return t};Tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Tt.unpack(e,i,t[o])}return t};Tt.fromArray=Tt.unpack;Tt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};Tt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};Tt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};Tt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};Tt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z),a=W.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};Tt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};Tt.magnitude=function(e){return Math.sqrt(Tt.magnitudeSquared(e))};var nN=new Tt;Tt.distance=function(e,t){return Tt.subtract(e,t,nN),Tt.magnitude(nN)};Tt.distanceSquared=function(e,t){return Tt.subtract(e,t,nN),Tt.magnitudeSquared(nN)};Tt.normalize=function(e,t){let n=Tt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};Tt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Tt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};Tt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};Tt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};Tt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};Tt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};Tt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};Tt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Tt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var xq=new Tt;Tt.lerp=function(e,t,n,i){return Tt.multiplyByScalar(t,n,xq),i=Tt.multiplyByScalar(e,1-n,i),Tt.add(xq,i,i)};var c1e=new Tt;Tt.mostOrthogonalAxis=function(e,t){let n=Tt.normalize(e,c1e);return Tt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Tt.clone(Tt.UNIT_X,t):t=Tt.clone(Tt.UNIT_W,t):n.z<=n.w?t=Tt.clone(Tt.UNIT_Z,t):t=Tt.clone(Tt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Tt.clone(Tt.UNIT_Y,t):t=Tt.clone(Tt.UNIT_W,t):n.z<=n.w?t=Tt.clone(Tt.UNIT_Z,t):t=Tt.clone(Tt.UNIT_W,t),t};Tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};Tt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};Tt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)&&W.equalsEpsilon(e.w,t.w,n,i)};Tt.ZERO=Object.freeze(new Tt(0,0,0,0));Tt.ONE=Object.freeze(new Tt(1,1,1,1));Tt.UNIT_X=Object.freeze(new Tt(1,0,0,0));Tt.UNIT_Y=Object.freeze(new Tt(0,1,0,0));Tt.UNIT_Z=Object.freeze(new Tt(0,0,1,0));Tt.UNIT_W=Object.freeze(new Tt(0,0,0,1));Tt.prototype.clone=function(e){return Tt.clone(this,e)};Tt.prototype.equals=function(e){return Tt.equals(this,e)};Tt.prototype.equalsEpsilon=function(e,t,n){return Tt.equalsEpsilon(this,e,t,n)};Tt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var DO=new Float32Array(1),qa=new Uint8Array(DO.buffer),l1e=new Uint32Array([287454020]),d1e=new Uint8Array(l1e.buffer),_q=d1e[0]===68;Tt.packFloat=function(e,t){return l(t)||(t=new Tt),DO[0]=e,_q?(t.x=qa[0],t.y=qa[1],t.z=qa[2],t.w=qa[3]):(t.x=qa[3],t.y=qa[2],t.z=qa[1],t.w=qa[0]),t};Tt.unpackFloat=function(e){return _q?(qa[0]=e.x,qa[1]=e.y,qa[2]=e.z,qa[3]=e.w):(qa[0]=e.w,qa[1]=e.z,qa[2]=e.y,qa[3]=e.x),DO[0]};var se=Tt;var iLt=T(S(),1);function nt(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}nt.packedLength=9;nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};nt.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)nt.pack(e[o],t,o*9);return t};nt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=nt.unpack(e,i,t[o])}return t};nt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new nt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};nt.fromArray=nt.unpack;nt.fromColumnMajorArray=function(e,t){return nt.clone(e,t)};nt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new nt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};nt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,d=e.z*e.z,u=e.z*e.w,h=e.w*e.w,p=n-s-d+h,g=2*(i-u),f=2*(o+c),x=2*(i+u),_=-n+s-d+h,C=2*(a-r),V=2*(o-c),L=2*(a+r),R=-n-s+d+h;return l(t)?(t[0]=p,t[1]=x,t[2]=V,t[3]=g,t[4]=_,t[5]=L,t[6]=f,t[7]=C,t[8]=R,t):new nt(p,g,f,x,_,C,V,L,R)};nt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,d=-o*s+a*r*i,u=a*s+o*r*i,h=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,f=-r,x=a*n,_=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=f,t[3]=d,t[4]=p,t[5]=x,t[6]=u,t[7]=g,t[8]=_,t):new nt(c,d,u,h,p,g,f,x,_)};nt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new nt(e.x,0,0,0,e.y,0,0,0,e.z)};nt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new nt(e,0,0,0,e,0,0,0,e)};nt.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new nt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};nt.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new nt(1,0,0,0,n,-i,0,i,n)};nt.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new nt(n,0,i,0,1,0,-i,0,n)};nt.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new nt(n,-i,0,i,n,0,0,0,1)};nt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};nt.getElementIndex=function(e,t){return e*3+t};nt.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};nt.setColumn=function(e,t,n,i){i=nt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};nt.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};nt.setRow=function(e,t,n,i){return i=nt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var u1e=new m;nt.setScale=function(e,t,n){let i=nt.getScale(e,u1e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var m1e=new m;nt.setUniformScale=function(e,t,n){let i=nt.getScale(e,m1e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var BO=new m;nt.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],BO)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],BO)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],BO)),t};var Tq=new m;nt.getMaximumScale=function(e){return nt.getScale(e,Tq),m.maximumComponent(Tq)};var h1e=new m;nt.setRotation=function(e,t,n){let i=nt.getScale(e,h1e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var f1e=new m;nt.getRotation=function(e,t){let n=nt.getScale(e,f1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};nt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=d,n[7]=u,n[8]=h,n};nt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};nt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};nt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};nt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};nt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};nt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};nt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};nt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],d=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=d,t[8]=u,t};function p1e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var OO=[1,0,0],YO=[2,2,1];function b1e(e){let t=0;for(let n=0;n<3;++n){let i=e[nt.getElementIndex(YO[n],OO[n])];t+=2*i*i}return Math.sqrt(t)}function g1e(e,t){let n=W.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[nt.getElementIndex(YO[d],OO[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=OO[o],c=YO[o];if(Math.abs(e[nt.getElementIndex(c,a)])>n){let d=e[nt.getElementIndex(c,c)],u=e[nt.getElementIndex(a,a)],h=e[nt.getElementIndex(c,a)],p=(d-u)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=nt.clone(nt.IDENTITY,t),t[nt.getElementIndex(a,a)]=t[nt.getElementIndex(c,c)]=r,t[nt.getElementIndex(c,a)]=s,t[nt.getElementIndex(a,c)]=-s,t}var iN=new nt,Sq=new nt;nt.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=nt.clone(nt.IDENTITY,t.unitary),a=t.diagonal=nt.clone(e,t.diagonal),c=n*p1e(a);for(;r<i&&b1e(a)>c;)g1e(a,iN),nt.transpose(iN,Sq),nt.multiply(a,iN,a),nt.multiply(Sq,a,a),nt.multiply(s,iN,s),++o>2&&(++r,o=0);return t};nt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};nt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};nt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],h=nt.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/h;return nt.multiplyByScalar(t,p,t)};var y1e=new nt;nt.inverseTranspose=function(e,t){return nt.inverse(nt.transpose(e,y1e),t)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};nt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};nt.IDENTITY=Object.freeze(new nt(1,0,0,0,1,0,0,0,1));nt.ZERO=Object.freeze(new nt(0,0,0,0,0,0,0,0,0));nt.COLUMN0ROW0=0;nt.COLUMN0ROW1=1;nt.COLUMN0ROW2=2;nt.COLUMN1ROW0=3;nt.COLUMN1ROW1=4;nt.COLUMN1ROW2=5;nt.COLUMN2ROW0=6;nt.COLUMN2ROW1=7;nt.COLUMN2ROW2=8;Object.defineProperties(nt.prototype,{length:{get:function(){return nt.packedLength}}});nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var $=nt;var sLt=T(S(),1);function HL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(HL.prototype=Object.create(Error.prototype),HL.prototype.constructor=HL);HL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var ae=HL;function tt(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(d,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(u,0),this[11]=y(f,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(h,0),this[15]=y(x,0)}tt.packedLength=16;tt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};tt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new tt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};tt.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)tt.pack(e[o],t,o*16);return t};tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new tt(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};tt.fromRotationTranslation=function(e,t,n){return t=y(t,m.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new tt(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};tt.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new tt);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,d=t.x*t.z,u=t.x*t.w,h=t.y*t.y,p=t.y*t.z,g=t.y*t.w,f=t.z*t.z,x=t.z*t.w,_=t.w*t.w,C=a-h-f+_,V=2*(c-x),L=2*(d+g),R=2*(c+x),G=-a+h-f+_,I=2*(p-u),v=2*(d-g),P=2*(p+u),w=-a-h+f+_;return i[0]=C*o,i[1]=R*o,i[2]=v*o,i[3]=0,i[4]=V*r,i[5]=G*r,i[6]=P*r,i[7]=0,i[8]=L*s,i[9]=I*s,i[10]=w*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};tt.fromTranslationRotationScale=function(e,t){return tt.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};tt.fromTranslation=function(e,t){return tt.fromRotationTranslation($.IDENTITY,e,t)};tt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new tt(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};tt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new tt(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};tt.fromRotation=function(e,t){return l(t)||(t=new tt),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var NS=new m,kS=new m,zL=new m;tt.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;m.normalize(i,NS),m.normalize(m.cross(NS,o,kS),kS),m.normalize(m.cross(kS,NS,zL),zL);let r=kS.x,s=kS.y,a=kS.z,c=NS.x,d=NS.y,u=NS.z,h=zL.x,p=zL.y,g=zL.z,f=n.x,x=n.y,_=n.z,C=r*-f+s*-x+a*-_,V=h*-f+p*-x+g*-_,L=c*f+d*x+u*_;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-d,t[7]=0,t[8]=a,t[9]=g,t[10]=-u,t[11]=0,t[12]=C,t[13]=V,t[14]=L,t[15]=1,t):new tt(r,s,a,C,h,p,g,V,-c,-d,-u,L,0,0,0,1)};tt.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),d=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o};tt.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),d=1/(r-o),u=-(t+e)*a,h=-(i+n)*c,p=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=h,s[14]=p,s[15]=1,s};tt.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),d=(t+e)/(t-e),u=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};tt.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),d=(i+n)/(i-n),u=-1,h=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};tt.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new tt),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,d=a*.5,u=(n-t)*.5,h=c,p=d,g=u,f=o+c,x=r+d,_=t+u,C=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=f,i[13]=x,i[14]=_,i[15]=C,i};tt.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-m.dot(i,e),o[13]=-m.dot(n,e),o[14]=m.dot(t,e),o[15]=1,o};tt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};tt.getElementIndex=function(e,t){return e*4+t};tt.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};tt.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};tt.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var x1e=new m;tt.setScale=function(e,t,n){let i=tt.getScale(e,x1e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var _1e=new m;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,_1e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var HO=new m;tt.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],HO)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],HO)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],HO)),t};var Cq=new m;tt.getMaximumScale=function(e){return tt.getScale(e,Cq),m.maximumComponent(Cq)};var T1e=new m;tt.setRotation=function(e,t,n){let i=tt.getScale(e,T1e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var S1e=new m;tt.getRotation=function(e,t){let n=tt.getScale(e,S1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};tt.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],d=e[6],u=e[7],h=e[8],p=e[9],g=e[10],f=e[11],x=e[12],_=e[13],C=e[14],V=e[15],L=t[0],R=t[1],G=t[2],I=t[3],v=t[4],P=t[5],w=t[6],M=t[7],b=t[8],Z=t[9],E=t[10],X=t[11],F=t[12],N=t[13],O=t[14],U=t[15],Y=i*L+a*R+h*G+x*I,k=o*L+c*R+p*G+_*I,H=r*L+d*R+g*G+C*I,K=s*L+u*R+f*G+V*I,te=i*v+a*P+h*w+x*M,z=o*v+c*P+p*w+_*M,j=r*v+d*P+g*w+C*M,ee=s*v+u*P+f*w+V*M,fe=i*b+a*Z+h*E+x*X,Te=o*b+c*Z+p*E+_*X,de=r*b+d*Z+g*E+C*X,xe=s*b+u*Z+f*E+V*X,Ce=i*F+a*N+h*O+x*U,Ie=o*F+c*N+p*O+_*U,Le=r*F+d*N+g*O+C*U,Ne=s*F+u*N+f*O+V*U;return n[0]=Y,n[1]=k,n[2]=H,n[3]=K,n[4]=te,n[5]=z,n[6]=j,n[7]=ee,n[8]=fe,n[9]=Te,n[10]=de,n[11]=xe,n[12]=Ce,n[13]=Ie,n[14]=Le,n[15]=Ne,n};tt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};tt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};tt.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],h=e[10],p=e[12],g=e[13],f=e[14],x=t[0],_=t[1],C=t[2],V=t[4],L=t[5],R=t[6],G=t[8],I=t[9],v=t[10],P=t[12],w=t[13],M=t[14],b=i*x+s*_+d*C,Z=o*x+a*_+u*C,E=r*x+c*_+h*C,X=i*V+s*L+d*R,F=o*V+a*L+u*R,N=r*V+c*L+h*R,O=i*G+s*I+d*v,U=o*G+a*I+u*v,Y=r*G+c*I+h*v,k=i*P+s*w+d*M+p,H=o*P+a*w+u*M+g,K=r*P+c*w+h*M+f;return n[0]=b,n[1]=Z,n[2]=E,n[3]=0,n[4]=X,n[5]=F,n[6]=N,n[7]=0,n[8]=O,n[9]=U,n[10]=Y,n[11]=0,n[12]=k,n[13]=H,n[14]=K,n[15]=1,n};tt.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],h=e[10],p=t[0],g=t[1],f=t[2],x=t[3],_=t[4],C=t[5],V=t[6],L=t[7],R=t[8],G=i*p+s*g+d*f,I=o*p+a*g+u*f,v=r*p+c*g+h*f,P=i*x+s*_+d*C,w=o*x+a*_+u*C,M=r*x+c*_+h*C,b=i*V+s*L+d*R,Z=o*V+a*L+u*R,E=r*V+c*L+h*R;return n[0]=G,n[1]=I,n[2]=v,n[3]=0,n[4]=P,n[5]=w,n[6]=M,n[7]=0,n[8]=b,n[9]=Z,n[10]=E,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};tt.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};tt.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?tt.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};tt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};tt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,d=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=d,n.w=u,n};tt.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};tt.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};tt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};tt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};tt.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};tt.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};tt.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var C1e=new $,V1e=new $,L1e=new se,R1e=new se(0,0,0,1);tt.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],d=e[13],u=e[2],h=e[6],p=e[10],g=e[14],f=e[3],x=e[7],_=e[11],C=e[15],V=p*C,L=g*_,R=h*C,G=g*x,I=h*_,v=p*x,P=u*C,w=g*f,M=u*_,b=p*f,Z=u*x,E=h*f,X=V*a+G*c+I*d-(L*a+R*c+v*d),F=L*s+P*c+b*d-(V*s+w*c+M*d),N=R*s+w*a+Z*d-(G*s+P*a+E*d),O=v*s+M*a+E*c-(I*s+b*a+Z*c),U=L*i+R*o+v*r-(V*i+G*o+I*r),Y=V*n+w*o+M*r-(L*n+P*o+b*r),k=G*n+P*i+E*r-(R*n+w*i+Z*r),H=I*n+b*i+Z*o-(v*n+M*i+E*o);V=o*d,L=r*c,R=i*d,G=r*a,I=i*c,v=o*a,P=n*d,w=r*s,M=n*c,b=o*s,Z=n*a,E=i*s;let K=V*x+G*_+I*C-(L*x+R*_+v*C),te=L*f+P*_+b*C-(V*f+w*_+M*C),z=R*f+w*x+Z*C-(G*f+P*x+E*C),j=v*f+M*x+E*_-(I*f+b*x+Z*_),ee=R*p+v*g+L*h-(I*g+V*h+G*p),fe=M*g+V*u+w*p-(P*p+b*g+L*u),Te=P*h+E*g+G*u-(Z*g+R*u+w*h),de=Z*p+I*u+b*h-(M*h+E*p+v*u),xe=n*X+i*F+o*N+r*O;if(Math.abs(xe)<W.EPSILON21){if($.equalsEpsilon(tt.getMatrix3(e,C1e),V1e,W.EPSILON7)&&se.equals(tt.getRow(e,3,L1e),R1e))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new ae("matrix is not invertible because its determinate is zero.")}return xe=1/xe,t[0]=X*xe,t[1]=F*xe,t[2]=N*xe,t[3]=O*xe,t[4]=U*xe,t[5]=Y*xe,t[6]=k*xe,t[7]=H*xe,t[8]=K*xe,t[9]=te*xe,t[10]=z*xe,t[11]=j*xe,t[12]=ee*xe,t[13]=fe*xe,t[14]=Te*xe,t[15]=de*xe,t};tt.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],d=e[9],u=e[10],h=e[12],p=e[13],g=e[14],f=-n*h-i*p-o*g,x=-r*h-s*p-a*g,_=-c*h-d*p-u*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=d,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=f,t[13]=x,t[14]=_,t[15]=1,t};var Z1e=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,Z1e),t)};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN0ROW3=3;tt.COLUMN1ROW0=4;tt.COLUMN1ROW1=5;tt.COLUMN1ROW2=6;tt.COLUMN1ROW3=7;tt.COLUMN2ROW0=8;tt.COLUMN2ROW1=9;tt.COLUMN2ROW2=10;tt.COLUMN2ROW3=11;tt.COLUMN3ROW0=12;tt.COLUMN3ROW1=13;tt.COLUMN3ROW2=14;tt.COLUMN3ROW3=15;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var A=tt;var gLt=T(S(),1),G1e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},ie=Object.freeze(G1e);var E1e=new m;function It(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var aa={};aa[ie.FLOAT]="float";aa[ie.FLOAT_VEC2]="vec2";aa[ie.FLOAT_VEC3]="vec3";aa[ie.FLOAT_VEC4]="vec4";aa[ie.INT]="int";aa[ie.INT_VEC2]="ivec2";aa[ie.INT_VEC3]="ivec3";aa[ie.INT_VEC4]="ivec4";aa[ie.BOOL]="bool";aa[ie.BOOL_VEC2]="bvec2";aa[ie.BOOL_VEC3]="bvec3";aa[ie.BOOL_VEC4]="bvec4";aa[ie.FLOAT_MAT2]="mat2";aa[ie.FLOAT_MAT3]="mat3";aa[ie.FLOAT_MAT4]="mat4";aa[ie.SAMPLER_2D]="sampler2D";aa[ie.SAMPLER_CUBE]="samplerCube";It.prototype.getDeclaration=function(e){let t=`uniform ${aa[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var I1e={czm_viewport:new It({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new It({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new It({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new It({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new It({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new It({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new It({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new It({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return A.getTranslation(e.inverseView,E1e)}}),czm_frameNumber:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new It({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new It({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new It({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new It({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new It({size:9,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new It({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new It({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new It({size:1,datatype:ie.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new It({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},_p=I1e;var BLt=T(S(),1);var VLt=T(S(),1);function X1e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Hn=X1e;var ZLt=T(S(),1);function W1e(){return!0}function P1e(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=W1e}var me=P1e;var WLt=T(S(),1);var Fs={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};Fs.getSizeInBytes=function(e){switch(e){case Fs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Fs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Fs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Fs.fromSizeInBytes=function(e){switch(e){case 2:return Fs.UNSIGNED_SHORT;case 4:return Fs.UNSIGNED_INT;case 1:return Fs.UNSIGNED_BYTE}};Fs.validate=function(e){return l(e)&&(e===Fs.UNSIGNED_BYTE||e===Fs.UNSIGNED_SHORT||e===Fs.UNSIGNED_INT)};Fs.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Fs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Fs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Fs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Fs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Fs.UNSIGNED_INT};var Ae=Object.freeze(Fs);var wLt=T(S(),1);var oN={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,validate:function(e){return e===oN.STREAM_DRAW||e===oN.STATIC_DRAW||e===oN.DYNAMIC_DRAW}},Me=Object.freeze(oN);function gu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Hn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}gu.createVertexBuffer=function(e){return new gu({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};gu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ae.getSizeInBytes(n),o=new gu({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(gu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});gu.prototype._getBuffer=function(){return this._buffer};gu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};gu.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};gu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};gu.prototype.isDestroyed=function(){return!1};gu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),me(this)};var xt=gu;var aRt=T(S(),1);var iRt=T(S(),1);var jLt=T(S(),1);var HLt=T(S(),1);var P0,Ir={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Vl={};Object.defineProperties(Vl,{element:{get:function(){if(Vl.supportsFullscreen())return document[Ir.fullscreenElement]}},changeEventName:{get:function(){if(Vl.supportsFullscreen())return Ir.fullscreenchange}},errorEventName:{get:function(){if(Vl.supportsFullscreen())return Ir.fullscreenerror}},enabled:{get:function(){if(Vl.supportsFullscreen())return document[Ir.fullscreenEnabled]}},fullscreen:{get:function(){if(Vl.supportsFullscreen())return Vl.element!==null}}});Vl.supportsFullscreen=function(){if(l(P0))return P0;P0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Ir.requestFullscreen="requestFullscreen",Ir.exitFullscreen="exitFullscreen",Ir.fullscreenEnabled="fullscreenEnabled",Ir.fullscreenElement="fullscreenElement",Ir.fullscreenchange="fullscreenchange",Ir.fullscreenerror="fullscreenerror",P0=!0,P0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Ir.requestFullscreen=n,P0=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Ir.requestFullscreen=n,P0=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Ir.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Ir.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Ir.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Ir.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Ir.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Ir.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Ir.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Ir.fullscreenerror=n)}return P0};Vl.requestFullscreen=function(e,t){Vl.supportsFullscreen()&&e[Ir.requestFullscreen]({vrDisplay:t})};Vl.exitFullscreen=function(){Vl.supportsFullscreen()&&document[Ir.exitFullscreen]()};Vl._names=Ir;var br=Vl;var $a;typeof navigator<"u"?$a=navigator:$a={};function tx(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var rN,Vq;function qO(){if(!l(rN)&&(rN=!1,!uN())){let e=/ Chrome\/([\.0-9]+)/.exec($a.userAgent);e!==null&&(rN=!0,Vq=tx(e[1]))}return rN}function v1e(){return qO()&&Vq}var sN,Lq;function Rq(){if(!l(sN)&&(sN=!1,!qO()&&!uN()&&/ Safari\/[\.0-9]+/.test($a.userAgent))){let e=/ Version\/([\.0-9]+)/.exec($a.userAgent);e!==null&&(sN=!0,Lq=tx(e[1]))}return sN}function w1e(){return Rq()&&Lq}var aN,QO;function Zq(){if(!l(aN)){aN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec($a.userAgent);e!==null&&(aN=!0,QO=tx(e[1]),QO.isNightly=!!e[2])}return aN}function F1e(){return Zq()&&QO}var KL,jO;function Gq(){if(!l(KL)){KL=!1;let e;$a.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec($a.userAgent),e!==null&&(KL=!0,jO=tx(e[1]))):$a.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec($a.userAgent),e!==null&&(KL=!0,jO=tx(e[1])))}return KL}function A1e(){return Gq()&&jO}var cN,Eq;function uN(){if(!l(cN)){cN=!1;let e=/ Edg\/([\.0-9]+)/.exec($a.userAgent);e!==null&&(cN=!0,Eq=tx(e[1]))}return cN}function M1e(){return uN()&&Eq}var lN,$O;function mN(){if(!l(lN)){lN=!1;let e=/Firefox\/([\.0-9]+)/.exec($a.userAgent);e!==null&&(lN=!0,$O=tx(e[1]))}return lN}var zO;function N1e(){return l(zO)||(zO=/Windows/i.test($a.appVersion)),zO}var KO;function k1e(){return l(KO)||(KO=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),KO}function U1e(){return mN()&&$O}var JO;function D1e(){return l(JO)||(JO=!mN()&&typeof PointerEvent<"u"&&(!l($a.pointerEnabled)||$a.pointerEnabled)),JO}var Iq,dN;function Xq(){if(!l(dN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;dN=l(t)&&t!=="",dN&&(Iq=t)}return dN}function B1e(){return Xq()?Iq:void 0}function vc(){return vc._result}vc._promise=void 0;vc._result=void 0;vc.initialize=function(){return l(vc._promise)||(vc._promise=new Promise(e=>{let t=new Image;t.onload=function(){vc._result=t.width>0&&t.height>0,e(vc._result)},t.onerror=function(){vc._result=!1,e(vc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),vc._promise};Object.defineProperties(vc,{initialized:{get:function(){return l(vc._result)}}});var US=[];typeof ArrayBuffer<"u"&&(US.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&US.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&US.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&US.push(BigInt64Array),typeof BigUint64Array<"u"&&US.push(BigUint64Array));var yu={isChrome:qO,chromeVersion:v1e,isSafari:Rq,safariVersion:w1e,isWebkit:Zq,webkitVersion:F1e,isInternetExplorer:Gq,internetExplorerVersion:A1e,isEdge:uN,edgeVersion:M1e,isFirefox:mN,firefoxVersion:U1e,isWindows:N1e,isIPadOrIOS:k1e,hardwareConcurrency:y($a.hardwareConcurrency,3),supportsPointerEvents:D1e,supportsImageRenderingPixelated:Xq,supportsWebP:vc,imageRenderingValue:B1e,typedArrayTypes:US};yu.supportsBasis=function(e){return yu.supportsWebAssembly()&&e.context.supportsBasis};yu.supportsFullscreen=function(){return br.supportsFullscreen()};yu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};yu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};yu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};yu.supportsBigInt=function(){return typeof BigInt<"u"};yu.supportsWebWorkers=function(){return typeof Worker<"u"};yu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};yu.supportsWebgl2=function(e){return e.context.webgl2};yu.supportsEsmWebWorkers=function(){return!mN()||parseInt($O)>=114};var Bt=yu;function e3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}re.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(y(e,255)),t=re.byteToFloat(y(t,255)),n=re.byteToFloat(y(n,255)),i=re.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var t3,n3,Tp;Bt.supportsTypedArrays()&&(t3=new ArrayBuffer(4),n3=new Uint32Array(t3),Tp=new Uint8Array(t3));re.fromRgba=function(e,t){return n3[0]=e,re.fromBytes(Tp[0],Tp[1],Tp[2],Tp[3],t)};re.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=e3(d,c,e+1/3),s=e3(d,c,e),a=e3(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+W.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var O1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,Y1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,H1e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,z1e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){l(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(l(n))return re.clone(n,t),t;let i=O1e.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=Y1e.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=H1e.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=z1e.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return Tp[0]=re.floatToByte(this.red),Tp[1]=re.floatToByte(this.green),Tp[2]=re.floatToByte(this.blue),Tp[3]=re.floatToByte(this.alpha),n3[0]};re.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};re.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return i.red=W.lerp(e.red,t.red,n),i.green=W.lerp(e.green,t.green,n),i.blue=W.lerp(e.blue,t.blue,n),i.alpha=W.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var B=re;function hN(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}hN.ALL=Object.freeze(new hN({color:new B(0,0,0,0),depth:1,stencil:0}));hN.prototype.execute=function(e,t){e.clear(this,t)};var ti=hN;var hRt=T(S(),1);var lRt=T(S(),1),K1e={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ee=Object.freeze(K1e);function Wq(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ee.COMPUTE,this.owner=e.owner}Wq.prototype.execute=function(e){e.execute(this)};var wc=Wq;var LWt=T(S(),1);var YIt=T(S(),1);var yRt=T(S(),1);function Nt(e,t){this.x=y(e,0),this.y=y(t,0)}Nt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Nt(e,t)};Nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Nt(e.x,e.y)};Nt.fromCartesian3=Nt.clone;Nt.fromCartesian4=Nt.clone;Nt.packedLength=2;Nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Nt),n.x=e[t++],n.y=e[t],n};Nt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Nt.pack(e[o],t,o*2);return t};Nt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Nt.unpack(e,i,t[o])}return t};Nt.fromArray=Nt.unpack;Nt.maximumComponent=function(e){return Math.max(e.x,e.y)};Nt.minimumComponent=function(e){return Math.min(e.x,e.y)};Nt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Nt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Nt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Nt.magnitude=function(e){return Math.sqrt(Nt.magnitudeSquared(e))};var fN=new Nt;Nt.distance=function(e,t){return Nt.subtract(e,t,fN),Nt.magnitude(fN)};Nt.distanceSquared=function(e,t){return Nt.subtract(e,t,fN),Nt.magnitudeSquared(fN)};Nt.normalize=function(e,t){let n=Nt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Nt.dot=function(e,t){return e.x*t.x+e.y*t.y};Nt.cross=function(e,t){return e.x*t.y-e.y*t.x};Nt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Nt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Nt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var Pq=new Nt;Nt.lerp=function(e,t,n,i){return Nt.multiplyByScalar(t,n,Pq),i=Nt.multiplyByScalar(e,1-n,i),Nt.add(Pq,i,i)};var vq=new Nt,wq=new Nt;Nt.angleBetween=function(e,t){return Nt.normalize(e,vq),Nt.normalize(t,wq),W.acosClamped(Nt.dot(vq,wq))};var J1e=new Nt;Nt.mostOrthogonalAxis=function(e,t){let n=Nt.normalize(e,J1e);return Nt.abs(n,n),n.x<=n.y?t=Nt.clone(Nt.UNIT_X,t):t=Nt.clone(Nt.UNIT_Y,t),t};Nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Nt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Nt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)};Nt.ZERO=Object.freeze(new Nt(0,0));Nt.ONE=Object.freeze(new Nt(1,1));Nt.UNIT_X=Object.freeze(new Nt(1,0));Nt.UNIT_Y=Object.freeze(new Nt(0,1));Nt.prototype.clone=function(e){return Nt.clone(this,e)};Nt.prototype.equals=function(e){return Nt.equals(this,e)};Nt.prototype.equalsEpsilon=function(e,t,n){return Nt.equalsEpsilon(this,e,t,n)};Nt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var D=Nt;var IRt=T(S(),1);var CRt=T(S(),1);var Q1e=new m,j1e=new m;function q1e(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,d=t.y,u=t.z,h=r*r*c*c,p=s*s*d*d,g=a*a*u*u,f=h+p+g,x=Math.sqrt(1/f),_=m.multiplyByScalar(e,x,Q1e);if(f<i)return isFinite(x)?m.clone(_,o):void 0;let C=n.x,V=n.y,L=n.z,R=j1e;R.x=_.x*C*2,R.y=_.y*V*2,R.z=_.z*L*2;let G=(1-x)*m.magnitude(e)/(.5*m.magnitude(R)),I=0,v,P,w,M,b,Z,E,X,F,N,O;do{G-=I,w=1/(1+G*C),M=1/(1+G*V),b=1/(1+G*L),Z=w*w,E=M*M,X=b*b,F=Z*w,N=E*M,O=X*b,v=h*Z+p*E+g*X-1,P=h*F*C+p*N*V+g*O*L;let U=-2*P;I=v/U}while(Math.abs(v)>W.EPSILON12);return l(o)?(o.x=r*w,o.y=s*M,o.z=a*b,o):new m(r*w,s*M,a*b)}var nx=q1e;function Ao(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Ao.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Ao(e,t,n)};Ao.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),Ao.fromRadians(e,t,n,i)};var $1e=new m,eVe=new m,tVe=new m;Ao._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);Ao._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Ao._ellipsoidCenterToleranceSquared=W.EPSILON1;Ao.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Ao._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Ao._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Ao._ellipsoidCenterToleranceSquared,s=nx(e,i,o,r,eVe);if(!l(s))return;let a=m.multiplyComponents(s,o,$1e);a=m.normalize(a,a);let c=m.subtract(e,s,tVe),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),h=W.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=h,n):new Ao(d,u,h)};Ao.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Ao.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Ao(e.longitude,e.latitude,e.height)};Ao.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Ao.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Ao.ZERO=Object.freeze(new Ao(0,0,0));Ao.prototype.clone=function(e){return Ao.clone(this,e)};Ao.prototype.equals=function(e){return Ao.equals(this,e)};Ao.prototype.equalsEpsilon=function(e,t){return Ao.equalsEpsilon(this,e,t)};Ao.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Ao;var NRt=T(S(),1);function Aq(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function gi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Aq(this,e,t,n)}Object.defineProperties(gi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});gi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new gi(n.x,n.y,n.z)};gi.fromCartesian3=function(e,t){return l(t)||(t=new gi),l(e)&&Aq(t,e.x,e.y,e.z),t};gi.WGS84=Object.freeze(new gi(6378137,6378137,6356752314245179e-9));gi.UNIT_SPHERE=Object.freeze(new gi(1,1,1));gi.MOON=Object.freeze(new gi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));gi._default=gi.WGS84;Object.defineProperties(gi,{default:{get:function(){return gi._default},set:function(e){gi._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});gi.prototype.clone=function(e){return gi.clone(this,e)};gi.packedLength=m.packedLength;gi.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};gi.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return gi.fromCartesian3(i,n)};gi.prototype.geocentricSurfaceNormal=m.normalize;gi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};gi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,W.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var nVe=new m,iVe=new m;gi.prototype.cartographicToCartesian=function(e,t){let n=nVe,i=iVe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};gi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var oVe=new m,rVe=new m,sVe=new m;gi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,rVe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,oVe),o=m.subtract(e,n,sVe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=W.sign(m.dot(o,e))*m.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};gi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};gi.prototype.scaleToGeodeticSurface=function(e,t){return nx(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};gi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new m);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return m.multiplyByScalar(e,s,t)};gi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};gi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};gi.prototype.equals=function(e){return this===e||l(e)&&m.equals(this._radii,e._radii)};gi.prototype.toString=function(){return this._radii.toString()};gi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var aVe=new m;gi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,aVe),i=m.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return D.fromElements(1/i,1/r,t)};var cVe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],lVe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Fq(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*cVe[s];r+=lVe[s]*(n(i+a)+n(i-a))}return r*=o,r}gi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=W.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return Fq(i,o,function(u){let h=Math.cos(u),p=Math.sin(u);return Math.cos(u)*Fq(t,n,function(g){let f=Math.cos(g),x=Math.sin(g);return Math.sqrt(d*p*p+c*(a*f*f+s*x*x)*h*h)})})};var ne=gi;var HRt=T(S(),1);function pN(e){this._ellipsoid=y(e,ne.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(pN.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});pN.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};pN.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Ei=pN;var KRt=T(S(),1),dVe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Ht=Object.freeze(dVe);var wIt=T(S(),1);var LIt=T(S(),1);var GEt=T(S(),1);var QRt=T(S(),1);function uVe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Xo=uVe;var qRt=T(S(),1);function mVe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var v0=mVe;var SZt=T(S(),1);var sZt=T(S(),1);var eZt=T(S(),1);function hVe(e){return e%4===0&&e%100!==0||e%400===0}var Lm=hVe;var Mq=[31,28,31,30,31,30,31,31,30,31,30,31];function fVe(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){xo.typeOf.number.greaterThanOrEquals("Year",e,1),xo.typeOf.number.lessThanOrEquals("Year",e,9999),xo.typeOf.number.greaterThanOrEquals("Month",t,1),xo.typeOf.number.lessThanOrEquals("Month",t,12),xo.typeOf.number.greaterThanOrEquals("Day",n,1),xo.typeOf.number.lessThanOrEquals("Day",n,31),xo.typeOf.number.greaterThanOrEquals("Hour",i,0),xo.typeOf.number.lessThanOrEquals("Hour",i,23),xo.typeOf.number.greaterThanOrEquals("Minute",o,0),xo.typeOf.number.lessThanOrEquals("Minute",o,59),xo.typeOf.bool("IsLeapSecond",a),xo.typeOf.number.greaterThanOrEquals("Second",r,0),xo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),xo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),xo.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&Lm(e)?Mq[t-1]+1:Mq[t-1];if(n>C)throw new pe("Month and Day represents invalid date")}}var Sp=fVe;var cZt=T(S(),1);function pVe(e,t){this.julianDate=e,this.offset=t}var Yi=pVe;var dZt=T(S(),1),bVe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Kn=Object.freeze(bVe);var mZt=T(S(),1),gVe={UTC:0,TAI:1},zn=Object.freeze(gVe);var kq=new Sp,i3=[31,28,31,30,31,30,31,31,30,31,30,31],o3=29;function r3(e,t){return Wt.compare(e.julianDate,t.julianDate)}var DS=new Yi;function gN(e){DS.julianDate=e;let t=Wt.leapSeconds,n=Xo(t,DS,r3);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Wt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Wt.addSeconds(e,i,e)}function Nq(e,t){DS.julianDate=e;let n=Wt.leapSeconds,i=Xo(n,DS,r3);if(i<0&&(i=~i),i===0)return Wt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Wt.addSeconds(e,-n[i-1].offset,t);let o=Wt.secondsDifference(n[i].julianDate,e);if(o===0)return Wt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Wt.addSeconds(e,-n[--i].offset,t)}function w0(e,t,n){let i=t/Kn.SECONDS_PER_DAY|0;return e+=i,t-=Kn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Kn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function s3(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*Kn.SECONDS_PER_HOUR+o*Kn.SECONDS_PER_MINUTE+s*Kn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var yVe=/^(\d{4})$/,xVe=/^(\d{4})-(\d{2})$/,_Ve=/^(\d{4})-?(\d{3})$/,TVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,SVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,a3=/([Z+\-])?(\d{2})?:?(\d{2})?$/,CVe=/^(\d{2})(\.\d+)?/.source+a3.source,VVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+a3.source,LVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+a3.source;function Wt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,zn.UTC);let i=e|0;t=t+(e-i)*Kn.SECONDS_PER_DAY,w0(i,t,this),n===zn.UTC&&gN(this)}Wt.fromGregorianDate=function(e,t){let n=s3(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(w0(n[0],n[1],t),gN(t),t):new Wt(n[0],n[1],zn.UTC)};Wt.fromDate=function(e,t){let n=s3(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(w0(n[0],n[1],t),gN(t),t):new Wt(n[0],n[1],zn.UTC)};Wt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],h=n[1],p,g;if(n=u.match(SVe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(xVe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(yVe),n!==null)i=+n[1];else{let C;if(n=u.match(_Ve),n!==null)i=+n[1],C=+n[2],g=Lm(i);else if(n=u.match(TVe),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,R=new Date(Date.UTC(i,0,4));C=V*7+L-R.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Lm(i);let f;if(l(h)){n=h.match(LVe),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=h.match(VVe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=h.match(CVe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let C=n[f],V=+n[f+1],L=+(n[f+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?o3:i3[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?o3:i3[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?o3:i3[o-1],r+=p;let _=s3(i,o,r,s,a,c,d);return l(t)?(w0(_[0],_[1],t),gN(t)):t=new Wt(_[0],_[1],zn.UTC),x&&Wt.addSeconds(t,1,t),t};Wt.now=function(e){return Wt.fromDate(new Date,e)};var bN=new Wt(0,0,zn.TAI);Wt.toGregorianDate=function(e,t){let n=!1,i=Nq(e,bN);l(i)||(Wt.addSeconds(e,-1,bN),i=Nq(bN,bN),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let h=d+2-12*s|0,p=100*(a-49)+c+s|0,g=r/Kn.SECONDS_PER_HOUR|0,f=r-g*Kn.SECONDS_PER_HOUR,x=f/Kn.SECONDS_PER_MINUTE|0;f=f-x*Kn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/Kn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(_+=1),l(t)?(t.year=p,t.month=h,t.day=u,t.hour=g,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new Sp(p,h,u,g,x,_,C,n)};Wt.toDate=function(e){let t=Wt.toGregorianDate(e,kq),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Wt.toIso8601=function(e,t){let n=Wt.toGregorianDate(e,kq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;if(!l(t)&&d!==0){let h=d*.01;return u=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};Wt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Wt(e.dayNumber,e.secondsOfDay,zn.TAI)};Wt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Wt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Wt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Wt.secondsDifference(e,t))<=n};Wt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Kn.SECONDS_PER_DAY};Wt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Kn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Wt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Kn.SECONDS_PER_DAY;return n+i};Wt.computeTaiMinusUtc=function(e){DS.julianDate=e;let t=Wt.leapSeconds,n=Xo(t,DS,r3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Wt.addSeconds=function(e,t,n){return w0(e.dayNumber,e.secondsOfDay+t,n)};Wt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Kn.SECONDS_PER_MINUTE;return w0(e.dayNumber,i,n)};Wt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Kn.SECONDS_PER_HOUR;return w0(e.dayNumber,i,n)};Wt.addDays=function(e,t,n){let i=e.dayNumber+t;return w0(i,e.secondsOfDay,n)};Wt.lessThan=function(e,t){return Wt.compare(e,t)<0};Wt.lessThanOrEquals=function(e,t){return Wt.compare(e,t)<=0};Wt.greaterThan=function(e,t){return Wt.compare(e,t)>0};Wt.greaterThanOrEquals=function(e,t){return Wt.compare(e,t)>=0};Wt.prototype.clone=function(e){return Wt.clone(this,e)};Wt.prototype.equals=function(e){return Wt.equals(this,e)};Wt.prototype.equalsEpsilon=function(e,t){return Wt.equalsEpsilon(this,e,t)};Wt.prototype.toString=function(){return Wt.toIso8601(this)};Wt.leapSeconds=[new Yi(new Wt(2441317,43210,zn.TAI),10),new Yi(new Wt(2441499,43211,zn.TAI),11),new Yi(new Wt(2441683,43212,zn.TAI),12),new Yi(new Wt(2442048,43213,zn.TAI),13),new Yi(new Wt(2442413,43214,zn.TAI),14),new Yi(new Wt(2442778,43215,zn.TAI),15),new Yi(new Wt(2443144,43216,zn.TAI),16),new Yi(new Wt(2443509,43217,zn.TAI),17),new Yi(new Wt(2443874,43218,zn.TAI),18),new Yi(new Wt(2444239,43219,zn.TAI),19),new Yi(new Wt(2444786,43220,zn.TAI),20),new Yi(new Wt(2445151,43221,zn.TAI),21),new Yi(new Wt(2445516,43222,zn.TAI),22),new Yi(new Wt(2446247,43223,zn.TAI),23),new Yi(new Wt(2447161,43224,zn.TAI),24),new Yi(new Wt(2447892,43225,zn.TAI),25),new Yi(new Wt(2448257,43226,zn.TAI),26),new Yi(new Wt(2448804,43227,zn.TAI),27),new Yi(new Wt(2449169,43228,zn.TAI),28),new Yi(new Wt(2449534,43229,zn.TAI),29),new Yi(new Wt(2450083,43230,zn.TAI),30),new Yi(new Wt(2450630,43231,zn.TAI),31),new Yi(new Wt(2451179,43232,zn.TAI),32),new Yi(new Wt(2453736,43233,zn.TAI),33),new Yi(new Wt(2454832,43234,zn.TAI),34),new Yi(new Wt(2456109,43235,zn.TAI),35),new Yi(new Wt(2457204,43236,zn.TAI),36),new Yi(new Wt(2457754,43237,zn.TAI),37)];var q=Wt;var bEt=T(S(),1),r$=T(dd(),1);var GZt=T(S(),1);function RVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var JL=RVe;var XZt=T(S(),1);function zq(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=zq(o,t)),n[i]=o}return n}var Ye=zq;var wZt=T(S(),1);function Kq(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Kq(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var St=Kq;var AZt=T(S(),1);function ZVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Ll=ZVe;var UZt=T(S(),1),Jq=T(dd(),1);function c3(e,t){let n;return typeof document<"u"&&(n=document),c3._implementation(e,t,n)}c3._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new Jq.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var $h=c3;var BZt=T(S(),1),Qq=T(dd(),1);function GVe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Qq.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var QL=GVe;var YZt=T(S(),1),jq=T(dd(),1);function EVe(e){let t=new jq.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var ix=EVe;var KZt=T(S(),1);var qq={};function IVe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=qq[t];l(i)||(i={},qq[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Rm=IVe;var QZt=T(S(),1);var XVe=/^blob:/i;function WVe(e){return XVe.test(e)}var ox=WVe;var $Zt=T(S(),1);var ef;function PVe(e){l(ef)||(ef=document.createElement("a")),ef.href=window.location.href;let t=ef.host,n=ef.protocol;return ef.href=e,ef.href=ef.href,n!==ef.protocol||t!==ef.host}var F0=PVe;var tGt=T(S(),1);var vVe=/^data:/i;function wVe(e){return vVe.test(e)}var Cp=wVe;var iGt=T(S(),1);function FVe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var rx=FVe;var rGt=T(S(),1);function AVe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var sx=AVe;var cGt=T(S(),1);function MVe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var ud=MVe;var yGt=T(S(),1);var dGt=T(S(),1),NVe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},jn=Object.freeze(NVe);var mGt=T(S(),1),kVe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ds=Object.freeze(kVe);function TN(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ds.OTHER),this.serverKey=e.serverKey,this.state=jn.UNISSUED,this.deferred=void 0,this.cancelled=!1}TN.prototype.cancel=function(){this.cancelled=!0};TN.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=jn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new TN(this)};var Ho=TN;var VGt=T(S(),1);var _Gt=T(S(),1);function UVe(e){let t={};if(!e)return t;let n=e.split(`\r
`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var jL=UVe;function $q(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=jL(this.responseHeaders))}$q.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var tf=$q;var UGt=T(S(),1),SN=T(dd(),1);var ZGt=T(S(),1);function qL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(qL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});qL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};qL.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function DVe(e,t){return t-e}qL.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(DVe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var be=qL;var XGt=T(S(),1);function ax(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ax.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function l3(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ax.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};ax.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(l3(i,o,e),e=o):r=!1}};ax.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ax.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)l3(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};ax.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return l3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var $L=ax;function BVe(e,t){return e.priority-t.priority}var eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},YS=20,ec=new $L({comparator:BVe});ec.maximumLength=YS;ec.reserve(YS);var nf=[],Vp={},OVe=typeof document<"u"?new SN.default(document.location.href):new SN.default,CN=new be;function zo(){}zo.maximumRequests=50;zo.maximumRequestsPerServer=18;zo.requestsByServer={};zo.throttleRequests=!0;zo.debugShowStatistics=!1;zo.requestCompletedEvent=CN;Object.defineProperties(zo,{statistics:{get:function(){return eo}},priorityHeapLength:{get:function(){return YS},set:function(e){if(e<YS)for(;ec.length>e;){let t=ec.pop();cx(t)}YS=e,ec.maximumLength=e,ec.reserve(e)}}});function e$(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}zo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(zo.requestsByServer[e],zo.maximumRequestsPerServer);return Vp[e]+t<=n};zo.heapHasOpenSlots=function(e){return ec.length+e<=YS};function t$(e){return e.state===jn.UNISSUED&&(e.state=jn.ISSUED,e.deferred=Ll()),e.deferred.promise}function YVe(e){return function(t){if(e.state===jn.CANCELLED)return;let n=e.deferred;--eo.numberOfActiveRequests,--Vp[e.serverKey],CN.raiseEvent(),e.state=jn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function HVe(e){return function(t){e.state!==jn.CANCELLED&&(++eo.numberOfFailedRequests,--eo.numberOfActiveRequests,--Vp[e.serverKey],CN.raiseEvent(t),e.state=jn.FAILED,e.deferred.reject(t))}}function n$(e){let t=t$(e);return e.state=jn.ACTIVE,nf.push(e),++eo.numberOfActiveRequests,++eo.numberOfActiveRequestsEver,++Vp[e.serverKey],e.requestFunction().then(YVe(e)).catch(HVe(e)),t}function cx(e){let t=e.state===jn.ACTIVE;if(e.state=jn.CANCELLED,++eo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--eo.numberOfActiveRequests,--Vp[e.serverKey],++eo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}zo.update=function(){let e,t,n=0,i=nf.length;for(e=0;e<i;++e){if(t=nf[e],t.cancelled&&cx(t),t.state!==jn.ACTIVE){++n;continue}n>0&&(nf[e-n]=t)}nf.length-=n;let o=ec.internalArray,r=ec.length;for(e=0;e<r;++e)e$(o[e]);ec.resort();let s=Math.max(zo.maximumRequests-nf.length,0),a=0;for(;a<s&&ec.length>0;){if(t=ec.pop(),t.cancelled){cx(t);continue}if(t.throttleByServer&&!zo.serverHasOpenSlots(t.serverKey)){cx(t);continue}n$(t),++a}zVe()};zo.getServerKey=function(e){let t=new SN.default(e);t.scheme()===""&&(t=t.absoluteTo(OVe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Vp[n];return l(i)||(Vp[n]=0),n};zo.request=function(e){if(Cp(e.url)||ox(e.url))return CN.raiseEvent(),e.state=jn.RECEIVED,e.requestFunction();if(++eo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=zo.getServerKey(e.url)),zo.throttleRequests&&e.throttleByServer&&!zo.serverHasOpenSlots(e.serverKey))return;if(!zo.throttleRequests||!e.throttle)return n$(e);if(nf.length>=zo.maximumRequests)return;e$(e);let t=ec.insert(e);if(l(t)){if(t===e)return;cx(t)}return t$(e)};function zVe(){zo.debugShowStatistics&&(eo.numberOfActiveRequests===0&&eo.lastNumberOfActiveRequests>0&&(eo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${eo.numberOfAttemptedRequests}`),eo.numberOfAttemptedRequests=0),eo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${eo.numberOfCancelledRequests}`),eo.numberOfCancelledRequests=0),eo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${eo.numberOfCancelledActiveRequests}`),eo.numberOfCancelledActiveRequests=0),eo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${eo.numberOfFailedRequests}`),eo.numberOfFailedRequests=0)),eo.lastNumberOfActiveRequests=eo.numberOfActiveRequests)}zo.clearForSpecs=function(){for(;ec.length>0;){let t=ec.pop();cx(t)}let e=nf.length;for(let t=0;t<e;++t)cx(nf[t]);nf.length=0,Vp={},eo.numberOfAttemptedRequests=0,eo.numberOfActiveRequests=0,eo.numberOfCancelledRequests=0,eo.numberOfCancelledActiveRequests=0,eo.numberOfFailedRequests=0,eo.numberOfActiveRequestsEver=0,eo.lastNumberOfActiveRequests=0};zo.numberOfActiveRequestsByServer=function(e){return Vp[e]};zo.requestHeap=ec;var tc=zo;var OGt=T(S(),1),i$=T(dd(),1);var eR={},HS={};eR.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(HS[n])||(HS[n]=!0)};eR.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(HS[n])&&delete HS[n]};function KVe(e){let t=new i$.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}eR.contains=function(e){let t=KVe(e);return!!(l(t)&&l(HS[t]))};eR.clear=function(){HS={}};var zS=eR;var s$=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Xt(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=of(e.templateValues,{}),this._queryParameters=of(e.queryParameters,{}),this.headers=of(e.headers,{}),this.request=y(e.request,new Ho),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function of(e,t){return l(e)?Ye(e):t}Xt.createIfNeeded=function(e){return e instanceof Xt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Xt({url:e})};var KS;Xt.supportsImageBitmapOptions=function(){return l(KS)?KS:typeof createImageBitmap!="function"?(KS=Promise.resolve(!1),KS):(KS=Xt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Rm(t[0]),i=Rm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),KS)};Object.defineProperties(Xt,{isBlobSupported:{get:function(){return s$}}});Object.defineProperties(Xt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return ix(this._url)}},isDataUri:{get:function(){return Cp(this._url)}},isBlobUri:{get:function(){return ox(this._url)}},isCrossOriginUrl:{get:function(){return F0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Xt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Xt.prototype.parseUrl=function(e,t,n,i){let o=new r$.default(e),r=JVe(o.query());this._queryParameters=t?LN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo($h(i))),this._url=o.toString()};function JVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ud(e)}function LN(e,t,n){if(!n)return St(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Xt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${QVe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function QVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${sx(e)}`}Xt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=LN(this._queryParameters,e,!1):this._queryParameters=LN(e,this._queryParameters,!1)};Xt.prototype.appendQueryParameters=function(e){this._queryParameters=LN(e,this._queryParameters,!0)};Xt.prototype.setTemplateValues=function(e,t){t?this._templateValues=St(this._templateValues,e):this._templateValues=St(e,this._templateValues)};Xt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=St(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=St(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=St(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Xt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Xt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Xt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Xt.prototype.getBaseUri=function(e){return QL(this.getUrlComponent(e),e)};Xt.prototype.appendForwardSlash=function(){this._url=JL(this._url)};Xt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Xt.fetchArrayBuffer=function(e){return new Xt(e).fetchArrayBuffer()};Xt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Xt.fetchBlob=function(e){return new Xt(e).fetchBlob()};Xt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(u3(this.request),!s$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return d3({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Xt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Xt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(u);return c=new Xt({url:h}),d3({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function d3(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Ll();return Xt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=tc.request(r);if(l(s))return s.catch(function(a){return r.state!==jn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=jn.UNISSUED,r.deferred=void 0,d3({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Xt.fetchImage=function(e){return new Xt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Xt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Xt.fetchText=function(e){return new Xt(e).fetchText()};Xt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Xt.fetchJson=function(e){return new Xt(e).fetchJson()};Xt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Xt.fetchXML=function(e){return new Xt(e).fetchXML()};Xt.prototype.fetchJsonp=function(e){e=y(e,"callback"),u3(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return a$(this,e,t)};function a$(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Ll();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Xt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=tc.request(o);if(l(s))return s.catch(function(a){return o.state!==jn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=jn.UNISSUED,o.deferred=void 0,a$(e,t,n)):Promise.reject(a)})})}Xt.fetchJsonp=function(e){return new Xt(e).fetchJsonp(e.callbackParameterName)};Xt.prototype._makeRequest=function(e){let t=this;u3(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=St(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=Ll(),h=Xt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),u.promise};let o=tc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==jn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=jn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function u3(e){if(e.state===jn.ISSUED||e.state===jn.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=jn.UNISSUED,e.deferred=void 0}var jVe=/^data:(.*?)(;base64)?,(.*)$/;function VN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function o$(e,t){let n=VN(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function qVe(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return VN(i,o);case"arraybuffer":return o$(i,o);case"blob":return r=o$(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(VN(i,o),n);case"json":return JSON.parse(VN(i,o));default:}}Xt.prototype.fetch=function(e){return e=of(e,{}),e.method="GET",this._makeRequest(e)};Xt.fetch=function(e){return new Xt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Xt.prototype.delete=function(e){return e=of(e,{}),e.method="DELETE",this._makeRequest(e)};Xt.delete=function(e){return new Xt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Xt.prototype.head=function(e){return e=of(e,{}),e.method="HEAD",this._makeRequest(e)};Xt.head=function(e){return new Xt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Xt.prototype.options=function(e){return e=of(e,{}),e.method="OPTIONS",this._makeRequest(e)};Xt.options=function(e){return new Xt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Xt.prototype.post=function(e,t){return xo.defined("data",e),t=of(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Xt.post=function(e){return new Xt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Xt.prototype.put=function(e,t){return xo.defined("data",e),t=of(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Xt.put=function(e){return new Xt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Xt.prototype.patch=function(e,t){return xo.defined("data",e),t=of(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Xt.patch=function(e){return new Xt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Xt._Implementations={};Xt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(zS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Xt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Xt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Xt._Implementations.loadImageElement(s,t,n);return}let c="blob",d="GET",u=Ll(),h=Xt._Implementations.loadWithXhr(s,c,d,void 0,void 0,u,void 0,void 0,void 0);return l(h)&&l(h.abort)&&(e.cancelFunction=function(){h.abort()}),u.promise.then(function(p){if(!l(p)){n.reject(new ae(`Successfully retrieved ${s} but it contained no content.`));return}return Xt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Xt.createImageBitmapFromBlob=function(e,t){return xo.defined("options",t),xo.typeOf.bool("options.flipY",t.flipY),xo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),xo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function $Ve(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new tf(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new tf)})}var eLe=typeof XMLHttpRequest>"u";Xt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=jVe.exec(e);if(a!==null){r.resolve(qVe(a,t));return}if(eLe){$Ve(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(zS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new tf(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.forEach(function(x){let _=x.split(": "),C=_.shift();f[C]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||h===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new tf)},c.send(i),c};Xt._Implementations.loadAndExecuteScript=function(e,t,n){return rx(e,t).catch(function(i){n.reject(i)})};Xt._DefaultImplementations={};Xt._DefaultImplementations.createImage=Xt._Implementations.createImage;Xt._DefaultImplementations.loadWithXhr=Xt._Implementations.loadWithXhr;Xt._DefaultImplementations.loadAndExecuteScript=Xt._Implementations.loadAndExecuteScript;Xt.DEFAULT=Object.freeze(new Xt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ze=Xt;function nR(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?c$(this,e.data):c$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}nR.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new nR({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};nR.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new v0(0,0,0,0,0),t}});nR.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new v0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=q.lessThanOrEquals(a,e),u=!l(c),h=u||q.greaterThanOrEquals(c,e);if(d&&h)return o=i,!u&&c.equals(e)&&++o,r=o+1,d$(this,n,this._samples,e,o,r,t),t}let s=Xo(n,e,q.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,d$(this,n,this._samples,e,o,r,t),t};function tLe(e,t){return q.compare(e.julianDate,t)}function c$(e,t){if(!l(t.columnNames))throw new ae("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new ae("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new ae("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let g=0,f=d.length;g<f;g+=e._columnCount){let x=d[g+n],_=d[g+c],C=x+Kn.MODIFIED_JULIAN_DATE_DIFFERENCE,V=new q(C,_,zn.TAI);if(u.push(V),p){if(_!==h&&l(h)){let L=q.leapSeconds,R=Xo(L,V,tLe);if(R<0){let G=new Yi(V,_);L.splice(~R,0,G)}}h=_}}}function l$(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function tR(e,t,n){return t+e*(n-t)}function d$(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return l$(e,n,o,a,s),s;if(i.equals(d))return l$(e,n,r,a,s),s;let u=q.secondsDifference(i,c)/q.secondsDifference(d,c),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-g;if(x>.5||x<-.5){let _=n[h+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(d.equals(i)?g=f:f-=C-_)}return s.xPoleWander=tR(u,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=tR(u,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=tR(u,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=tR(u,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=tR(u,g,f),s}var iR=nR;var PEt=T(S(),1);function nc(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}nc.fromQuaternion=function(e,t){l(t)||(t=new nc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};nc.fromDegrees=function(e,t,n,i){return l(i)||(i=new nc),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};nc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new nc(e.heading,e.pitch,e.roll)};nc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};nc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};nc.prototype.clone=function(e){return nc.clone(this,e)};nc.prototype.equals=function(e){return nc.equals(this,e)};nc.prototype.equalsEpsilon=function(e,t,n){return nc.equalsEpsilon(this,e,t,n)};nc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ra=nc;var QEt=T(S(),1);var MEt=T(S(),1);var u$={};var m$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function nLe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=m$.exec(i);if(o!==null)return o[1]}}var RN;function h$(e){return typeof document>"u"?e:(l(RN)||(RN=document.createElement("a")),RN.href=e,RN.href)}var lx;function f$(){if(l(lx))return lx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(u$?.url)?e=$h(".",u$.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(jM.toUrl)?e=$h("..",dx("Core/buildModuleUrl.js")):e=nLe(),lx=new Ze({url:h$(e)}),lx.appendForwardSlash(),lx}function iLe(e){return h$(jM.toUrl(`../${e}`))}function p$(e){return f$().getDerivedResource({url:e}).url}var ZN;function dx(e){return l(ZN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(jM.toUrl)?ZN=iLe:ZN=p$),ZN(e)}dx._cesiumScriptRegex=m$;dx._buildModuleUrlFromBaseUrl=p$;dx._clearBaseResource=function(){lx=void 0};dx.setBaseUrl=function(e){lx=Ze.DEFAULT.getDerivedResource({url:e})};dx.getCesiumBaseUrl=f$;var nn=dx;var UEt=T(S(),1);function oLe(e,t,n){this.x=e,this.y=t,this.s=n}var ux=oLe;function f3(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Ze.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new q(this._sampleZeroJulianEphemerisDate,0,zn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var rLe=new q(0,0,zn.TAI);function m3(e,t,n){let i=rLe;return i.dayNumber=t,i.secondsOfDay=n,q.daysDifference(i,e._sampleZeroDateTT)}f3.prototype.preload=function(e,t,n,i){let o=m3(this,e,t),r=m3(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let h=c;h<=d;++h)u.push(h3(this,h));return Promise.all(u)};f3.prototype.computeXysRadians=function(e,t,n){let i=m3(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(h3(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(h3(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new ux(0,0,0);let u=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)h[x]=u-f[x];for(x=0;x<=r;++x){for(g[x]=1,_=0;_<=r;++_)_!==x&&(g[x]*=h[_]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*d[C++],n.y+=g[x]*d[C++],n.s+=g[x]*d[C]}return n};function h3(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ze({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return e._chunkDownloadsInProgress[t]=o,o}var oR=f3;var oIt=T(S(),1);function ot(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var rR=new m;ot.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);rR=m.normalize(e,rR);let r=rR.x*o,s=rR.y*o,a=rR.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new ot(r,s,a,c)};var sLe=[1,2,0],aLe=new Array(3);ot.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],d=e[$.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=sLe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=h[p],f=h[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let x=aLe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var b$=new ot,g$=new ot,p3=new ot,y$=new ot;ot.fromHeadingPitchRoll=function(e,t){return y$=ot.fromAxisAngle(m.UNIT_X,e.roll,b$),p3=ot.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ot.multiply(p3,y$,p3),g$=ot.fromAxisAngle(m.UNIT_Z,-e.heading,b$),ot.multiply(g$,t,t)};var GN=new m,b3=new m,Zm=new ot,x$=new ot,EN=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ot),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ot.packedInterpolationLength=3;ot.convertPackedArrayForInterpolation=function(e,t,n,i){ot.unpack(e,n*4,EN),ot.conjugate(EN,EN);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;ot.unpack(e,(t+o)*4,Zm),ot.multiply(Zm,EN,Zm),Zm.w<0&&ot.negate(Zm,Zm),ot.computeAxis(Zm,GN);let a=ot.computeAngle(Zm);l(i)||(i=[]),i[s]=GN.x*a,i[s+1]=GN.y*a,i[s+2]=GN.z*a}};ot.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new ot),m.fromArray(e,0,b3);let r=m.magnitude(b3);return ot.unpack(t,i*4,x$),r===0?ot.clone(ot.IDENTITY,Zm):ot.fromAxisAngle(b3,r,Zm),ot.multiply(Zm,x$,o)};ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new ot(e.x,e.y,e.z,e.w)};ot.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};ot.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};ot.magnitude=function(e){return Math.sqrt(ot.magnitudeSquared(e))};ot.normalize=function(e,t){let n=1/ot.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};ot.inverse=function(e,t){let n=ot.magnitudeSquared(e);return t=ot.conjugate(e,t),ot.multiplyByScalar(t,1/n,t)};ot.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};ot.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};ot.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};ot.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};ot.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,d=t.z,u=t.w,h=s*a+i*u+o*d-r*c,p=s*c-i*d+o*u+r*a,g=s*d+i*c-o*a+r*u,f=s*u-i*a-o*c-r*d;return n.x=h,n.y=p,n.z=g,n.w=f,n};ot.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};ot.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};ot.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<W.EPSILON6||Math.abs(n+1)<W.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};ot.computeAngle=function(e){return Math.abs(e.w-1)<W.EPSILON6?0:2*Math.acos(e.w)};var g3=new ot;ot.lerp=function(e,t,n,i){return g3=ot.multiplyByScalar(t,n,g3),i=ot.multiplyByScalar(e,1-n,i),ot.add(g3,i,i)};var _$=new ot,y3=new ot,x3=new ot;ot.slerp=function(e,t,n,i){let o=ot.dot(e,t),r=t;if(o<0&&(o=-o,r=_$=ot.negate(t,_$)),1-o<W.EPSILON6)return ot.lerp(e,r,n,i);let s=Math.acos(o);return y3=ot.multiplyByScalar(e,Math.sin((1-n)*s),y3),x3=ot.multiplyByScalar(r,Math.sin(n*s),x3),i=ot.add(y3,x3,i),ot.multiplyByScalar(i,1/Math.sin(s),i)};ot.log=function(e,t){let n=W.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};ot.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var cLe=new m,lLe=new m,sR=new ot,JS=new ot;ot.computeInnerQuadrangle=function(e,t,n,i){let o=ot.conjugate(t,sR);ot.multiply(o,n,JS);let r=ot.log(JS,cLe);ot.multiply(o,e,JS);let s=ot.log(JS,lLe);return m.add(r,s,r),m.multiplyByScalar(r,.25,r),m.negate(r,r),ot.exp(r,sR),ot.multiply(t,sR,i)};ot.squad=function(e,t,n,i,o,r){let s=ot.slerp(e,t,o,sR),a=ot.slerp(n,i,o,JS);return ot.slerp(s,a,2*o*(1-o),r)};var dLe=new ot,T$=1.9011074535173003,IN=Bt.supportsTypedArrays()?new Float32Array(8):[],XN=Bt.supportsTypedArrays()?new Float32Array(8):[],Lp=Bt.supportsTypedArrays()?new Float32Array(8):[],Rp=Bt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;IN[e]=1/(t*n),XN[e]=t/n}IN[7]=T$/(8*17);XN[7]=T$*8/17;ot.fastSlerp=function(e,t,n,i){let o=ot.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let g=7;g>=0;--g)Lp[g]=(IN[g]*c-XN[g])*s,Rp[g]=(IN[g]*d-XN[g])*s;let u=r*n*(1+Lp[0]*(1+Lp[1]*(1+Lp[2]*(1+Lp[3]*(1+Lp[4]*(1+Lp[5]*(1+Lp[6]*(1+Lp[7])))))))),h=a*(1+Rp[0]*(1+Rp[1]*(1+Rp[2]*(1+Rp[3]*(1+Rp[4]*(1+Rp[5]*(1+Rp[6]*(1+Rp[7])))))))),p=ot.multiplyByScalar(e,h,dLe);return ot.multiplyByScalar(t,u,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){let s=ot.fastSlerp(e,t,o,sR),a=ot.fastSlerp(n,i,o,JS);return ot.fastSlerp(s,a,2*o*(1-o),r)};ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ot.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ot.ZERO=Object.freeze(new ot(0,0,0,0));ot.IDENTITY=Object.freeze(new ot(0,0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var ve=ot;var ui={},_3={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},QS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},T3={},Rl={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},A0=new m,M0=new m,N0=new m;ui.localFrameToFixedFrameGenerator=function(e,t){if(!_3.hasOwnProperty(e)||!_3[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=_3[e][t],i,o=e+t;return l(T3[o])?i=T3[o]:(i=function(r,s,a){if(l(a)||(a=new A),m.equalsEpsilon(r,m.ZERO,W.EPSILON14))m.unpack(QS[e],0,A0),m.unpack(QS[t],0,M0),m.unpack(QS[n],0,N0);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);m.unpack(QS[e],0,A0),e!=="east"&&e!=="west"&&m.multiplyByScalar(A0,c,A0),m.unpack(QS[t],0,M0),t!=="east"&&t!=="west"&&m.multiplyByScalar(M0,c,M0),m.unpack(QS[n],0,N0),n!=="east"&&n!=="west"&&m.multiplyByScalar(N0,c,N0)}else{s=y(s,ne.default),s.geodeticSurfaceNormal(r,Rl.up);let c=Rl.up,d=Rl.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,Rl.east),m.cross(c,d,Rl.north),m.multiplyByScalar(Rl.up,-1,Rl.down),m.multiplyByScalar(Rl.east,-1,Rl.west),m.multiplyByScalar(Rl.north,-1,Rl.south),A0=Rl[e],M0=Rl[t],N0=Rl[n]}return a[0]=A0.x,a[1]=A0.y,a[2]=A0.z,a[3]=0,a[4]=M0.x,a[5]=M0.y,a[6]=M0.z,a[7]=0,a[8]=N0.x,a[9]=N0.y,a[10]=N0.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},T3[o]=i),i};ui.eastNorthUpToFixedFrame=ui.localFrameToFixedFrameGenerator("east","north");ui.northEastDownToFixedFrame=ui.localFrameToFixedFrameGenerator("north","east");ui.northUpEastToFixedFrame=ui.localFrameToFixedFrameGenerator("north","up");ui.northWestUpToFixedFrame=ui.localFrameToFixedFrameGenerator("north","west");var uLe=new ve,mLe=new m(1,1,1),hLe=new A;ui.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ui.eastNorthUpToFixedFrame);let r=ve.fromHeadingPitchRoll(t,uLe),s=A.fromTranslationQuaternionRotationScale(m.ZERO,r,mLe,hLe);return o=i(e,n,o),A.multiply(o,s,o)};var fLe=new A,pLe=new $;ui.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ui.headingPitchRollToFixedFrame(e,t,n,i,fLe),s=A.getMatrix3(r,pLe);return ve.fromRotationMatrix(s,o)};var bLe=new m(1,1,1),gLe=new m,S$=new A,yLe=new A,xLe=new $,_Le=new ve;ui.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ne.default),n=y(n,ui.eastNorthUpToFixedFrame),l(i)||(i=new Ra);let o=A.getTranslation(e,gLe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=A.inverseTransformation(n(o,t,S$),S$),s=A.setScale(e,bLe,yLe);s=A.setTranslation(s,m.ZERO,s),r=A.multiply(r,s,r);let a=ve.fromRotationMatrix(A.getMatrix3(r,xLe),_Le);return a=ve.normalize(a,a),Ra.fromQuaternion(a,i)};var TLe=6*3600+41*60+50.54841,SLe=8640184812866e-6,CLe=.093104,VLe=-62e-7,LLe=11772758384668e-32,RLe=72921158553e-15,ZLe=W.TWO_PI/86400,WN=new q;ui.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ui.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ui.computeTemeToPseudoFixedMatrix(e,t)),n};ui.computeTemeToPseudoFixedMatrix=function(e,t){WN=q.addSeconds(e,-q.computeTaiMinusUtc(e),WN);let n=WN.dayNumber,i=WN.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Kn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Kn.DAYS_PER_JULIAN_CENTURY;let a=(TLe+o*(SLe+o*(CLe+o*VLe)))*ZLe%W.TWO_PI,c=RLe+LLe*(n-24515455e-1),d=(i+Kn.SECONDS_PER_DAY*.5)%Kn.SECONDS_PER_DAY,u=a+c*d,h=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};ui.iau2006XysData=new oR;ui.earthOrientationParameters=iR.NONE;var V3=32.184,GLe=2451545;ui.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+V3,i=e.stop.dayNumber,o=e.stop.secondsOfDay+V3;return ui.iau2006XysData.preload(t,n,i,o)};ui.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var ELe=32.184,ILe=2451545,PN=new Ra,XLe=new $,WLe=new q;ui.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=q.addSeconds(e,ELe,WLe),i=q.totalDays(n)-ILe,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return PN.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),PN.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),PN.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(PN,XLe)};ui.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var PLe=new ux(0,0,0),vLe=new v0(0,0,0,0,0,0),S3=new $,C3=new $;ui.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ui.earthOrientationParameters.compute(e,vLe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+V3,r=ui.iau2006XysData.computeXysRadians(i,o,PLe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=S3;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,C3),h=$.multiply(d,u,S3),p=e.dayNumber,g=e.secondsOfDay-q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=g/Kn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=$.fromRotationZ(_,C3),V=$.multiply(h,C,S3),L=Math.cos(n.xPoleWander),R=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),v=i-GLe+o/Kn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*W.RADIANS_PER_DEGREE/3600,w=Math.cos(P),M=Math.sin(P),b=C3;return b[0]=L*w,b[1]=L*M,b[2]=G,b[3]=-R*M+I*G*w,b[4]=R*w+I*G*M,b[5]=-I*L,b[6]=-I*M-R*G*w,b[7]=I*w-R*G*M,b[8]=R*L,$.multiply(V,b,t)};var wLe=new se;ui.pointToWindowCoordinates=function(e,t,n,i){return i=ui.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ui.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new D);let o=wLe;return A.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),A.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var FLe=new m,ALe=new m,MLe=new m;ui.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ne.default).geodeticSurfaceNormal(e,FLe),r=m.cross(t,o,ALe);m.equalsEpsilon(r,m.ZERO,W.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,MLe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var C$=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),V$=new he,L3=new m,NLe=new m,kLe=new $,R3=new A,L$=new A;ui.basisTo2D=function(e,t,n){let i=A.getTranslation(t,NLe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,L3);else{let u=o.cartesianToCartographic(i,V$);r=e.project(u,L3),m.fromElements(r.z,r.x,r.y,r)}let s=ui.eastNorthUpToFixedFrame(i,o,R3),a=A.inverseTransformation(s,L$),c=A.getMatrix3(t,kLe),d=A.multiplyByMatrix3(a,c,n);return A.multiply(C$,d,n),A.setTranslation(n,r,n),n};ui.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ui.eastNorthUpToFixedFrame(t,i,R3),r=A.inverseTransformation(o,L$),s=i.cartesianToCartographic(t,V$),a=e.project(s,L3);m.fromElements(a.z,a.x,a.y,a);let c=A.fromTranslation(a,R3);return A.multiply(C$,r,n),A.multiply(c,n,n),n};var Pt=ui;function En(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(En.prototype,{width:{get:function(){return En.computeWidth(this)}},height:{get:function(){return En.computeHeight(this)}}});En.packedLength=4;En.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};En.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new En),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};En.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=W.TWO_PI),t-n};En.computeHeight=function(e){return e.north-e.south};En.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(y(e,0)),t=W.toRadians(y(t,0)),n=W.toRadians(y(n,0)),i=W.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new En(e,t,n,i)};En.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new En(e,t,n,i)};En.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=e.length;c<d;c++){let u=e[c];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let h=u.longitude>=0?u.longitude:u.longitude+W.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>W.PI&&(i=i-W.TWO_PI),n>W.PI&&(n=n-W.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new En(n,s,i,a)};En.fromCartesianArray=function(e,t,n){t=y(t,ne.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d<u;d++){let h=t.cartesianToCartographic(e[d]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new En(i,a,o,c)};var ULe=new m,DLe=new m,BLe=new m,OLe=new m,YLe=new m,Z3=new Array(5);for(let e=0;e<Z3.length;++e)Z3[e]=new m;En.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ne.default),l(n)||(n=new En),m.equals(i,m.ZERO))return En.clone(En.MAX_VALUE,n),n;let r=Pt.eastNorthUpToFixedFrame(i,t,ULe),s=A.multiplyByPointAsVector(r,m.UNIT_X,DLe);m.normalize(s,s);let a=A.multiplyByPointAsVector(r,m.UNIT_Y,BLe);m.normalize(a,a),m.multiplyByScalar(a,o,a),m.multiplyByScalar(s,o,s);let c=m.negate(a,YLe),d=m.negate(s,OLe),u=Z3,h=u[0];return m.add(i,a,h),h=u[1],m.add(i,d,h),h=u[2],m.add(i,c,h),h=u[3],m.add(i,s,h),u[4]=i,En.fromCartesianArray(u,t,n)};En.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new En(e.west,e.south,e.east,e.north)};En.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};En.prototype.clone=function(e){return En.clone(this,e)};En.prototype.equals=function(e){return En.equals(this,e)};En.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};En.prototype.equalsEpsilon=function(e,t){return En.equalsEpsilon(this,e,t)};En._validate=function(e){};En.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};En.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};En.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};En.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};En.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=W.TWO_PI);let o=W.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};En.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.max(o,s)),c=W.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let d=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(d>=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new En(a,d,c,u)};En.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new En(i,o,r,s)};En.union=function(e,t,n){l(n)||(n=new En);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.min(o,s)),c=W.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};En.expand=function(e,t,n){return l(n)||(n=new En),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};En.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=W.TWO_PI,n<0&&(n+=W.TWO_PI)),(n>o||W.equalsEpsilon(n,o,W.EPSILON14))&&(n<r||W.equalsEpsilon(n,r,W.EPSILON14))&&i>=e.south&&i<=e.north};var HLe=new he;En.subsample=function(e,t,n,i){t=y(t,ne.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=HLe;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*W.PI_OVER_TWO,En.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};En.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new En),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=W.TWO_PI+e.east-e.west;r.west=W.negativePiToPi(e.west+t*a),r.east=W.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};En.MAX_VALUE=Object.freeze(new En(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var ce=En;function Xr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Xr.packedLength=4;Xr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Xr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Xr.fromPoints=function(e,t){if(l(t)||(t=new Xr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],d=c.x,u=c.y;i=Math.min(d,i),r=Math.max(d,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var R$=new Ei,zLe=new he,KLe=new he;Xr.fromRectangle=function(e,t,n){if(l(n)||(n=new Xr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;R$._ellipsoid=ne.default,t=y(t,R$);let i=t.project(ce.southwest(e,zLe)),o=t.project(ce.northeast(e,KLe));return D.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Xr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Xr(e.x,e.y,e.width,e.height)};Xr.union=function(e,t,n){l(n)||(n=new Xr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};Xr.expand=function(e,t,n){n=Xr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Xr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Ht.OUTSIDE:Ht.INTERSECTING};Xr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Xr.prototype.clone=function(e){return Xr.clone(this,e)};Xr.prototype.intersect=function(e){return Xr.intersect(this,e)};Xr.prototype.equals=function(e){return Xr.equals(this,e)};var Ke=Xr;var KIt=T(S(),1);var Za={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};Za.isLines=function(e){return e===Za.LINES||e===Za.LINE_LOOP||e===Za.LINE_STRIP};Za.isTriangles=function(e){return e===Za.TRIANGLES||e===Za.TRIANGLE_STRIP||e===Za.TRIANGLE_FAN};Za.validate=function(e){return e===Za.POINTS||e===Za.LINES||e===Za.LINE_LOOP||e===Za.LINE_STRIP||e===Za.TRIANGLES||e===Za.TRIANGLE_STRIP||e===Za.TRIANGLE_FAN};var we=Object.freeze(Za);var QIt=T(S(),1),mx=`in vec4 position;
in vec2 textureCoordinates;

out vec2 v_textureCoordinates;

void main() 
{
    gl_Position = position;
    v_textureCoordinates = textureCoordinates;
}
`;var tXt=T(S(),1);var gr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function aR(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,we.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function ic(e,t){return(e._flags&t)===t}function k0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(aR.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return ic(this,gr.CULL)},set:function(e){ic(this,gr.CULL)!==e&&(k0(this,gr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return ic(this,gr.OCCLUDE)},set:function(e){ic(this,gr.OCCLUDE)!==e&&(k0(this,gr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return ic(this,gr.CAST_SHADOWS)},set:function(e){ic(this,gr.CAST_SHADOWS)!==e&&(k0(this,gr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return ic(this,gr.RECEIVE_SHADOWS)},set:function(e){ic(this,gr.RECEIVE_SHADOWS)!==e&&(k0(this,gr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return ic(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){ic(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(k0(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return ic(this,gr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){ic(this,gr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(k0(this,gr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return ic(this,gr.PICK_ONLY)},set:function(e){ic(this,gr.PICK_ONLY)!==e&&(k0(this,gr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return ic(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){ic(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(k0(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});aR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new aR),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};aR.prototype.execute=function(e,t){e.draw(this,t)};var $e=aR;var bXt=T(S(),1);var cXt=T(S(),1);var oXt=T(S(),1);var mi={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};mi.toWebGLConstant=function(e,t){switch(e){case mi.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case mi.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case mi.UNSIGNED_INT:return ie.UNSIGNED_INT;case mi.FLOAT:return ie.FLOAT;case mi.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case mi.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case mi.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case mi.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case mi.UNSIGNED_SHORT_5_6_5:return mi.UNSIGNED_SHORT_5_6_5}};mi.isPacked=function(e){return e===mi.UNSIGNED_INT_24_8||e===mi.UNSIGNED_SHORT_4_4_4_4||e===mi.UNSIGNED_SHORT_5_5_5_1||e===mi.UNSIGNED_SHORT_5_6_5};mi.sizeInBytes=function(e){switch(e){case mi.UNSIGNED_BYTE:return 1;case mi.UNSIGNED_SHORT:case mi.UNSIGNED_SHORT_4_4_4_4:case mi.UNSIGNED_SHORT_5_5_5_1:case mi.UNSIGNED_SHORT_5_6_5:case mi.HALF_FLOAT:return 2;case mi.UNSIGNED_INT:case mi.FLOAT:case mi.UNSIGNED_INT_24_8:return 4}};mi.validate=function(e){return e===mi.UNSIGNED_BYTE||e===mi.UNSIGNED_SHORT||e===mi.UNSIGNED_INT||e===mi.FLOAT||e===mi.HALF_FLOAT||e===mi.UNSIGNED_INT_24_8||e===mi.UNSIGNED_SHORT_4_4_4_4||e===mi.UNSIGNED_SHORT_5_5_5_1||e===mi.UNSIGNED_SHORT_5_6_5};mi.getTypedArrayConstructor=function(e){let t=mi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===mi.FLOAT?Float32Array:Uint32Array};var je=Object.freeze(mi);var st={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isColorFormat=function(e){return e===st.RED||e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let o=st.componentsLength(e);return je.isPacked(t)&&(o=1),o*je.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let o=je.getTypedArrayConstructor(t),r=st.componentsLength(e)*n*i;return new o(r)};st.flipY=function(e,t,n,i,o){if(o===1)return e;let r=st.createTypedArray(t,n,i,o),s=st.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let d=c*i*s,u=(o-c-1)*i*s;for(let h=0;h<a;++h)r[u+h]=e[d+h]}return r};st.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===st.DEPTH_STENCIL)return ie.DEPTH24_STENCIL8;if(e===st.DEPTH_COMPONENT){if(t===je.UNSIGNED_SHORT)return ie.DEPTH_COMPONENT16;if(t===je.UNSIGNED_INT)return ie.DEPTH_COMPONENT24}if(t===je.FLOAT)switch(e){case st.RGBA:return ie.RGBA32F;case st.RGB:return ie.RGB32F;case st.RG:return ie.RG32F;case st.RED:return ie.R32F}if(t===je.HALF_FLOAT)switch(e){case st.RGBA:return ie.RGBA16F;case st.RGB:return ie.RGB16F;case st.RG:return ie.RG16F;case st.RED:return ie.R16F}return e};var it=Object.freeze(st);var dXt=T(S(),1),yr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(yr,{maximumCombinedTextureImageUnits:{get:function(){return yr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return yr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return yr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return yr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return yr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return yr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return yr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return yr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return yr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return yr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return yr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return yr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return yr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return yr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return yr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return yr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return yr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return yr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return yr._maximumColorAttachments}},maximumSamples:{get:function(){return yr._maximumSamples}},highpFloatSupported:{get:function(){return yr._highpFloatSupported}},highpIntSupported:{get:function(){return yr._highpIntSupported}}});var At=yr;function G3(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function vN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Gm(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=At.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0),this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;G3(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;vN(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;G3(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;vN(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;vN(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;G3(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;vN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(Gm.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Gm.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Gm.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Gm.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Gm.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Gm.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Gm.prototype.getColorTexture=function(e){return this._colorTextures[e]};Gm.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Gm.prototype.isDestroyed=function(){return!1};Gm.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),me(this)};var Wr=Gm;var EXt=T(S(),1);var xXt=T(S(),1);var wN={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};wN.validate=function(e){return e===wN.CLOCKWISE||e===wN.COUNTER_CLOCKWISE};var us=Object.freeze(wN);var TXt=T(S(),1);function Z$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Z$(e[t]));return Object.freeze(e)}var E3=Z$;function sf(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),d=y(t.blending,y.EMPTY_OBJECT),u=y(d.color,y.EMPTY_OBJECT),h=y(t.stencilTest,y.EMPTY_OBJECT),p=y(h.frontOperation,y.EMPTY_OBJECT),g=y(h.backOperation,y.EMPTY_OBJECT),f=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,us.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,ie.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:Ke.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,ie.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(d.enabled,!1),color:new B(y(u.red,0),y(u.green,0),y(u.blue,0),y(u.alpha,0)),equationRgb:y(d.equationRgb,ie.FUNC_ADD),equationAlpha:y(d.equationAlpha,ie.FUNC_ADD),functionSourceRgb:y(d.functionSourceRgb,ie.ONE),functionSourceAlpha:y(d.functionSourceAlpha,ie.ONE),functionDestinationRgb:y(d.functionDestinationRgb,ie.ZERO),functionDestinationAlpha:y(d.functionDestinationAlpha,ie.ZERO)},this.stencilTest={enabled:y(h.enabled,!1),frontFunction:y(h.frontFunction,ie.ALWAYS),backFunction:y(h.backFunction,ie.ALWAYS),reference:y(h.reference,0),mask:y(h.mask,-1),frontOperation:{fail:y(p.fail,ie.KEEP),zFail:y(p.zFail,ie.KEEP),zPass:y(p.zPass,ie.KEEP)},backOperation:{fail:y(g.fail,ie.KEEP),zFail:y(g.zFail,ie.KEEP),zPass:y(g.zPass,ie.KEEP)}},this.sampleCoverage={enabled:y(f.enabled,!1),value:y(f.value,1),invert:y(f.invert,!1)},this.viewport=l(x)?new Ke(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var JLe=0,rf={};sf.fromCache=function(e){let t=JSON.stringify(e),n=rf[t];if(l(n))return++n.referenceCount,n.state;let i=new sf(e),o=JSON.stringify(i);return n=rf[o],l(n)||(i.id=JLe++,n={referenceCount:0,state:i},rf[o]=n),++n.referenceCount,rf[t]={referenceCount:1,state:n.state},n.state};sf.removeFromCache=function(e){let t=new sf(e),n=JSON.stringify(t),i=rf[n],o=JSON.stringify(e),r=rf[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete rf[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete rf[n]};sf.getCache=function(){return rf};sf.clearCache=function(){rf={}};function hx(e,t,n){n?e.enable(t):e.disable(t)}function G$(e,t){e.frontFace(t.frontFace)}function E$(e,t){let n=t.cull,i=n.enabled;hx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function I$(e,t){e.lineWidth(t.lineWidth)}function X$(e,t){let n=t.polygonOffset,i=n.enabled;hx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function W$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(hx(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function P$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function v$(e,t){let n=t.depthTest,i=n.enabled;hx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function w$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function F$(e,t){e.depthMask(t.depthMask)}function A$(e,t){e.stencilMask(t.stencilMask)}function QLe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function M$(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;hx(e,e.BLEND,o),o&&(QLe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function N$(e,t){let n=t.stencilTest,i=n.enabled;if(hx(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,d=c.fail,u=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,d,u,h);let p=n.backOperation,g=p.fail,f=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,f,x)}}function k$(e,t){let n=t.sampleCoverage,i=n.enabled;hx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var jLe=new Ke;function U$(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=jLe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}sf.apply=function(e,t,n){G$(e,t),E$(e,t),I$(e,t),X$(e,t),P$(e,t),v$(e,t),w$(e,t),F$(e,t),A$(e,t),N$(e,t),k$(e,t),W$(e,t,n),M$(e,t,n),U$(e,t,n)};function qLe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(G$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(E$),e.lineWidth!==t.lineWidth&&n.push(I$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(X$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(P$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(v$),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(w$),e.depthMask!==t.depthMask&&n.push(F$),e.stencilMask!==t.stencilMask&&n.push(A$),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(N$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(k$),n}sf.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];l(u)||(u=qLe(t,n),n._applyFunctions[t.id]=u);let h=u.length;for(let p=0;p<h;++p)u[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&W$(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,d=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==d||d&&t.blending!==n.blending)&&M$(e,n,o),(t!==n||i!==o||i.context!==o.context)&&U$(e,n,o)};sf.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ke.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:B.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Ke.clone(e.viewport):void 0}};var Ue=sf;var mWt=T(S(),1);var YXt=T(S(),1);var vXt=T(S(),1);function Jt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Jt.packedLength=4;Jt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Jt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Jt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Jt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Jt.pack(e[o],t,o*4);return t};Jt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Jt.unpack(e,i,t[o])}return t};Jt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Jt(e[0],e[2],e[1],e[3])};Jt.fromArray=Jt.unpack;Jt.fromColumnMajorArray=function(e,t){return Jt.clone(e,t)};Jt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Jt(e[0],e[1],e[2],e[3])};Jt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Jt(e.x,0,0,e.y)};Jt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Jt(e,0,0,e)};Jt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Jt(n,-i,i,n)};Jt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Jt.getElementIndex=function(e,t){return e*2+t};Jt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Jt.setColumn=function(e,t,n,i){i=Jt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Jt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Jt.setRow=function(e,t,n,i){return i=Jt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var $Le=new D;Jt.setScale=function(e,t,n){let i=Jt.getScale(e,$Le),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var eRe=new D;Jt.setUniformScale=function(e,t,n){let i=Jt.getScale(e,eRe),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var D$=new D;Jt.getScale=function(e,t){return t.x=D.magnitude(D.fromElements(e[0],e[1],D$)),t.y=D.magnitude(D.fromElements(e[2],e[3],D$)),t};var B$=new D;Jt.getMaximumScale=function(e){return Jt.getScale(e,B$),D.maximumComponent(B$)};var tRe=new D;Jt.setRotation=function(e,t,n){let i=Jt.getScale(e,tRe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var nRe=new D;Jt.getRotation=function(e,t){let n=Jt.getScale(e,nRe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Jt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Jt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Jt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Jt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Jt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Jt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Jt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Jt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Jt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Jt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Jt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Jt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Jt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Jt.IDENTITY=Object.freeze(new Jt(1,0,0,1));Jt.ZERO=Object.freeze(new Jt(0,0,0,0));Jt.COLUMN0ROW0=0;Jt.COLUMN0ROW1=1;Jt.COLUMN1ROW0=2;Jt.COLUMN1ROW1=3;Object.defineProperties(Jt.prototype,{length:{get:function(){return Jt.packedLength}}});Jt.prototype.clone=function(e){return Jt.clone(this,e)};Jt.prototype.equals=function(e){return Jt.equals(this,e)};Jt.prototype.equalsEpsilon=function(e,t){return Jt.equalsEpsilon(this,e,t)};Jt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var Ii=Jt;function iRe(e,t,n,i){switch(t.type){case e.FLOAT:return new O$(e,t,n,i);case e.FLOAT_VEC2:return new Y$(e,t,n,i);case e.FLOAT_VEC3:return new H$(e,t,n,i);case e.FLOAT_VEC4:return new z$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new I3(e,t,n,i);case e.INT:case e.BOOL:return new K$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new J$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Q$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new j$(e,t,n,i);case e.FLOAT_MAT2:return new q$(e,t,n,i);case e.FLOAT_MAT3:return new $$(e,t,n,i);case e.FLOAT_MAT4:return new eee(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function O$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}O$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Y$(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}Y$.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function H$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}H$.prototype.set=function(){let e=this.value;l(e.red)?B.equals(e,this._value)||(this._value=B.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function z$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}z$.prototype.set=function(){let e=this.value;l(e.red)?B.equals(e,this._value)||(this._value=B.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function I3(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}I3.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};I3.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function K$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}K$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function J$(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}J$.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Q$(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}Q$.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function j$(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}j$.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var oRe=new Float32Array(4);function q$(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ii,this._gl=e,this._location=i}q$.prototype.set=function(){if(!Ii.equalsArray(this.value,this._value,0)){Ii.clone(this.value,this._value);let e=Ii.toArray(this.value,oRe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var rRe=new Float32Array(9);function $$(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}$$.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,rRe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var sRe=new Float32Array(16);function eee(e,t,n,i){this.name=n,this.value=void 0,this._value=new A,this._gl=e,this._location=i}eee.prototype.set=function(){if(!A.equalsArray(this.value,this._value,0)){A.clone(this.value,this._value);let e=A.toArray(this.value,sRe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var cR=iRe;var nWt=T(S(),1);function aRe(e,t,n,i){switch(t.type){case e.FLOAT:return new tee(e,t,n,i);case e.FLOAT_VEC2:return new nee(e,t,n,i);case e.FLOAT_VEC3:return new iee(e,t,n,i);case e.FLOAT_VEC4:return new oee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new X3(e,t,n,i);case e.INT:case e.BOOL:return new ree(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new see(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new aee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new cee(e,t,n,i);case e.FLOAT_MAT2:return new lee(e,t,n,i);case e.FLOAT_MAT3:return new dee(e,t,n,i);case e.FLOAT_MAT4:return new uee(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function tee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}tee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function nee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}nee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function iee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}iee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function oee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}oee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?B.equalsArray(s,n,o)||(B.pack(s,n,o),i=!0):l(s.x)&&(se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function X3(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}X3.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};X3.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function ree(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}ree.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function see(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}see.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function aee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}aee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function cee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}cee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function lee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}lee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Ii.equalsArray(s,n,o)||(Ii.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function dee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}dee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function uee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}uee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];A.equalsArray(s,n,o)||(A.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var lR=aRe;var cRe=0;function Zp(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=lRe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=cRe++}Zp.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};Zp.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Zp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return FN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return FN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return FN(this),this._uniformsByName}}});function mee(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function lRe(e,t){let n={};if(!At.highpFloatSupported||!At.highpIntSupported){let i,o,r,s,a=mee(e),c=mee(t),d=a.length,u=c.length;for(i=0;i<d;i++)for(o=0;o<u;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var af="[Cesium WebGL] ";function dRe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${af}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${af}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${af}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${af}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),d=`Program failed to link.  Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${af}Vertex shader compile log: ${c}`),console.error(`${af} Vertex shader source:
${n}`),d=`Vertex shader failed to compile.  Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${af}Fragment shader compile log: ${c}`),console.error(`${af} Fragment shader source:
${i}`),d=`Fragment shader failed to compile.  Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(d);function h(p,g){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${af}${g} shader translation failed.`);return}console.error(`${af}Translated ${g} shaderSource:
${f}`)}}function uRe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function mRe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",d=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(d.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,d);if(u!==null){let h=cR(e,a,d,u);n[d]=h,i.push(h),h._setSampler&&o.push(h)}}else{let u,h,p,g,f=d.indexOf("[");if(f>=0){if(u=n[d.slice(0,f)],!l(u))continue;h=u._locations,h.length<=1&&(p=u.value,g=e.getUniformLocation(t,d),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${d}[${x}]`),g!==null&&h.push(g);u=lR(e,a,d,h),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function hRe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=_p[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function fRe(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function FN(e){l(e._program)||hee(e)}function hee(e){let t=e._program,n=e._gl,i=dRe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=mRe(n,i),s=hRe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=uRe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=fRe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,d,u){let h=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{hee(e),d(e._program)}catch(f){e._vertexShaderText=h,e._fragmentShaderText=p;let _=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(_?_[1]:f.message)}})}Zp.prototype._bind=function(){FN(this),this._gl.useProgram(this._program)};Zp.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Zp.prototype.isDestroyed=function(){return!1};Zp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Zp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),me(this)};var $t=Zp;function AN(e){this._context=e}var dR,pRe=new $e({primitiveType:we.TRIANGLES}),bRe=new ti({color:new B(0,0,0,0)});function gRe(e,t){return new Wr({context:e,colorTextures:[t],destroyAttachments:!1})}function yRe(e,t){return $t.fromCache({context:e,vertexShaderSource:mx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function xRe(e,t){return(!l(dR)||dR.viewport.width!==e||dR.viewport.height!==t)&&(dR=Ue.fromCache({viewport:new Ke(0,0,e,t)})),dR}AN.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:yRe(o,e.fragmentShaderSource),a=gRe(o,t),c=xRe(n,i),d=e.uniformMap,u=bRe;u.framebuffer=a,u.renderState=c,u.execute(o);let h=pRe;h.vertexArray=r,h.renderState=c,h.shaderProgram=s,h.uniformMap=d,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};AN.prototype.isDestroyed=function(){return!1};AN.prototype.destroy=function(){return me(this)};var uR=AN;var MBt=T(S(),1);var IWt=T(S(),1);var Zn={BYTE:ie.BYTE,UNSIGNED_BYTE:ie.UNSIGNED_BYTE,SHORT:ie.SHORT,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,INT:ie.INT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,DOUBLE:ie.DOUBLE};Zn.getSizeInBytes=function(e){switch(e){case Zn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Zn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Zn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Zn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Zn.INT:return Int32Array.BYTES_PER_ELEMENT;case Zn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Zn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Zn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Zn.fromTypedArray=function(e){if(e instanceof Int8Array)return Zn.BYTE;if(e instanceof Uint8Array)return Zn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Zn.SHORT;if(e instanceof Uint16Array)return Zn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Zn.INT;if(e instanceof Uint32Array)return Zn.UNSIGNED_INT;if(e instanceof Float32Array)return Zn.FLOAT;if(e instanceof Float64Array)return Zn.DOUBLE};Zn.validate=function(e){return l(e)&&(e===Zn.BYTE||e===Zn.UNSIGNED_BYTE||e===Zn.SHORT||e===Zn.UNSIGNED_SHORT||e===Zn.INT||e===Zn.UNSIGNED_INT||e===Zn.FLOAT||e===Zn.DOUBLE)};Zn.createTypedArray=function(e,t){switch(e){case Zn.BYTE:return new Int8Array(t);case Zn.UNSIGNED_BYTE:return new Uint8Array(t);case Zn.SHORT:return new Int16Array(t);case Zn.UNSIGNED_SHORT:return new Uint16Array(t);case Zn.INT:return new Int32Array(t);case Zn.UNSIGNED_INT:return new Uint32Array(t);case Zn.FLOAT:return new Float32Array(t);case Zn.DOUBLE:return new Float64Array(t)}};Zn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Zn.getSizeInBytes(e)),e){case Zn.BYTE:return new Int8Array(t,n,i);case Zn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Zn.SHORT:return new Int16Array(t,n,i);case Zn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Zn.INT:return new Int32Array(t,n,i);case Zn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Zn.FLOAT:return new Float32Array(t,n,i);case Zn.DOUBLE:return new Float64Array(t,n,i)}};Zn.fromName=function(e){switch(e){case"BYTE":return Zn.BYTE;case"UNSIGNED_BYTE":return Zn.UNSIGNED_BYTE;case"SHORT":return Zn.SHORT;case"UNSIGNED_SHORT":return Zn.UNSIGNED_SHORT;case"INT":return Zn.INT;case"UNSIGNED_INT":return Zn.UNSIGNED_INT;case"FLOAT":return Zn.FLOAT;case"DOUBLE":return Zn.DOUBLE}};var Q=Object.freeze(Zn);var zWt=T(S(),1);var WWt=T(S(),1),_Re={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},xu=Object.freeze(_Re);function W3(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,we.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,xu.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}W3.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var TRe=new he,SRe=new m,fee=new A,CRe=[new he,new he,new he],VRe=[new D,new D,new D],LRe=[new D,new D,new D],RRe=new m,ZRe=new ve,GRe=new A,ERe=new Ii;W3._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,TRe),s=he.toCartesian(r,n,SRe),a=Pt.eastNorthUpToFixedFrame(s,n,fee),c=A.inverse(a,fee),d=VRe,u=CRe;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let h=RRe;for(o=0;o<3;o++)he.toCartesian(u[o],n,h),h=A.multiplyByPointAsVector(c,h,h),d[o].x=h.x,d[o].y=h.y;let p=ve.fromAxisAngle(m.UNIT_Z,-t,ZRe),g=$.fromQuaternion(p,GRe),f=e.length,x=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(o=0;o<f;o++)h=A.multiplyByPointAsVector(c,e[o],h),h=$.multiplyByVector(g,h,h),x=Math.min(x,h.x),_=Math.min(_,h.y),C=Math.max(C,h.x),V=Math.max(V,h.y);let L=Ii.fromRotation(t,ERe),R=LRe;R[0].x=x,R[0].y=_,R[1].x=x,R[1].y=V,R[2].x=C,R[2].y=_;let G=d[0],I=d[2].x-G.x,v=d[1].y-G.y;for(o=0;o<3;o++){let Z=R[o];Ii.multiplyByVector(L,Z,Z),Z.x=(Z.x-G.x)/I,Z.y=(Z.y-G.y)/v}let P=R[0],w=R[1],M=R[2],b=new Array(6);return D.pack(P,b),D.pack(w,b,2),D.pack(M,b,4),b};var lt=W3;var QWt=T(S(),1);function IRe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var Ge=IRe;var T2t=T(S(),1);var g2t=T(S(),1);var $Wt=T(S(),1);function jS(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(jS.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});jS.clone=function(e){if(l(e))return new jS(e._format,e._datatype,e._width,e._height,e._buffer)};jS.prototype.clone=function(){return jS.clone(this)};var mR=jS;var u2t=T(S(),1),pee=T(dd(),1);function bee(){if(!l(ca._canTransferArrayBuffer)){let e=w3("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ca._canTransferArrayBuffer=!1,ca._canTransferArrayBuffer}ca._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),ca._canTransferArrayBuffer=s}})}return ca._canTransferArrayBuffer}var v3=new be;function P3(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function w3(e){let t=new pee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(F0(e))s=e;else if(!n){let a=nn(`${ca._workerModulePrefix}/${i}.js`);F0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=P3(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
      importScripts("${P3(CESIUM_WORKERS)}");
      CesiumWorkers["${i}"]();
    `;return r=P3(a),new Worker(r,o)}if(r=e,n||(r=nn(`${ca._workerModulePrefix+i}.js`)),!Bt.supportsEsmWebWorkers())throw new ae("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function XRe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Bt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),n}n.wasmBinaryFile=nn(t.wasmBinaryFile);let i=await Ze.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function ca(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var WRe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new pe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),v3.raiseEvent(s),i(s)}else v3.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},PRe=[];async function vRe(e,t,n){let i=await Promise.resolve(bee());l(n)?i||(n.length=0):n=PRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",WRe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:nn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function wRe(e,t,n){++e._activeTasks;try{let i=await vRe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ca.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=w3(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return wRe(this,e,t)};ca.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=w3(this._workerPath),i=await XRe(this,e),o=await Promise.resolve(bee()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};ca.taskCompletedEvent=v3;ca._defaultWorkerModulePrefix="Workers/";ca._workerModulePrefix=ca._defaultWorkerModulePrefix;ca._canTransferArrayBuffer=void 0;var yi=ca;function Gp(){}Gp._transcodeTaskProcessor=new yi("transcodeKTX2",Number.POSITIVE_INFINITY);Gp._readyPromise=void 0;function FRe(){let e=Gp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Gp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});Gp._readyPromise=e}Gp.transcode=function(e,t){return l(Gp._readyPromise)||FRe(),Gp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new mR(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var hR=Gp;var gee;yee.setKTX2SupportedFormats=function(e,t,n,i,o,r){gee={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function yee(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ze.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return hR.transcode(n,gee)})}var Zl=yee;var Ywt=T(S(),1);var sPt=T(S(),1);var M2t=T(S(),1);var V2t=T(S(),1);function ARe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Ga=ARe;function fn(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var M3=new m,N3=new m,k3=new m,U3=new m,D3=new m,B3=new m,O3=new m,la=new m,Y3=new m,H3=new m,z3=new m,K3=new m,MRe=4/3*W.PI;fn.fromPoints=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],O3),i=m.clone(n,M3),o=m.clone(n,N3),r=m.clone(n,k3),s=m.clone(n,U3),a=m.clone(n,D3),c=m.clone(n,B3),d=e.length,u;for(u=1;u<d;u++){m.clone(e[u],n);let P=n.x,w=n.y,M=n.z;P<i.x&&m.clone(n,i),P>s.x&&m.clone(n,s),w<o.y&&m.clone(n,o),w>a.y&&m.clone(n,a),M<r.z&&m.clone(n,r),M>c.z&&m.clone(n,c)}let h=m.magnitudeSquared(m.subtract(s,i,la)),p=m.magnitudeSquared(m.subtract(a,o,la)),g=m.magnitudeSquared(m.subtract(c,r,la)),f=i,x=s,_=h;p>_&&(_=p,f=o,x=a),g>_&&(_=g,f=r,x=c);let C=Y3;C.x=(f.x+x.x)*.5,C.y=(f.y+x.y)*.5,C.z=(f.z+x.z)*.5;let V=m.magnitudeSquared(m.subtract(x,C,la)),L=Math.sqrt(V),R=H3;R.x=i.x,R.y=o.y,R.z=r.z;let G=z3;G.x=s.x,G.y=a.y,G.z=c.z;let I=m.midpoint(R,G,K3),v=0;for(u=0;u<d;u++){m.clone(e[u],n);let P=m.magnitude(m.subtract(n,I,la));P>v&&(v=P);let w=m.magnitudeSquared(m.subtract(n,C,la));if(w>V){let M=Math.sqrt(w);L=(L+M)*.5,V=L*L;let b=M-L;C.x=(L*C.x+b*n.x)/M,C.y=(L*C.y+b*n.y)/M,C.z=(L*C.z+b*n.z)/M}}return L<v?(m.clone(C,t.center),t.radius=L):(m.clone(I,t.center),t.radius=v),t};var xee=new Ei,NRe=new m,kRe=new m,F3=new he,A3=new he;fn.fromRectangle2D=function(e,t,n){return fn.fromRectangleWithHeights2D(e,t,0,0,n)};fn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new fn),!l(e))return o.center=m.clone(m.ZERO,o.center),o.radius=0,o;xee._ellipsoid=ne.default,t=y(t,xee),ce.southwest(e,F3),F3.height=n,ce.northeast(e,A3),A3.height=i;let r=t.project(F3,NRe),s=t.project(A3,kRe),a=s.x-r.x,c=s.y-r.y,d=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+d*d)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+c*.5,u.z=r.z+d*.5,o};var URe=[];fn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ne.default),n=y(n,0),l(i)||(i=new fn),!l(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,URe);return fn.fromPoints(o,i)};fn.fromVertices=function(e,t,n,i){if(l(i)||(i=new fn),!l(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=y(t,m.ZERO),n=y(n,3);let o=O3;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=m.clone(o,M3),s=m.clone(o,N3),a=m.clone(o,k3),c=m.clone(o,U3),d=m.clone(o,D3),u=m.clone(o,B3),h=e.length,p;for(p=0;p<h;p+=n){let M=e[p]+t.x,b=e[p+1]+t.y,Z=e[p+2]+t.z;o.x=M,o.y=b,o.z=Z,M<r.x&&m.clone(o,r),M>c.x&&m.clone(o,c),b<s.y&&m.clone(o,s),b>d.y&&m.clone(o,d),Z<a.z&&m.clone(o,a),Z>u.z&&m.clone(o,u)}let g=m.magnitudeSquared(m.subtract(c,r,la)),f=m.magnitudeSquared(m.subtract(d,s,la)),x=m.magnitudeSquared(m.subtract(u,a,la)),_=r,C=c,V=g;f>V&&(V=f,_=s,C=d),x>V&&(V=x,_=a,C=u);let L=Y3;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let R=m.magnitudeSquared(m.subtract(C,L,la)),G=Math.sqrt(R),I=H3;I.x=r.x,I.y=s.y,I.z=a.z;let v=z3;v.x=c.x,v.y=d.y,v.z=u.z;let P=m.midpoint(I,v,K3),w=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let M=m.magnitude(m.subtract(o,P,la));M>w&&(w=M);let b=m.magnitudeSquared(m.subtract(o,L,la));if(b>R){let Z=Math.sqrt(b);G=(G+Z)*.5,R=G*G;let E=Z-G;L.x=(G*L.x+E*o.x)/Z,L.y=(G*L.y+E*o.y)/Z,L.z=(G*L.z+E*o.z)/Z}}return G<w?(m.clone(L,i.center),i.radius=G):(m.clone(P,i.center),i.radius=w),i};fn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new fn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=O3;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=m.clone(i,M3),r=m.clone(i,N3),s=m.clone(i,k3),a=m.clone(i,U3),c=m.clone(i,D3),d=m.clone(i,B3),u=e.length,h;for(h=0;h<u;h+=3){let w=e[h]+t[h],M=e[h+1]+t[h+1],b=e[h+2]+t[h+2];i.x=w,i.y=M,i.z=b,w<o.x&&m.clone(i,o),w>a.x&&m.clone(i,a),M<r.y&&m.clone(i,r),M>c.y&&m.clone(i,c),b<s.z&&m.clone(i,s),b>d.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,la)),g=m.magnitudeSquared(m.subtract(c,r,la)),f=m.magnitudeSquared(m.subtract(d,s,la)),x=o,_=a,C=p;g>C&&(C=g,x=r,_=c),f>C&&(C=f,x=s,_=d);let V=Y3;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=m.magnitudeSquared(m.subtract(_,V,la)),R=Math.sqrt(L),G=H3;G.x=o.x,G.y=r.y,G.z=s.z;let I=z3;I.x=a.x,I.y=c.y,I.z=d.z;let v=m.midpoint(G,I,K3),P=0;for(h=0;h<u;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let w=m.magnitude(m.subtract(i,v,la));w>P&&(P=w);let M=m.magnitudeSquared(m.subtract(i,V,la));if(M>L){let b=Math.sqrt(M);R=(R+b)*.5,L=R*R;let Z=b-R;V.x=(R*V.x+Z*i.x)/b,V.y=(R*V.y+Z*i.y)/b,V.z=(R*V.z+Z*i.z)/b}}return R<P?(m.clone(V,n.center),n.radius=R):(m.clone(v,n.center),n.radius=P),n};fn.fromCornerPoints=function(e,t,n){l(n)||(n=new fn);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};fn.fromEllipsoid=function(e,t){return l(t)||(t=new fn),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var DRe=new m;fn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return fn.clone(e[0],t);if(n===2)return fn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=fn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,m.distance(r,a.center,DRe)+a.radius)}return t.radius=s,t};var BRe=new m,ORe=new m,YRe=new m;fn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new fn);let n=e.halfAxes,i=$.getColumn(n,0,BRe),o=$.getColumn(n,1,ORe),r=$.getColumn(n,2,YRe);return m.add(i,o,i),m.add(i,r,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var HRe=new m,zRe=new m;fn.fromTransformation=function(e,t){l(t)||(t=new fn);let n=A.getTranslation(e,HRe),i=A.getScale(e,zRe),o=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=o,t};fn.clone=function(e,t){if(l(e))return l(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new fn(e.center,e.radius)};fn.packedLength=4;fn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};fn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new fn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var KRe=new m,JRe=new m;fn.union=function(e,t,n){l(n)||(n=new fn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=m.subtract(r,i,KRe),c=m.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=m.multiplyByScalar(a,(-o+d)/c,JRe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var QRe=new m;fn.expand=function(e,t,n){n=fn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,QRe));return i>n.radius&&(n.radius=i),n};fn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?Ht.OUTSIDE:r<i?Ht.INTERSECTING:Ht.INSIDE};fn.transform=function(e,t,n){return l(n)||(n=new fn),n.center=A.multiplyByPoint(t,e.center,n.center),n.radius=A.getMaximumScale(t)*e.radius,n};var jRe=new m;fn.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,jRe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};fn.transformWithoutScale=function(e,t,n){return l(n)||(n=new fn),n.center=A.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var qRe=new m;fn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ga);let o=m.subtract(e.center,t,qRe),r=m.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var _ee=new m,$Re=new m,eZe=new m,tZe=new m,nZe=new m,iZe=new he,See=new Array(8);for(let e=0;e<8;++e)See[e]=new m;var Tee=new Ei;fn.projectTo2D=function(e,t,n){Tee._ellipsoid=ne.default,t=y(t,Tee);let i=t.ellipsoid,o=e.center,r=e.radius,s;m.equals(o,m.ZERO)?s=m.clone(m.UNIT_X,_ee):s=i.geodeticSurfaceNormal(o,_ee);let a=m.cross(m.UNIT_Z,s,$Re);m.normalize(a,a);let c=m.cross(s,a,eZe);m.normalize(c,c),m.multiplyByScalar(s,r,s),m.multiplyByScalar(c,r,c),m.multiplyByScalar(a,r,a);let d=m.negate(c,nZe),u=m.negate(a,tZe),h=See,p=h[0];m.add(s,c,p),m.add(p,a,p),p=h[1],m.add(s,c,p),m.add(p,u,p),p=h[2],m.add(s,d,p),m.add(p,u,p),p=h[3],m.add(s,d,p),m.add(p,a,p),m.negate(s,s),p=h[4],m.add(s,c,p),m.add(p,a,p),p=h[5],m.add(s,c,p),m.add(p,u,p),p=h[6],m.add(s,d,p),m.add(p,u,p),p=h[7],m.add(s,d,p),m.add(p,a,p);let g=h.length;for(let C=0;C<g;++C){let V=h[C];m.add(o,V,V);let L=i.cartesianToCartographic(V,iZe);t.project(L,V)}n=fn.fromPoints(h,n),o=n.center;let f=o.x,x=o.y,_=o.z;return o.x=_,o.y=f,o.z=x,n};fn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};fn.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};fn.prototype.intersectPlane=function(e){return fn.intersectPlane(this,e)};fn.prototype.distanceSquaredTo=function(e){return fn.distanceSquaredTo(this,e)};fn.prototype.computePlaneDistances=function(e,t,n){return fn.computePlaneDistances(this,e,t,n)};fn.prototype.isOccluded=function(e){return fn.isOccluded(this,e)};fn.prototype.equals=function(e){return fn.equals(this,e)};fn.prototype.clone=function(e){return fn.clone(this,e)};fn.prototype.volume=function(){let e=this.radius;return MRe*e*e*e};var le=fn;var U2t=T(S(),1);function oZe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var mn=oZe;var B2t=T(S(),1),rZe={NONE:0,TOP:1,ALL:2},rn=Object.freeze(rZe);var z2t=T(S(),1);function ms(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ms.POSITION_ONLY=Object.freeze(new ms({position:!0}));ms.POSITION_AND_NORMAL=Object.freeze(new ms({position:!0,normal:!0}));ms.POSITION_NORMAL_AND_ST=Object.freeze(new ms({position:!0,normal:!0,st:!0}));ms.POSITION_AND_ST=Object.freeze(new ms({position:!0,st:!0}));ms.POSITION_AND_COLOR=Object.freeze(new ms({position:!0,color:!0}));ms.ALL=Object.freeze(new ms({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ms.DEFAULT=ms.POSITION_NORMAL_AND_ST;ms.packedLength=6;ms.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ms.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ms),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ms.clone=function(e,t){if(l(e))return l(t)||(t=new ms),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Xe=ms;var sZe=new m;function md(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Xe.DEFAULT);this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}md.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new md({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};md.fromAxisAlignedBoundingBox=function(e){return new md({minimum:e.minimum,maximum:e.maximum})};md.packedLength=2*m.packedLength+Xe.packedLength+1;md.pack=function(e,t,n){return n=y(n,0),m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),Xe.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+Xe.packedLength]=y(e._offsetAttribute,-1),t};var Vee=new m,Lee=new m,Ree=new Xe,Cee={minimum:Vee,maximum:Lee,vertexFormat:Ree,offsetAttribute:void 0};md.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Vee),o=m.unpack(e,t+m.packedLength,Lee),r=Xe.unpack(e,t+2*m.packedLength,Ree),s=e[t+2*m.packedLength+Xe.packedLength];return l(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(o,n._maximum),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Cee.offsetAttribute=s===-1?void 0:s,new md(Cee))};md.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let o=new mn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,o.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.st){let d=new Float32Array(48);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=1,d[5]=1,d[6]=0,d[7]=1,d[8]=1,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=1,d[14]=1,d[15]=1,d[16]=0,d[17]=0,d[18]=1,d[19]=0,d[20]=1,d[21]=1,d[22]=0,d[23]=1,d[24]=1,d[25]=0,d[26]=0,d[27]=0,d[28]=0,d[29]=1,d[30]=1,d[31]=1,d[32]=1,d[33]=0,d[34]=0,d[35]=0,d[36]=0,d[37]=1,d[38]=1,d[39]=1,d[40]=0,d[41]=0,d[42]=1,d[43]=0,d[44]=1,d[45]=1,d[46]=0,d[47]=1,o.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:d})}if(i.tangent){let d=new Float32Array(72);d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=1,d[7]=0,d[8]=0,d[9]=1,d[10]=0,d[11]=0,d[12]=-1,d[13]=0,d[14]=0,d[15]=-1,d[16]=0,d[17]=0,d[18]=-1,d[19]=0,d[20]=0,d[21]=-1,d[22]=0,d[23]=0,d[24]=0,d[25]=1,d[26]=0,d[27]=0,d[28]=1,d[29]=0,d[30]=0,d[31]=1,d[32]=0,d[33]=0,d[34]=1,d[35]=0,d[36]=0,d[37]=-1,d[38]=0,d[39]=0,d[40]=-1,d[41]=0,d[42]=0,d[43]=-1,d[44]=0,d[45]=0,d[46]=-1,d[47]=0,d[48]=-1,d[49]=0,d[50]=0,d[51]=-1,d[52]=0,d[53]=0,d[54]=-1,d[55]=0,d[56]=0,d[57]=-1,d[58]=0,d[59]=0,d[60]=1,d[61]=0,d[62]=0,d[63]=1,d[64]=0,d[65]=0,d[66]=1,d[67]=0,d[68]=0,d[69]=1,d[70]=0,d[71]=0,o.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.bitangent){let d=new Float32Array(72);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=1,d[14]=0,d[15]=0,d[16]=1,d[17]=0,d[18]=0,d[19]=1,d[20]=0,d[21]=0,d[22]=1,d[23]=0,d[24]=0,d[25]=0,d[26]=1,d[27]=0,d[28]=0,d[29]=1,d[30]=0,d[31]=0,d[32]=1,d[33]=0,d[34]=0,d[35]=1,d[36]=0,d[37]=0,d[38]=1,d[39]=0,d[40]=0,d[41]=1,d[42]=0,d[43]=0,d[44]=1,d[45]=0,d[46]=0,d[47]=1,d[48]=0,d[49]=0,d[50]=1,d[51]=0,d[52]=0,d[53]=1,d[54]=0,d[55]=0,d[56]=1,d[57]=0,d[58]=0,d[59]=1,d[60]=0,d[61]=0,d[62]=1,d[63]=0,d[64]=0,d[65]=1,d[66]=0,d[67]=0,d[68]=1,d[69]=0,d[70]=0,d[71]=1,o.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=m.subtract(n,t,sZe),c=m.magnitude(a)*.5;if(l(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===rn.NONE?0:1,h=new Uint8Array(d/3).fill(u);o.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new lt({attributes:o,indices:r,primitiveType:we.TRIANGLES,boundingSphere:new le(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var J3;md.getUnitBox=function(){return l(J3)||(J3=md.createGeometry(md.fromDimensions({dimensions:new m(1,1,1),vertexFormat:Xe.POSITION_ONLY}))),J3};var Ea=md;var Dvt=T(S(),1);var SPt=T(S(),1);var fPt=T(S(),1);var to={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};to.getMathType=function(e){switch(e){case to.SCALAR:return Number;case to.VEC2:return D;case to.VEC3:return m;case to.VEC4:return se;case to.MAT2:return Ii;case to.MAT3:return $;case to.MAT4:return A}};to.getNumberOfComponents=function(e){switch(e){case to.SCALAR:return 1;case to.VEC2:return 2;case to.VEC3:return 3;case to.VEC4:case to.MAT2:return 4;case to.MAT3:return 9;case to.MAT4:return 16}};to.getAttributeLocationCount=function(e){switch(e){case to.SCALAR:case to.VEC2:case to.VEC3:case to.VEC4:return 1;case to.MAT2:return 2;case to.MAT3:return 3;case to.MAT4:return 4}};to.getGlslType=function(e){switch(e){case to.SCALAR:return"float";case to.VEC2:return"vec2";case to.VEC3:return"vec3";case to.VEC4:return"vec4";case to.MAT2:return"mat2";case to.MAT3:return"mat3";case to.MAT4:return"mat4"}};var on=Object.freeze(to);var Zee=1/256,Gee=256,_o={};_o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*W.signNotZero(i),n.y=(1-Math.abs(i))*W.signNotZero(o)}return n.x=W.toSNorm(n.x,t),n.y=W.toSNorm(n.y,t),n};_o.octEncode=function(e,t){return _o.octEncodeInRange(e,255,t)};var fR=new D,Eee=new Uint8Array(1);function MN(e){return Eee[0]=e,Eee[0]}_o.octEncodeToCartesian4=function(e,t){return _o.octEncodeInRange(e,65535,fR),t.x=MN(fR.x*Zee),t.y=MN(fR.x),t.z=MN(fR.y*Zee),t.w=MN(fR.y),t};_o.octDecodeInRange=function(e,t,n,i){if(i.x=W.fromSNorm(e,n),i.y=W.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*W.signNotZero(o),i.y=(1-Math.abs(o))*W.signNotZero(i.y)}return m.normalize(i,i)};_o.octDecode=function(e,t,n){return _o.octDecodeInRange(e,t,255,n)};_o.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*Gee+i,a=o*Gee+r;return _o.octDecodeInRange(s,a,65535,t)};_o.octPackFloat=function(e){return 256*e.x+e.y};var j3=new D;_o.octEncodeFloat=function(e){return _o.octEncode(e,j3),_o.octPackFloat(j3)};_o.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return _o.octDecode(i,o,t)};_o.octPack=function(e,t,n,i){let o=_o.octEncodeFloat(e),r=_o.octEncodeFloat(t),s=_o.octEncode(n,j3);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};_o.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;_o.octDecodeFloat(s,t),_o.octDecodeFloat(c,n),_o.octDecode(r,a,i)};_o.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};_o.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function Q3(e){return e>>1^-(e&1)}_o.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=Q3(e[a]),r+=Q3(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=Q3(n[a]),n[a]=s)};_o.dequantize=function(e,t,n,i){let o=on.getNumberOfComponents(n),r;switch(t){case Q.BYTE:r=127;break;case Q.UNSIGNED_BYTE:r=255;break;case Q.SHORT:r=32767;break;case Q.UNSIGNED_SHORT:r=65535;break;case Q.INT:r=2147483647;break;case Q.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let d=a*o+c;s[d]=Math.max(e[d]/r,-1)}return s};_o.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],d=c>>11,u=c>>5&o,h=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=h*r}return t};var wn=_o;var GPt=T(S(),1);var Iee=new m,Xee=new m,Wee=new m;function aZe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,d,u,h,p;if(l(t.z)){if(m.equalsEpsilon(e,t,W.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,W.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,W.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,Iee),s=m.subtract(i,t,Xee),a=m.subtract(e,t,Wee),c=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),h=m.dot(s,s),p=m.dot(s,a)}else{if(D.equalsEpsilon(e,t,W.EPSILON14))return m.clone(m.UNIT_X,o);if(D.equalsEpsilon(e,n,W.EPSILON14))return m.clone(m.UNIT_Y,o);if(D.equalsEpsilon(e,i,W.EPSILON14))return m.clone(m.UNIT_Z,o);r=D.subtract(n,t,Iee),s=D.subtract(i,t,Xee),a=D.subtract(e,t,Wee),c=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),h=D.dot(s,s),p=D.dot(s,a)}o.y=h*u-d*p,o.z=c*p-d*u;let g=c*h-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var fx=aZe;var WPt=T(S(),1);function cf(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}cf.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Ep={high:0,low:0};cf.fromCartesian=function(e,t){l(t)||(t=new cf);let n=t.high,i=t.low;return cf.encode(e.x,Ep),n.x=Ep.high,i.x=Ep.low,cf.encode(e.y,Ep),n.y=Ep.high,i.y=Ep.low,cf.encode(e.z,Ep),n.z=Ep.high,i.z=Ep.low,t};var q3=new cf;cf.writeElements=function(e,t,n){cf.fromCartesian(e,q3);let i=q3.high,o=q3.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var On=cf;var svt=T(S(),1);var wPt=T(S(),1);var $3={};$3.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Pee(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}$3.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),d=Math.abs(e);if(c<d&&c/d<W.EPSILON14)return[0,0];if(c>d&&d/c<W.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Pee(o,-r,W.EPSILON14);if(s<0)return[];let a=-.5*Pee(t,W.sign(t)*Math.sqrt(s),W.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Fc=$3;var BPt=T(S(),1);var MPt=T(S(),1);var tY={};tY.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function eY(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,h=s*s,p=o*s-u,g=o*a-r*s,f=r*a-h,x=4*p*f-g*g,_,C;if(x<0){let H,K,te;u*d>=c*h?(H=o,K=p,te=-2*r*p+o*g):(H=a,K=f,te=-a*g+2*s*f);let j=-(te<0?-1:1)*Math.abs(H)*Math.sqrt(-x);C=-te+j;let ee=C/2,fe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),Te=C===j?-fe:-K/fe;return _=K<=0?fe+Te:-te/(fe*fe+Te*Te+K),u*d>=c*h?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*g,R=f,G=-a*g+2*s*f,I=Math.sqrt(x),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-L)/3);_=2*Math.sqrt(-V);let w=Math.cos(P);C=_*w;let M=_*(-w/2-v*Math.sin(P)),b=C+M>2*r?C-r:M-r,Z=o,E=b/Z;P=Math.abs(Math.atan2(a*I,-G)/3),_=2*Math.sqrt(-R),w=Math.cos(P),C=_*w,M=_*(-w/2-v*Math.sin(P));let X=-a,F=C+M<2*s?C+s:M+s,N=X/F,O=Z*F,U=-b*F-Z*X,Y=b*X,k=(s*U-r*Y)/(-r*U+s*O);return E<=k?E<=N?k<=N?[E,k,N]:[E,N,k]:[N,E,k]:E<=N?[k,E,N]:k<=N?[k,N,E]:[N,k,E]}tY.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Fc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Fc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return eY(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):eY(e,t,0,i);if(i===0)return o=Fc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return eY(e,t,n,i)};var px=tY;var nY={};nY.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,h=i*i,p=h*i,g=o*o,f=g*o;return a*d*h-4*c*p-4*e*u*h+18*e*t*n*p-27*r*h*h+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Em(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=px.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)<W.EPSILON14){let h=Fc.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],g=h[1],f;if(p>=0&&g>=0){let x=Math.sqrt(p),_=Math.sqrt(g);return[d-_,d-x,d+x,d+_]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let h=Math.sqrt(u),p=(r+u-s/h)/2,g=(r+u+s/h)/2,f=Fc.computeRealRoots(1,h,p),x=Fc.computeRealRoots(1,-h,g);return f.length!==0?(f[0]+=d,f[1]+=d,x.length!==0?(x[0]+=d,x[1]+=d,f[1]<=x[0]?[f[0],f[1],x[0],x[1]]:x[1]<=f[0]?[x[0],x[1],f[0],f[1]]:f[0]>=x[0]&&f[1]<=x[1]?[x[0],f[0],f[1],x[1]]:x[0]>=f[0]&&x[1]<=f[1]?[f[0],x[0],x[1],f[1]]:f[0]>x[0]&&f[0]<x[1]?[x[0],f[0],x[1],f[1]]:[f[0],x[0],f[1],x[1]]):f):x.length!==0?(x[0]+=d,x[1]+=d,x):[]}}return[]}function pR(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,d=s*i-n*t*e+o,u=px.computeRealRoots(1,a,c,d);if(u.length>0){let h=u[0],p=t-h,g=p*p,f=e/2,x=p/2,_=g-4*i,C=g+4*Math.abs(i),V=s-4*h,L=s+4*Math.abs(h),R,G;if(h<0||_*L<V*C){let Z=Math.sqrt(V);R=Z/2,G=Z===0?0:(e*x-n)/Z}else{let Z=Math.sqrt(_);R=Z===0?0:(e*x-n)/Z,G=Z/2}let I,v;f===0&&R===0?(I=0,v=0):W.sign(f)===W.sign(R)?(I=f+R,v=h/I):(v=f-R,I=h/v);let P,w;x===0&&G===0?(P=0,w=0):W.sign(x)===W.sign(G)?(P=x+G,w=i/P):(w=x-G,P=i/w);let M=Fc.computeRealRoots(1,I,P),b=Fc.computeRealRoots(1,v,w);if(M.length!==0)return b.length!==0?M[1]<=b[0]?[M[0],M[1],b[0],b[1]]:b[1]<=M[0]?[b[0],b[1],M[0],M[1]]:M[0]>=b[0]&&M[1]<=b[1]?[b[0],M[0],M[1],b[1]]:b[0]>=M[0]&&b[1]<=M[1]?[M[0],b[0],b[1],M[1]]:M[0]>b[0]&&M[0]<b[1]?[b[0],M[0],b[1],M[1]]:[M[0],b[0],M[1],b[1]]:M;if(b.length!==0)return b}return[]}nY.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<W.EPSILON15)return px.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,d=r<0?1:0;switch(d+=s<0?d+1:d,d+=a<0?d+1:d,d+=c<0?d+1:d,d){case 0:return Em(r,s,a,c);case 1:return pR(r,s,a,c);case 2:return pR(r,s,a,c);case 3:return Em(r,s,a,c);case 4:return Em(r,s,a,c);case 5:return pR(r,s,a,c);case 6:return Em(r,s,a,c);case 7:return Em(r,s,a,c);case 8:return pR(r,s,a,c);case 9:return Em(r,s,a,c);case 10:return Em(r,s,a,c);case 11:return pR(r,s,a,c);case 12:return Em(r,s,a,c);case 13:return Em(r,s,a,c);case 14:return Em(r,s,a,c);case 15:return Em(r,s,a,c);default:return}};var bR=nY;var KPt=T(S(),1);function NN(e,t){t=m.clone(y(t,m.ZERO)),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(y(e,m.ZERO)),this.direction=t}NN.clone=function(e,t){if(l(e))return l(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new NN(e.origin,e.direction)};NN.getPoint=function(e,t,n){return l(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var pn=NN;var Mo={};Mo.rayPlane=function(e,t,n){l(n)||(n=new m);let i=e.origin,o=e.direction,r=t.normal,s=m.dot(r,o);if(Math.abs(s)<W.EPSILON15)return;let a=(-t.distance-m.dot(r,i))/s;if(!(a<0))return n=m.multiplyByScalar(o,a,n),m.add(i,n,n)};var cZe=new m,lZe=new m,Uee=new m,vee=new m,wee=new m;Mo.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=m.subtract(n,t,cZe),c=m.subtract(i,t,lZe),d=m.cross(s,c,Uee),u=m.dot(a,d),h,p,g,f,x;if(o){if(u<W.EPSILON6||(h=m.subtract(r,t,vee),g=m.dot(h,d),g<0||g>u)||(p=m.cross(h,a,wee),f=m.dot(s,p),f<0||g+f>u))return;x=m.dot(c,p)/u}else{if(Math.abs(u)<W.EPSILON6)return;let _=1/u;if(h=m.subtract(r,t,vee),g=m.dot(h,d)*_,g<0||g>1||(p=m.cross(h,a,wee),f=m.dot(s,p)*_,f<0||g+f>1))return;x=m.dot(c,p)*_}return x};Mo.rayTriangle=function(e,t,n,i,o,r){let s=Mo.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var dZe=new pn;Mo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=dZe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=Mo.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function uZe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return c<d?(i.root0=c,i.root1=d):(i.root0=d,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var mZe={root0:0,root1:0};function Dee(e,t,n){l(n)||(n=new Ga);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=m.subtract(i,r,Uee),c=m.dot(o,o),d=2*m.dot(o,a),u=m.magnitudeSquared(a)-s,h=uZe(c,d,u,mZe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}Mo.raySphere=function(e,t,n){if(n=Dee(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var hZe=new pn;Mo.lineSegmentSphere=function(e,t,n,i){let o=hZe;m.clone(e,o.origin);let r=m.subtract(t,e,o.direction),s=m.magnitude(r);if(m.normalize(r,r),i=Dee(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var fZe=new m,pZe=new m;Mo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,fZe),o=m.multiplyComponents(n,e.direction,pZe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,d,u,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),d=c*a,p<d)return;if(p>d){u=s*s-d,h=-s+Math.sqrt(u);let f=h/c,x=a/h;return f<x?new Ga(f,x):{start:x,stop:f}}let g=Math.sqrt(a/c);return new Ga(g,g)}else if(r<1)return a=r-1,c=m.magnitudeSquared(o),d=c*a,u=s*s-d,h=-s+Math.sqrt(u),new Ga(0,h/c);if(s<0)return c=m.magnitudeSquared(o),new Ga(0,-s/c)};function bx(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Mo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*bx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],W.EPSILON15)+t.y),d=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,u=s*bx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],W.EPSILON15),h=o*(i*bx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(h===0&&u===0){if(p=Fc.computeRealRoots(a,c,d),p.length===0)return g;let P=p[0],w=Math.sqrt(Math.max(1-P*P,0));if(g.push(new m(i,o*P,o*-w)),g.push(new m(i,o*P,o*w)),p.length===2){let M=p[1],b=Math.sqrt(Math.max(1-M*M,0));g.push(new m(i,o*M,o*-b)),g.push(new m(i,o*M,o*b))}return g}let f=h*h,x=u*u,_=a*a,C=h*u,V=_+x,L=2*(c*a+C),R=2*d*a+c*c-x+f,G=2*(d*c-C),I=d*d-f;if(V===0&&L===0&&R===0&&G===0)return g;p=bR.computeRealRoots(V,L,R,G,I);let v=p.length;if(v===0)return g;for(let P=0;P<v;++P){let w=p[P],M=w*w,b=Math.max(1-M,0),Z=Math.sqrt(b),E;W.sign(a)===W.sign(d)?E=bx(a*M+d,c*w,W.EPSILON12):W.sign(d)===W.sign(c*w)?E=bx(a*M,c*w+d,W.EPSILON12):E=bx(a*M+c*w,d,W.EPSILON12);let X=bx(u*w,h,W.EPSILON15),F=E*X;F<0?g.push(new m(i,o*w,o*Z)):F>0?g.push(new m(i,o*w,o*-Z)):Z!==0?(g.push(new m(i,o*w,o*-Z)),g.push(new m(i,o*w,o*Z)),++P):g.push(new m(i,o*w,o*Z))}return g};var iY=new m,Fee=new m,Aee=new m,kN=new m,bZe=new m,gZe=new $,yZe=new $,xZe=new $,_Ze=new $,TZe=new $,Mee=new $,Nee=new $,kee=new m,SZe=new m,CZe=new he;Mo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,iY);if(m.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,iY),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,kN),c=m.normalize(m.cross(a,s,Fee),Fee),d=m.normalize(m.cross(s,c,Aee),Aee),u=gZe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let h=$.transpose(u,yZe),p=$.fromScale(t.radii,xZe),g=$.fromScale(t.oneOverRadii,_Ze),f=TZe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let x=$.multiply($.multiply(h,g,Mee),f,Mee),_=$.multiply($.multiply(x,p,Nee),u,Nee),C=$.multiplyByVector(x,n,bZe),V=Mo.quadraticVectorExpression(_,m.negate(C,iY),0,0,1),L,R,G=V.length;if(G>0){let I=m.clone(m.ZERO,SZe),v=Number.NEGATIVE_INFINITY;for(let w=0;w<G;++w){L=$.multiplyByVector(p,$.multiplyByVector(u,V[w],kee),kee);let M=m.normalize(m.subtract(L,n,kN),kN),b=m.dot(M,i);b>v&&(v=b,I=m.clone(L,I))}let P=t.cartesianToCartographic(I,CZe);return v=W.clamp(v,0,1),R=m.magnitude(m.subtract(I,n,kN))*Math.sqrt(1-v*v),R=o?-R:R,P.height=R,t.cartographicToCartesian(P,new m)}};var VZe=new m;Mo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,VZe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)<W.EPSILON6)return;let a=m.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};Mo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,h;if((d===1||d===2)&&(u=new m,h=new m),d===1){if(s)return Mo.lineSegmentPlane(e,t,i,u),Mo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,u,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Mo.lineSegmentPlane(t,n,i,u),Mo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,u,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Mo.lineSegmentPlane(n,e,i,u),Mo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,u,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return Mo.lineSegmentPlane(e,n,i,u),Mo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,u,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Mo.lineSegmentPlane(n,t,i,u),Mo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,u,h],indices:[2,0,4,2,4,3,1,3,4]};else return Mo.lineSegmentPlane(t,e,i,u),Mo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,u,h],indices:[1,2,4,1,4,3,0,3,4]}};var qn=Mo;var mvt=T(S(),1);function As(e,t){this.normal=m.clone(e),this.distance=t}As.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new As(t,i)};var LZe=new m;As.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,LZe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new As(n,i)};As.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var RZe=new m;As.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=As.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,RZe);return m.subtract(t,o,n)};var ZZe=new A,GZe=new se,EZe=new m;As.transform=function(e,t,n){let i=e.normal,o=e.distance,r=A.inverseTranspose(t,ZZe),s=se.fromElements(i.x,i.y,i.z,o,GZe);s=A.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,EZe);return s=se.divideByScalar(s,m.magnitude(a),s),As.fromCartesian4(s,n)};As.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new As(e.normal,e.distance)};As.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};As.ORIGIN_XY_PLANE=Object.freeze(new As(m.UNIT_Z,0));As.ORIGIN_YZ_PLANE=Object.freeze(new As(m.UNIT_X,0));As.ORIGIN_ZX_PLANE=Object.freeze(new As(m.UNIT_Y,0));var sn=As;var bvt=T(S(),1);var oY={};oY.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};oY.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(b,Z,E,X){for(;Z.length>=1;){let F=Z[Z.length-1];if(Z.splice(Z.length-1,1),b[F].numLiveTriangles>0)return F}for(;o<X;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,Z,E,X,F,N,O){let U=-1,Y,k=-1,H=0;for(;H<E.length;){let K=E[H];X[K].numLiveTriangles&&(Y=0,F-X[K].timeStamp+2*X[K].numLiveTriangles<=Z&&(Y=F-X[K].timeStamp),(Y>k||k===-1)&&(k=Y,U=K)),++H}return U===-1?r(X,N,b,O):U}let a=t.length,c=0,d=0,u=t[d],h=a;if(l(n))c=n+1;else{for(;d<h;)u>c&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;let f=0;for(;d<h;)p[t[d]].vertexTriangles.push(f),++p[t[d]].numLiveTriangles,p[t[d+1]].vertexTriangles.push(f),++p[t[d+1]].numLiveTriangles,p[t[d+2]].vertexTriangles.push(f),++p[t[d+2]].numLiveTriangles,++f,d+=3;let x=0,_=i+1;o=1;let C=[],V=[],L,R,G=0,I=[],v=a/3,P=[];for(g=0;g<v;g++)P[g]=!1;let w,M;for(;x!==-1;){C=[],R=p[x],M=R.vertexTriangles.length;for(let b=0;b<M;++b)if(f=R.vertexTriangles[b],!P[f]){P[f]=!0,d=f+f+f;for(let Z=0;Z<3;++Z)w=t[d],C.push(w),V.push(w),I[G]=w,++G,L=p[w],--L.numLiveTriangles,_-L.timeStamp>i&&(L.timeStamp=_,++_),++d}x=s(t,i,C,p,_,V,c)}return I};var gR=oY;var Ac={};function zN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function IZe(e){let t=e.length,n=t/3*6,i=Ae.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)zN(i,o,e[r],e[r+1],e[r+2]);return i}function XZe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ae.createTypedArray(t,n);zN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)zN(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function WZe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ae.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)zN(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Ac.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case we.TRIANGLES:e.indices=IZe(t);break;case we.TRIANGLE_STRIP:e.indices=XZe(t);break;case we.TRIANGLE_FAN:e.indices=WZe(t);break}e.primitiveType=we.LINES}return e};Ac.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let c,d=e.boundingSphere;return l(d)&&(c=new le(d.center,d.radius+n)),new lt({attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:we.LINES,boundingSphere:c})};Ac.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Ac.reorderForPreVertexCache=function(e){let t=lt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ae.createTypedArray(t,r),a=0,c=0,d=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[c]=u:(u=o[a],i[u]=d,s[c]=d,++d),++a,++c;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let g=h[p],f=g.values,x=0,_=g.componentsPerAttribute,C=Q.createTypedArray(g.componentDatatype,d*_);for(;x<t;){let V=i[x];if(V!==-1)for(let L=0;L<_;L++)C[_*V+L]=f[_*x+L];++x}g.values=C}}return e};Ac.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===we.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=gR.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Bee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ge({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function PZe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Ac.fitToUnsignedShortIndices=function(e){let t=[],n=lt.computeNumberOfVertices(e);if(l(e.indices)&&n>=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Bee(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===we.TRIANGLES?d=3:e.primitiveType===we.LINES?d=2:e.primitiveType===we.POINTS&&(d=1);for(let u=0;u<c;u+=d){for(let h=0;h<d;++h){let p=a[u+h],g=i[p];l(g)||(g=r++,i[p]=g,PZe(s,e.attributes,p)),o.push(g)}r+d>=W.SIXTY_FOUR_KILOBYTES&&(t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Bee(e.attributes))}o.length!==0&&t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Oee=new m,vZe=new he;Ac.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ei;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u<a.length;u+=3){let h=m.fromArray(a,u,Oee),p=s.cartesianToCartographic(h,vZe),g=o.project(p,Oee);c[d++]=g.x,c[d++]=g.y,c[d++]=g.z}return e.attributes[n]=r,e.attributes[i]=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var rY={high:0,low:0};Ac.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let u=0;u<s;++u)On.encode(r[u],rY),a[u]=rY.high,c[u]=rY.low;let d=o.componentsPerAttribute;return e.attributes[n]=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:a}),e.attributes[i]=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var Xm=new m;function sY(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Xm),A.multiplyByPoint(e,Xm,Xm),m.pack(Xm,n,o)}}function aY(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Xm),$.multiplyByVector(e,Xm,Xm),Xm=m.normalize(Xm,Xm),m.pack(Xm,n,o)}}var UN=new A,DN=new $;Ac.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;let n=e.geometry.attributes;sY(t,n.position),sY(t,n.prevPosition),sY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(A.inverse(t,UN),A.transpose(UN,UN),A.getMatrix3(UN,DN),aY(DN,n.normal),aY(DN,n.tangent),aY(DN,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=A.clone(A.IDENTITY),e};function wZe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let d=1;d<n;++d){let u=e[d][t].attributes[r];if(!l(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){c=!1;break}a+=u.values.length}c&&(i[r]=new Ge({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Q.createTypedArray(s.componentDatatype,a)}))}return i}var FZe=new m;function cY(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),d=e[0][t].primitiveType,u=wZe(e,t),h,p,g;for(i in u)if(u.hasOwnProperty(i))for(h=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)h[s++]=p[r];let f;if(c){let V=0;for(o=0;o<n;++o)V+=e[o][t].indices.length;let L=lt.computeNumberOfVertices(new lt({attributes:u,primitiveType:we.POINTS})),R=Ae.createTypedArray(L,V),G=0,I=0;for(o=0;o<n;++o){let v=e[o][t].indices,P=v.length;for(s=0;s<P;++s)R[G++]=I+v[s];I+=lt.computeNumberOfVertices(e[o][t])}f=R}let x=new m,_=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!l(C)){x=void 0;break}m.add(C.center,x,x)}if(l(x))for(m.divideByScalar(x,n,x),o=0;o<n;++o){C=e[o][t].boundingSphere;let V=m.magnitude(m.subtract(C.center,x,FZe))+C.radius;V>_&&(_=V)}return new lt({attributes:u,indices:f,primitiveType:d,boundingSphere:l(x)?new le(x,_):void 0})}Ac.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(cY(t,"geometry")),n.length>0&&(o.push(cY(n,"westHemisphereGeometry")),o.push(cY(n,"eastHemisphereGeometry"))),o};var _u=new m,yR=new m,qS=new m,$S=new m;Ac.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d<o;d++)s[d]={indexOffset:0,count:0,currentCount:0};let u=0;for(d=0;d<r;d+=3){let f=t[d],x=t[d+1],_=t[d+2],C=f*3,V=x*3,L=_*3;yR.x=i[C],yR.y=i[C+1],yR.z=i[C+2],qS.x=i[V],qS.y=i[V+1],qS.z=i[V+2],$S.x=i[L],$S.y=i[L+1],$S.z=i[L+2],s[f].count++,s[x].count++,s[_].count++,m.subtract(qS,yR,qS),m.subtract($S,yR,$S),a[u]=m.cross(qS,$S,new m),u++}let h=0;for(d=0;d<o;d++)s[d].indexOffset+=h,h+=s[d].count;u=0;let p;for(d=0;d<r;d+=3){p=s[t[d]];let f=p.indexOffset+p.currentCount;c[f]=u,p.currentCount++,p=s[t[d+1]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,p=s[t[d+2]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,u++}let g=new Float32Array(o*3);for(d=0;d<o;d++){let f=d*3;if(p=s[d],m.clone(m.ZERO,_u),p.count>0){for(u=0;u<p.count;u++)m.add(_u,a[c[p.indexOffset+u]],_u);m.equalsEpsilon(m.ZERO,_u,W.EPSILON10)&&m.clone(a[c[p.indexOffset]],_u)}m.equalsEpsilon(m.ZERO,_u,W.EPSILON10)&&(_u.z=1),m.normalize(_u,_u),g[f]=_u.x,g[f+1]=_u.y,g[f+2]=_u.z}return e.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e};var AZe=new m,Yee=new m,MZe=new m;Ac.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),d;for(d=0;d<c.length;d++)c[d]=0;let u,h,p;for(d=0;d<a;d+=3){let x=n[d],_=n[d+1],C=n[d+2];u=x*3,h=_*3,p=C*3;let V=x*2,L=_*2,R=C*2,G=i[u],I=i[u+1],v=i[u+2],P=r[V],w=r[V+1],M=r[L+1]-w,b=r[R+1]-w,Z=1/((r[L]-P)*b-(r[R]-P)*M),E=(b*(i[h]-G)-M*(i[p]-G))*Z,X=(b*(i[h+1]-I)-M*(i[p+1]-I))*Z,F=(b*(i[h+2]-v)-M*(i[p+2]-v))*Z;c[u]+=E,c[u+1]+=X,c[u+2]+=F,c[h]+=E,c[h+1]+=X,c[h+2]+=F,c[p]+=E,c[p+1]+=X,c[p+2]+=F}let g=new Float32Array(s*3),f=new Float32Array(s*3);for(d=0;d<s;d++){u=d*3,h=u+1,p=u+2;let x=m.fromArray(o,u,AZe),_=m.fromArray(c,u,MZe),C=m.dot(x,_);m.multiplyByScalar(x,C,Yee),m.normalize(m.subtract(_,Yee,_),_),g[u]=_.x,g[h]=_.y,g[p]=_.z,m.normalize(m.cross(x,_,_),_),f[u]=_.x,f[h]=_.y,f[p]=_.z}return e.attributes.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f}),e};var xR=new D,Im=new m,Hee=new m,zee=new m,BN=new D;Ac.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let I=t.values;i=I.length/3;let v=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(m.fromArray(I,n*3,Im),m.equals(Im,m.ZERO)){P+=2;continue}BN=wn.octEncodeInRange(Im,65535,BN),v[P++]=BN.x,v[P++]=BN.y}return e.attributes.compressedAttributes=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:v}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,d=e.attributes.bitangent,u=l(c),h=l(d),p,g,f,x;s&&(p=o.values),a&&(g=r.values),u&&(f=c.values),h&&(x=d.values),i=(s?p.length:g.length)/(s?3:2);let V=i,L=a&&s?2:1;L+=u||h?1:0,V*=L;let R=new Float32Array(V),G=0;for(n=0;n<i;++n){a&&(D.fromArray(g,n*2,xR),R[G++]=wn.compressTextureCoordinates(xR));let I=n*3;s&&l(f)&&l(x)?(m.fromArray(p,I,Im),m.fromArray(f,I,Hee),m.fromArray(x,I,zee),wn.octPack(Im,Hee,zee,xR),R[G++]=xR.x,R[G++]=xR.y):(s&&(m.fromArray(p,I,Im),R[G++]=wn.octEncodeFloat(Im)),u&&(m.fromArray(f,I,Im),R[G++]=wn.octEncodeFloat(Im)),h&&(m.fromArray(x,I,Im),R[G++]=wn.octEncodeFloat(Im)))}return e.attributes.compressedAttributes=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:L,values:R}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function NZe(e){if(l(e.indices))return e;let t=lt.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function kZe(e){let t=lt.computeNumberOfVertices(e),n=Ae.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=we.TRIANGLES,e}function UZe(e){let t=lt.computeNumberOfVertices(e),n=Ae.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=we.TRIANGLES,e}function DZe(e){if(l(e.indices))return e;let t=lt.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function BZe(e){let t=lt.computeNumberOfVertices(e),n=Ae.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=we.LINES,e}function OZe(e){let t=lt.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=we.LINES,e}function YZe(e){switch(e.primitiveType){case we.TRIANGLE_FAN:return kZe(e);case we.TRIANGLE_STRIP:return UZe(e);case we.TRIANGLES:return NZe(e);case we.LINE_STRIP:return BZe(e);case we.LINE_LOOP:return OZe(e);case we.LINES:return DZe(e)}return e}function U0(e,t){Math.abs(e.y)<W.EPSILON6&&(t?e.y=-W.EPSILON6:e.y=W.EPSILON6)}function HZe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){U0(e,e.y<0),U0(t,t.y<0),U0(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;U0(e,a),U0(t,a),U0(n,a)}var Kee=new m;function Tu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,Kee),e.y/(e.y-t.y),Kee),n),m.clone(n,i),U0(n,!0),U0(i,!1)}var gx=new m,yx=new m,xx=new m,_x=new m,lY={positions:new Array(7),indices:new Array(3*3)};function zZe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;HZe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=lY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Tu(e,t,gx,xx),Tu(e,n,yx,_x),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Tu(t,n,gx,xx),Tu(t,e,yx,_x),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Tu(n,e,gx,xx),Tu(n,t,yx,_x),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Tu(n,e,gx,xx),Tu(n,t,yx,_x),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Tu(t,n,gx,xx),Tu(t,e,yx,_x),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Tu(e,t,gx,xx),Tu(e,n,yx,_x),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=lY.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=gx,c[4]=yx,c[5]=xx,c[6]=_x,c.length=7),lY}function Jee(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=lt.computeNumberOfVertices(e);return e.indices=Ae.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function tC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Ge({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new lt({attributes:n,indices:[],primitiveType:e.primitiveType})}function hY(e,t,n){let i=l(e.geometry.boundingSphere);t=Jee(t,i),n=Jee(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function fY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,h,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),x=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(g,f,g);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,h*t)}}var KZe=fY(se,4),HN=fY(m,3),tte=fY(D,2),JZe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},_R=new m,dY=new m,uY=new m,QZe=new m;function ON(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let _=m.fromArray(o,e*3,_R),C=m.fromArray(o,t*3,dY),V=m.fromArray(o,n*3,uY),L=fx(i,_,C,V,QZe);if(l(L)){if(l(r)&&HN(e,t,n,L,r,h.normal.values,x,!0),l(d)){let R=m.fromArray(d,e*3,_R),G=m.fromArray(d,t*3,dY),I=m.fromArray(d,n*3,uY);m.multiplyByScalar(R,L.x,R),m.multiplyByScalar(G,L.y,G),m.multiplyByScalar(I,L.z,I);let v;!m.equals(R,m.ZERO)||!m.equals(G,m.ZERO)||!m.equals(I,m.ZERO)?(v=m.add(R,G,R),m.add(v,I,v),m.normalize(v,v)):(v=_R,v.x=0,v.y=0,v.z=0),m.pack(v,h.extrudeDirection.values,x*3)}if(l(u)&&JZe(e,t,n,L,u,h.applyOffset.values,x),l(s)&&HN(e,t,n,L,s,h.tangent.values,x,!0),l(a)&&HN(e,t,n,L,a,h.bitangent.values,x,!0),l(c)&&tte(e,t,n,L,c,h.st.values,x),g>0)for(let R=0;R<g;R++){let G=p[R];jZe(e,t,n,L,x,f[G],h[G])}}}function jZe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,d=s.values;switch(a){case 4:KZe(e,t,n,i,c,d,o,!1);break;case 3:HN(e,t,n,i,c,d,o,!1);break;case 2:tte(e,t,n,i,c,d,o,!1);break;default:d[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function lf(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var qZe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Qee(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,d=l(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,h=[];for(let v in n)n.hasOwnProperty(v)&&!qZe[v]&&l(n[v])&&h.push(v);let p=h.length,g=tC(t),f=tC(t),x,_,C,V,L,R=[];R.length=i.length/3;let G=[];for(G.length=i.length/3,L=0;L<R.length;++L)R[L]=-1,G[L]=-1;let I=u.length;for(L=0;L<I;L+=3){let v=u[L],P=u[L+1],w=u[L+2],M=m.fromArray(i,v*3),b=m.fromArray(i,P*3),Z=m.fromArray(i,w*3),E=zZe(M,b,Z);if(l(E)&&E.positions.length>3){let X=E.positions,F=E.indices,N=F.length;for(let O=0;O<N;++O){let U=F[O],Y=X[U];Y.y<0?(x=f.attributes,_=f.indices,C=R):(x=g.attributes,_=g.indices,C=G),V=lf(x,_,C,u,U<3?L+U:-1,Y),ON(v,P,w,Y,i,o,s,r,a,c,d,x,h,p,n,V)}}else l(E)&&(M=E.positions[0],b=E.positions[1],Z=E.positions[2]),M.y<0?(x=f.attributes,_=f.indices,C=R):(x=g.attributes,_=g.indices,C=G),V=lf(x,_,C,u,L,M),ON(v,P,w,M,i,o,s,r,a,c,d,x,h,p,n,V),V=lf(x,_,C,u,L+1,b),ON(v,P,w,b,i,o,s,r,a,c,d,x,h,p,n,V),V=lf(x,_,C,u,L+2,Z),ON(v,P,w,Z,i,o,s,r,a,c,d,x,h,p,n,V)}hY(e,f,g)}var nte=sn.fromPointNormal(m.ZERO,m.UNIT_Y),$Ze=new m,eGe=new m;function eC(e,t,n,i,o,r,s){if(!l(s))return;let a=m.fromArray(i,e*3,_R);m.equalsEpsilon(a,n,W.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function jee(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=tC(t),a=tC(t),c,d=r.length,u=[];u.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<u.length;++c)u[c]=-1,h[c]=-1;for(c=0;c<d;c+=2){let p=r[c],g=r[c+1],f=m.fromArray(i,p*3,_R),x=m.fromArray(i,g*3,dY),_;Math.abs(f.y)<W.EPSILON6&&(f.y<0?f.y=-W.EPSILON6:f.y=W.EPSILON6),Math.abs(x.y)<W.EPSILON6&&(x.y<0?x.y=-W.EPSILON6:x.y=W.EPSILON6);let C=s.attributes,V=s.indices,L=h,R=a.attributes,G=a.indices,I=u,v=qn.lineSegmentPlane(f,x,nte,uY);if(l(v)){let P=m.multiplyByScalar(m.UNIT_Y,5*W.EPSILON9,$Ze);f.y<0&&(m.negate(P,P),C=a.attributes,V=a.indices,L=u,R=s.attributes,G=s.indices,I=h);let w=m.add(v,P,eGe);_=lf(C,V,L,r,c,f),eC(p,g,f,i,_,C,o),_=lf(C,V,L,r,-1,w),eC(p,g,w,i,_,C,o),m.negate(P,P),m.add(v,P,w),_=lf(R,G,I,r,-1,w),eC(p,g,w,i,_,R,o),_=lf(R,G,I,r,c+1,x),eC(p,g,x,i,_,R,o)}else{let P,w,M;f.y<0?(P=a.attributes,w=a.indices,M=u):(P=s.attributes,w=s.indices,M=h),_=lf(P,w,M,r,c,f),eC(p,g,f,i,_,P,o),_=lf(P,w,M,r,c+1,x),eC(p,g,x,i,_,P,o)}}hY(e,a,s)}var qee=new D,tGe=new D,ite=new m,ote=new m,mY=new m,nGe=new m,iGe=new m,oGe=new m,$ee=new se;function ete(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=m.unpack(n,s,ite);if(a.x>0)continue;let c=m.unpack(i,s,ote);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let d=m.unpack(o,s,mY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):m.pack(a,o,s))}}var rGe=5*W.EPSILON9,YN=W.EPSILON6;function sGe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,d=tC(t),u=tC(t),h,p,g,f=!1,x=i.length/3;for(h=0;h<x;h+=4){let _=h,C=h+2,V=m.fromArray(i,_*3,ite),L=m.fromArray(i,C*3,ote);if(Math.abs(V.y)<YN)for(V.y=YN*(L.y<0?-1:1),i[h*3+1]=V.y,i[(h+1)*3+1]=V.y,p=_*3;p<_*3+4*3;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(L.y)<YN)for(L.y=YN*(V.y<0?-1:1),i[(h+2)*3+1]=L.y,i[(h+3)*3+1]=L.y,p=_*3;p<_*3+4*3;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let R=d.attributes,G=d.indices,I=u.attributes,v=u.indices,P=qn.lineSegmentPlane(V,L,nte,nGe);if(l(P)){f=!0;let w=m.multiplyByScalar(m.UNIT_Y,rGe,iGe);V.y<0&&(m.negate(w,w),R=u.attributes,G=u.indices,I=d.attributes,v=d.indices);let M=m.add(P,w,oGe);R.position.values.push(V.x,V.y,V.z,V.x,V.y,V.z),R.position.values.push(M.x,M.y,M.z),R.position.values.push(M.x,M.y,M.z),R.prevPosition.values.push(o[_*3],o[_*3+1],o[_*3+2]),R.prevPosition.values.push(o[_*3+3],o[_*3+4],o[_*3+5]),R.prevPosition.values.push(V.x,V.y,V.z,V.x,V.y,V.z),R.nextPosition.values.push(M.x,M.y,M.z),R.nextPosition.values.push(M.x,M.y,M.z),R.nextPosition.values.push(M.x,M.y,M.z),R.nextPosition.values.push(M.x,M.y,M.z),m.negate(w,w),m.add(P,w,M),I.position.values.push(M.x,M.y,M.z),I.position.values.push(M.x,M.y,M.z),I.position.values.push(L.x,L.y,L.z,L.x,L.y,L.z),I.prevPosition.values.push(M.x,M.y,M.z),I.prevPosition.values.push(M.x,M.y,M.z),I.prevPosition.values.push(M.x,M.y,M.z),I.prevPosition.values.push(M.x,M.y,M.z),I.nextPosition.values.push(L.x,L.y,L.z,L.x,L.y,L.z),I.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),I.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let b=D.fromArray(s,_*2,qee),Z=Math.abs(b.y);R.expandAndWidth.values.push(-1,Z,1,Z),R.expandAndWidth.values.push(-1,-Z,1,-Z),I.expandAndWidth.values.push(-1,Z,1,Z),I.expandAndWidth.values.push(-1,-Z,1,-Z);let E=m.magnitudeSquared(m.subtract(P,V,mY));if(E/=m.magnitudeSquared(m.subtract(L,V,mY)),l(c)){let X=se.fromArray(c,_*4,$ee),F=se.fromArray(c,C*4,$ee),N=W.lerp(X.x,F.x,E),O=W.lerp(X.y,F.y,E),U=W.lerp(X.z,F.z,E),Y=W.lerp(X.w,F.w,E);for(p=_*4;p<_*4+2*4;++p)R.color.values.push(c[p]);for(R.color.values.push(N,O,U,Y),R.color.values.push(N,O,U,Y),I.color.values.push(N,O,U,Y),I.color.values.push(N,O,U,Y),p=C*4;p<C*4+2*4;++p)I.color.values.push(c[p])}if(l(a)){let X=D.fromArray(a,_*2,qee),F=D.fromArray(a,(h+3)*2,tGe),N=W.lerp(X.x,F.x,E);for(p=_*2;p<_*2+2*2;++p)R.st.values.push(a[p]);for(R.st.values.push(N,X.y),R.st.values.push(N,F.y),I.st.values.push(N,X.y),I.st.values.push(N,F.y),p=C*2;p<C*2+2*2;++p)I.st.values.push(a[p])}g=R.position.values.length/3-4,G.push(g,g+2,g+1),G.push(g+1,g+2,g+3),g=I.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3)}else{let w,M;for(V.y<0?(w=u.attributes,M=u.indices):(w=d.attributes,M=d.indices),w.position.values.push(V.x,V.y,V.z),w.position.values.push(V.x,V.y,V.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),p=h*3;p<h*3+4*3;++p)w.prevPosition.values.push(o[p]),w.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)w.expandAndWidth.values.push(s[p]),l(a)&&w.st.values.push(a[p]);if(l(c))for(p=h*4;p<h*4+4*4;++p)w.color.values.push(c[p]);g=w.position.values.length/3-4,M.push(g,g+2,g+1),M.push(g+1,g+2,g+3)}}f&&(ete(u),ete(d)),hY(e,u,d)}Ac.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==Ht.INTERSECTING))return e;if(t.geometryType!==xu.NONE)switch(t.geometryType){case xu.POLYLINES:sGe(e);break;case xu.TRIANGLES:Qee(e);break;case xu.LINES:jee(e);break}else YZe(t),t.primitiveType===we.TRIANGLES?Qee(e):t.primitiveType===we.LINES&&jee(e);return e};var Fn=Ac;var Kvt=T(S(),1);function TR(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(TR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});TR.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=4;l(u)&&(C=it.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,C),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){let L;t===0&&n===0&&r===h&&s===h?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=it.flipY(u,p,f,h,h)),L=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),L=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),L=it.createTypedArray(p,f,h,h)),a.texImage2D(d,0,g,h,h,0,p,je.toWebGLConstant(f,this._context),L),this._initialized=!0}V||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=it.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,je.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,je.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};TR.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};TR.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var SR=TR;var jvt=T(S(),1);var KN={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===KN.DONT_CARE||e===KN.FASTEST||e===KN.NICEST}},df=Object.freeze(KN);var hwt=T(S(),1);var ewt=T(S(),1);var JN={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};JN.validate=function(e){return e===JN.NEAREST||e===JN.LINEAR};var hi=Object.freeze(JN);var iwt=T(S(),1);var D0={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};D0.validate=function(e){return e===D0.NEAREST||e===D0.LINEAR||e===D0.NEAREST_MIPMAP_NEAREST||e===D0.LINEAR_MIPMAP_NEAREST||e===D0.NEAREST_MIPMAP_LINEAR||e===D0.LINEAR_MIPMAP_LINEAR};var jt=Object.freeze(D0);var swt=T(S(),1);var QN={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===QN.CLAMP_TO_EDGE||e===QN.REPEAT||e===QN.MIRRORED_REPEAT}},Vn=Object.freeze(QN);function CR(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Vn.CLAMP_TO_EDGE,wrapT:n=Vn.CLAMP_TO_EDGE,minificationFilter:i=jt.LINEAR,magnificationFilter:o=hi.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(CR.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});CR.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};CR.NEAREST=Object.freeze(new CR({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST}));var qt=CR;var Rwt=T(S(),1);function aGe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,Q.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function ste(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,d=!1,u=i.length;for(r=0;r<u;++r)aGe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Q.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(d=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),ste(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function rte(e){return e.values.length/e.componentsPerAttribute}function cGe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function lGe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=rte(e[o[0]]),t=1;t<s;++t){let d=rte(e[o[t]]);if(d!==r)throw new ae(`Each attribute list must have the same number of vertices.  Attribute ${o[t]} has a different number of vertices (${d.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(d,u){return Q.getSizeInBytes(e[u].componentDatatype)-Q.getSizeInBytes(e[d].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=cGe(i);if(a>0){let d=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let f=Q.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Q.createTypedArray(e[n].componentDatatype,p),index:c[n]/f,strideInComponentType:a/f}}for(t=0;t<r;++t)for(let f=0;f<s;++f){n=o[f],i=e[n];let x=i.values,_=g[n],C=_.pointer,V=i.componentsPerAttribute;for(let L=0;L<V;++L)C[_.index+L]=x[t*V+L];_.index+=_.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Ip.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Me.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,d,u=l(s)?s:[],h=n.attributes;if(r){let f=lGe(h);if(l(f)){d=xt.createVertexBuffer({context:t,typedArray:f.buffer,usage:i});let x=f.offsetsInBytes,_=f.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&l(h[a])&&(c=h[a],l(c.values)?u.push({index:o[a],vertexBuffer:d,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:_}):u.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&l(h[a])){c=h[a];let f=c.componentDatatype;f===Q.DOUBLE&&(f=Q.FLOAT),d=void 0,l(c.values)&&(d=xt.createVertexBuffer({context:t,typedArray:Q.createTypedArray(f,c.values),usage:i})),u.push({index:o[a],vertexBuffer:d,value:c.value,componentDatatype:f,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(lt.computeNumberOfVertices(n)>=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=xt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ae.UNSIGNED_INT}):p=xt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ae.UNSIGNED_SHORT})),new Ip({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Ip.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ip.prototype.getAttribute=function(e){return this._attributes[e]};function dGe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=At.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let d=c.instanceDivisor,u=c.index;d!==i[u]&&(t.glVertexAttribDivisor(u,d),i[u]=d)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function uGe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}Ip.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&dGe(this),this._hasConstantAttributes&&uGe(this,this._gl)):ste(this._gl,this._attributes,this._indexBuffer)};Ip.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Ip.prototype.isDestroyed=function(){return!1};Ip.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),me(this)};var ni=Ip;function Ko(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=it.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new qt}=e,c=e.preMultiplyAlpha||i===it.RGB||i===it.LUMINANCE,{width:d,height:u}=e;l(n)&&({width:d,height:u}=n.positiveX);let h=d,p=it.textureSizeInBytes(i,o,h,h)*6,g=it.toInternalFormat(i,o,t),f=t._gl,x=f.TEXTURE_CUBE_MAP,_=f.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=_,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let C=l(n);function V(L){return new SR(t,_,x,L,g,i,o,h,c,r,C)}this._positiveX=V(f.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=V(f.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=V(f.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=V(f.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=V(f.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=V(f.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,ate(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(x,_),s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);for(let L of Ko.faceNames())pY(this[L],n?.[L],0);f.bindTexture(x,null)}Ko.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Wr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,y(i,0)),r._unBind(),r.destroy()};Ko.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*mGe(){yield Ko.FaceName.POSITIVEX,yield Ko.FaceName.NEGATIVEX,yield Ko.FaceName.POSITIVEY,yield Ko.FaceName.NEGATIVEY,yield Ko.FaceName.POSITIVEZ,yield Ko.FaceName.NEGATIVEZ}Ko.faceNames=function(){return mGe()};function pY(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,d=e._preMultiplyAlpha,u=e._context,h=u._gl;if(!l(t)){h.texImage2D(i,n,a,o,o,0,r,je.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=it.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=it.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,je.toWebGLConstant(s,u),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,a,r,je.toWebGLConstant(s,u),t))}Ko.loadFace=pY;Object.defineProperties(Ko.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){ate(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Ko.getDirection=function(e,t){switch(e){case Ko.FaceName.POSITIVEX:return m.clone(m.UNIT_X,t);case Ko.FaceName.NEGATIVEX:return m.negate(m.UNIT_X,t);case Ko.FaceName.POSITIVEY:return m.clone(m.UNIT_Y,t);case Ko.FaceName.NEGATIVEY:return m.negate(m.UNIT_Y,t);case Ko.FaceName.POSITIVEZ:return m.clone(m.UNIT_Z,t);case Ko.FaceName.NEGATIVEZ:return m.negate(m.UNIT_Z,t)}};function ate(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[jt.NEAREST_MIPMAP_NEAREST,jt.NEAREST_MIPMAP_LINEAR,jt.LINEAR_MIPMAP_NEAREST,jt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===je.FLOAT&&!r.textureFloatLinear||s===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?jt.NEAREST_MIPMAP_NEAREST:jt.NEAREST,i=hi.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Ko.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Ko.faceNames())pY(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Ko.prototype.generateMipmap=function(e){e=y(e,df.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Ko.createVertexArray=function(e){let t=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY})),n=this._attributeLocations=Fn.createAttributeLocations(t);return ni.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Ko.prototype.isDestroyed=function(){return!1};Ko.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=me(this._positiveX),this._negativeX=me(this._negativeX),this._positiveY=me(this._positiveY),this._negativeY=me(this._negativeY),this._positiveZ=me(this._positiveZ),this._negativeZ=me(this._negativeZ),me(this)};var xr=Ko;var zwt=T(S(),1);function hGe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var oc=hGe;var kUt=T(S(),1);var vUt=T(S(),1);var LUt=T(S(),1);var Jwt=T(S(),1),VR=`/**
 * A built-in GLSL floating-point constant for converting radians to degrees.
 *
 * @alias czm_degreesPerRadian
 * @glslConstant
 *
 * @see CesiumMath.DEGREES_PER_RADIAN
 *
 * @example
 * // GLSL declaration
 * const float czm_degreesPerRadian = ...;
 *
 * // Example
 * float deg = czm_degreesPerRadian * rad;
 */
const float czm_degreesPerRadian = 57.29577951308232;
`;var jwt=T(S(),1),LR=`/**
 * A built-in GLSL vec2 constant for defining the depth range.
 * This is a workaround to a bug where IE11 does not implement gl_DepthRange.
 *
 * @alias czm_depthRange
 * @glslConstant
 *
 * @example
 * // GLSL declaration
 * float depthRangeNear = czm_depthRange.near;
 * float depthRangeFar = czm_depthRange.far;
 *
 */
const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
`;var $wt=T(S(),1),RR=`/**
 * 0.1
 *
 * @name czm_epsilon1
 * @glslConstant
 */
const float czm_epsilon1 = 0.1;
`;var tFt=T(S(),1),ZR=`/**
 * 0.01
 *
 * @name czm_epsilon2
 * @glslConstant
 */
const float czm_epsilon2 = 0.01;
`;var iFt=T(S(),1),GR=`/**
 * 0.001
 *
 * @name czm_epsilon3
 * @glslConstant
 */
const float czm_epsilon3 = 0.001;
`;var rFt=T(S(),1),ER=`/**
 * 0.0001
 *
 * @name czm_epsilon4
 * @glslConstant
 */
const float czm_epsilon4 = 0.0001;
`;var aFt=T(S(),1),IR=`/**
 * 0.00001
 *
 * @name czm_epsilon5
 * @glslConstant
 */
const float czm_epsilon5 = 0.00001;
`;var lFt=T(S(),1),XR=`/**
 * 0.000001
 *
 * @name czm_epsilon6
 * @glslConstant
 */
const float czm_epsilon6 = 0.000001;
`;var uFt=T(S(),1),WR=`/**
 * 0.0000001
 *
 * @name czm_epsilon7
 * @glslConstant
 */
const float czm_epsilon7 = 0.0000001;
`;var hFt=T(S(),1),PR=`/**
 * DOC_TBA
 *
 * @name czm_infinity
 * @glslConstant
 */
const float czm_infinity = 5906376272000.0;  // Distance from the Sun to Pluto in meters.  TODO: What is best given lowp, mediump, and highp?
`;var pFt=T(S(),1),vR=`/**
 * A built-in GLSL floating-point constant for <code>1/pi</code>.
 *
 * @alias czm_oneOverPi
 * @glslConstant
 *
 * @see CesiumMath.ONE_OVER_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_oneOverPi = ...;
 *
 * // Example
 * float pi = 1.0 / czm_oneOverPi;
 */
const float czm_oneOverPi = 0.3183098861837907;
`;var gFt=T(S(),1),wR=`/**
 * A built-in GLSL floating-point constant for <code>1/2pi</code>.
 *
 * @alias czm_oneOverTwoPi
 * @glslConstant
 *
 * @see CesiumMath.ONE_OVER_TWO_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_oneOverTwoPi = ...;
 *
 * // Example
 * float pi = 2.0 * czm_oneOverTwoPi;
 */
const float czm_oneOverTwoPi = 0.15915494309189535;
`;var xFt=T(S(),1),FR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
 *
 * @name czm_passCesium3DTile
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTile = 4.0;
`;var TFt=T(S(),1),AR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
 *
 * @name czm_passCesium3DTileClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileClassification = 5.0;
`;var CFt=T(S(),1),MR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
 *
 * @name czm_passCesium3DTileClassificationIgnoreShow
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
`;var LFt=T(S(),1),NR=`/**
 * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
 *
 * @name czm_passClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passClassification = 7.0;
`;var ZFt=T(S(),1),kR=`/**
 * The automatic GLSL constant for {@link Pass#COMPUTE}
 *
 * @name czm_passCompute
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCompute = 1.0;
`;var EFt=T(S(),1),UR=`/**
 * The automatic GLSL constant for {@link Pass#ENVIRONMENT}
 *
 * @name czm_passEnvironment
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passEnvironment = 0.0;
`;var XFt=T(S(),1),DR=`/**
 * The automatic GLSL constant for {@link Pass#GLOBE}
 *
 * @name czm_passGlobe
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passGlobe = 2.0;
`;var PFt=T(S(),1),BR=`/**
 * The automatic GLSL constant for {@link Pass#OPAQUE}
 *
 * @name czm_passOpaque
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOpaque = 7.0;
`;var wFt=T(S(),1),OR=`/**
 * The automatic GLSL constant for {@link Pass#OVERLAY}
 *
 * @name czm_passOverlay
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOverlay = 10.0;
`;var AFt=T(S(),1),YR=`/**
 * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
 *
 * @name czm_passTerrainClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTerrainClassification = 3.0;
`;var NFt=T(S(),1),HR=`/**
 * The automatic GLSL constant for {@link Pass#TRANSLUCENT}
 *
 * @name czm_passTranslucent
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTranslucent = 8.0;
`;var UFt=T(S(),1),zR=`/**
 * The automatic GLSL constant for {@link Pass#VOXELS}
 *
 * @name czm_passVoxels
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passVoxels = 9.0;
`;var BFt=T(S(),1),KR=`/**
 * A built-in GLSL floating-point constant for <code>Math.PI</code>.
 *
 * @alias czm_pi
 * @glslConstant
 *
 * @see CesiumMath.PI
 *
 * @example
 * // GLSL declaration
 * const float czm_pi = ...;
 *
 * // Example
 * float twoPi = 2.0 * czm_pi;
 */
const float czm_pi = 3.141592653589793;
`;var YFt=T(S(),1),JR=`/**
 * A built-in GLSL floating-point constant for <code>pi/4</code>.
 *
 * @alias czm_piOverFour
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_FOUR
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverFour = ...;
 *
 * // Example
 * float pi = 4.0 * czm_piOverFour;
 */
const float czm_piOverFour = 0.7853981633974483;
`;var zFt=T(S(),1),QR=`/**
 * A built-in GLSL floating-point constant for <code>pi/6</code>.
 *
 * @alias czm_piOverSix
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_SIX
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverSix = ...;
 *
 * // Example
 * float pi = 6.0 * czm_piOverSix;
 */
const float czm_piOverSix = 0.5235987755982988;
`;var JFt=T(S(),1),jR=`/**
 * A built-in GLSL floating-point constant for <code>pi/3</code>.
 *
 * @alias czm_piOverThree
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_THREE
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverThree = ...;
 *
 * // Example
 * float pi = 3.0 * czm_piOverThree;
 */
const float czm_piOverThree = 1.0471975511965976;
`;var jFt=T(S(),1),qR=`/**
 * A built-in GLSL floating-point constant for <code>pi/2</code>.
 *
 * @alias czm_piOverTwo
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_TWO
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverTwo = ...;
 *
 * // Example
 * float pi = 2.0 * czm_piOverTwo;
 */
const float czm_piOverTwo = 1.5707963267948966;
`;var $Ft=T(S(),1),$R=`/**
 * A built-in GLSL floating-point constant for converting degrees to radians.
 *
 * @alias czm_radiansPerDegree
 * @glslConstant
 *
 * @see CesiumMath.RADIANS_PER_DEGREE
 *
 * @example
 * // GLSL declaration
 * const float czm_radiansPerDegree = ...;
 *
 * // Example
 * float rad = czm_radiansPerDegree * deg;
 */
const float czm_radiansPerDegree = 0.017453292519943295;
`;var tAt=T(S(),1),eZ=`/**
 * The constant identifier for the 2D {@link SceneMode}
 *
 * @name czm_sceneMode2D
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneModeColumbusView
 * @see czm_sceneMode3D
 * @see czm_sceneModeMorphing
 */
const float czm_sceneMode2D = 2.0;
`;var iAt=T(S(),1),tZ=`/**
 * The constant identifier for the 3D {@link SceneMode}
 *
 * @name czm_sceneMode3D
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneModeColumbusView
 * @see czm_sceneModeMorphing
 */
const float czm_sceneMode3D = 3.0;
`;var rAt=T(S(),1),nZ=`/**
 * The constant identifier for the Columbus View {@link SceneMode}
 *
 * @name czm_sceneModeColumbusView
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneMode3D
 * @see czm_sceneModeMorphing
 */
const float czm_sceneModeColumbusView = 1.0;
`;var aAt=T(S(),1),iZ=`/**
 * The constant identifier for the Morphing {@link SceneMode}
 *
 * @name czm_sceneModeMorphing
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneModeColumbusView
 * @see czm_sceneMode3D
 */
const float czm_sceneModeMorphing = 0.0;
`;var lAt=T(S(),1),oZ=`/**
 * A built-in GLSL floating-point constant for one solar radius.
 *
 * @alias czm_solarRadius
 * @glslConstant
 *
 * @see CesiumMath.SOLAR_RADIUS
 *
 * @example
 * // GLSL declaration
 * const float czm_solarRadius = ...;
 */
const float czm_solarRadius = 695500000.0;
`;var uAt=T(S(),1),rZ=`/**
 * A built-in GLSL floating-point constant for <code>3pi/2</code>.
 *
 * @alias czm_threePiOver2
 * @glslConstant
 *
 * @see CesiumMath.THREE_PI_OVER_TWO
 *
 * @example
 * // GLSL declaration
 * const float czm_threePiOver2 = ...;
 *
 * // Example
 * float pi = (2.0 / 3.0) * czm_threePiOver2;
 */
const float czm_threePiOver2 = 4.71238898038469;
`;var hAt=T(S(),1),sZ=`/**
 * A built-in GLSL floating-point constant for <code>2pi</code>.
 *
 * @alias czm_twoPi
 * @glslConstant
 *
 * @see CesiumMath.TWO_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_twoPi = ...;
 *
 * // Example
 * float pi = czm_twoPi / 2.0;
 */
const float czm_twoPi = 6.283185307179586;
`;var pAt=T(S(),1),aZ=`/**
 * The maximum latitude, in radians, both North and South, supported by a Web Mercator
 * (EPSG:3857) projection.  Technically, the Mercator projection is defined
 * for any latitude up to (but not including) 90 degrees, but it makes sense
 * to cut it off sooner because it grows exponentially with increasing latitude.
 * The logic behind this particular cutoff value, which is the one used by
 * Google Maps, Bing Maps, and Esri, is that it makes the projection
 * square.  That is, the rectangle is equal in the X and Y directions.
 *
 * The constant value is computed as follows:
 *   czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
 *
 * @name czm_webMercatorMaxLatitude
 * @glslConstant
 */
const float czm_webMercatorMaxLatitude = 1.4844222297453324;
`;var gAt=T(S(),1),cZ=`/**
 * @name czm_depthRangeStruct
 * @glslStruct
 */
struct czm_depthRangeStruct
{
    float near;
    float far;
};
`;var xAt=T(S(),1),lZ=`/**
 * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
 *
 * @name czm_material
 * @glslStruct
 *
 * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
 * @property {float} specular Intensity of incoming light reflecting in a single direction.
 * @property {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.
 * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
 * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
 * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
 */
struct czm_material
{
    vec3 diffuse;
    float specular;
    float shininess;
    vec3 normal;
    vec3 emission;
    float alpha;
};
`;var TAt=T(S(),1),dZ=`/**
 * Used as input to every material's czm_getMaterial function.
 *
 * @name czm_materialInput
 * @glslStruct
 *
 * @property {float} s 1D texture coordinates.
 * @property {vec2} st 2D texture coordinates.
 * @property {vec3} str 3D texture coordinates.
 * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
 * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
 * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates.  The magnitude is the distance in meters from the fragment to the eye.
 * @property {float} height The height of the terrain in meters above or below the ellipsoid.  Only available for globe materials.
 * @property {float} slope The slope of the terrain in radians.  0 is flat; pi/2 is vertical.  Only available for globe materials.
 * @property {float} aspect The aspect of the terrain in radians.  0 is East, pi/2 is North, pi is West, 3pi/2 is South.  Only available for globe materials.
* @property {float} waterMask The value of the water mask. 0 is land, 1 is water. Only available for globe materials.
 */
struct czm_materialInput
{
    float s;
    vec2 st;
    vec3 str;
    vec3 normalEC;
    mat3 tangentToEyeMatrix;
    vec3 positionToEyeEC;
    float height;
    float slope;
    float aspect;
    float waterMask;
};
`;var CAt=T(S(),1),uZ=`/**
 * Struct for representing a material for a {@link Model}. The model
 * rendering pipeline will pass this struct between material, custom shaders,
 * and lighting stages. This is not to be confused with {@link czm_material}
 * which is used by the older Fabric materials system, although they are similar.
 * <p>
 * All color values (diffuse, specular, emissive) are in linear color space.
 * </p>
 *
 * @name czm_modelMaterial
 * @glslStruct
 *
 * @property {vec4} baseColor The base color of the material.
 * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
 * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
 * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
 * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
 * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
 * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
 * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
 */
struct czm_modelMaterial {
    vec4 baseColor;
    vec3 diffuse;
    float alpha;
    vec3 specular;
    float roughness;
    vec3 normalEC;
    float occlusion;
    vec3 emissive;
#ifdef USE_SPECULAR
    float specularWeight;
#endif
#ifdef USE_ANISOTROPY
    vec3 anisotropicT;
    vec3 anisotropicB;
    float anisotropyStrength;
#endif
#ifdef USE_CLEARCOAT
    float clearcoatFactor;
    float clearcoatRoughness;
    vec3 clearcoatNormal;
    // Add clearcoatF0 when KHR_materials_ior is implemented
#endif
};
`;var LAt=T(S(),1),mZ=`/**
 * Struct for representing the output of a custom vertex shader.
 * 
 * @name czm_modelVertexOutput
 * @glslStruct
 *
 * @see {@link CustomShader}
 * @see {@link Model}
 *
 * @property {vec3} positionMC The position of the vertex in model coordinates
 * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. 
 */
struct czm_modelVertexOutput {
  vec3 positionMC;
  float pointSize;
};
`;var ZAt=T(S(),1),hZ=`/**
 * DOC_TBA
 *
 * @name czm_ray
 * @glslStruct
 */
struct czm_ray
{
    vec3 origin;
    vec3 direction;
};
`;var EAt=T(S(),1),fZ=`/**
 * DOC_TBA
 *
 * @name czm_raySegment
 * @glslStruct
 */
struct czm_raySegment
{
    float start;
    float stop;
};

/**
 * DOC_TBA
 *
 * @name czm_emptyRaySegment
 * @glslConstant 
 */
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);

/**
 * DOC_TBA
 *
 * @name czm_fullRaySegment
 * @glslConstant 
 */
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
`;var XAt=T(S(),1),pZ=`struct czm_shadowParameters
{
#ifdef USE_CUBE_MAP_SHADOW
    vec3 texCoords;
#else
    vec2 texCoords;
#endif

    float depthBias;
    float depth;
    float nDotL;
    vec2 texelStepSize;
    float normalShadingSmooth;
    float darkness;
};
`;var PAt=T(S(),1),bZ=`/**
 * Converts an HSB color (hue, saturation, brightness) to RGB
 * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
 *
 * @name czm_HSBToRGB
 * @glslFunction
 * 
 * @param {vec3} hsb The color in HSB.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 hsb = czm_RGBToHSB(rgb);
 * hsb.z *= 0.1;
 * rgb = czm_HSBToRGB(hsb);
 */

const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);

vec3 czm_HSBToRGB(vec3 hsb)
{
    vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
    return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
}
`;var wAt=T(S(),1),gZ=`/**
 * Converts an HSL color (hue, saturation, lightness) to RGB
 * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
 *
 * @name czm_HSLToRGB
 * @glslFunction
 * 
 * @param {vec3} rgb The color in HSL.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 hsl = czm_RGBToHSL(rgb);
 * hsl.z *= 0.1;
 * rgb = czm_HSLToRGB(hsl);
 */

vec3 hueToRGB(float hue)
{
    float r = abs(hue * 6.0 - 3.0) - 1.0;
    float g = 2.0 - abs(hue * 6.0 - 2.0);
    float b = 2.0 - abs(hue * 6.0 - 4.0);
    return clamp(vec3(r, g, b), 0.0, 1.0);
}

vec3 czm_HSLToRGB(vec3 hsl)
{
    vec3 rgb = hueToRGB(hsl.x);
    float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
    return (rgb - 0.5) * c + hsl.z;
}
`;var AAt=T(S(),1),yZ=`/**
 * Converts an RGB color to HSB (hue, saturation, brightness)
 * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
 *
 * @name czm_RGBToHSB
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in HSB.
 *
 * @example
 * vec3 hsb = czm_RGBToHSB(rgb);
 * hsb.z *= 0.1;
 * rgb = czm_HSBToRGB(hsb);
 */

const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);

vec3 czm_RGBToHSB(vec3 rgb)
{
    vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
    vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));

    float d = q.x - min(q.w, q.y);
    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
}
`;var NAt=T(S(),1),xZ=`/**
 * Converts an RGB color to HSL (hue, saturation, lightness)
 * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
 *
 * @name czm_RGBToHSL
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in HSL.
 *
 * @example
 * vec3 hsl = czm_RGBToHSL(rgb);
 * hsl.z *= 0.1;
 * rgb = czm_HSLToRGB(hsl);
 */
 
vec3 RGBtoHCV(vec3 rgb)
{
    // Based on work by Sam Hocevar and Emil Persson
    vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
    vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
    float c = q.x - min(q.w, q.y);
    float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
    return vec3(h, c, q.x);
}

vec3 czm_RGBToHSL(vec3 rgb)
{
    vec3 hcv = RGBtoHCV(rgb);
    float l = hcv.z - hcv.y * 0.5;
    float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
    return vec3(hcv.x, s, l);
}
`;var UAt=T(S(),1),_Z=`/**
 * Converts an RGB color to CIE Yxy.
 * <p>The conversion is described in
 * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
 * </p>
 * 
 * @name czm_RGBToXYZ
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in CIE Yxy.
 *
 * @example
 * vec3 xyz = czm_RGBToXYZ(rgb);
 * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
 * rgb = czm_XYZToRGB(xyz);
 */
vec3 czm_RGBToXYZ(vec3 rgb)
{
    const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
                              0.3576, 0.7152, 0.1192,
                              0.1805, 0.0722, 0.9505);
    vec3 xyz = RGB2XYZ * rgb;
    vec3 Yxy;
    Yxy.r = xyz.g;
    float temp = dot(vec3(1.0), xyz);
    Yxy.gb = xyz.rg / temp;
    return Yxy;
}
`;var BAt=T(S(),1),TZ=`/**
 * Converts a CIE Yxy color to RGB.
 * <p>The conversion is described in
 * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
 * </p>
 * 
 * @name czm_XYZToRGB
 * @glslFunction
 * 
 * @param {vec3} Yxy The color in CIE Yxy.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 xyz = czm_RGBToXYZ(rgb);
 * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
 * rgb = czm_XYZToRGB(xyz);
 */
vec3 czm_XYZToRGB(vec3 Yxy)
{
    const mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,
                              -1.5371,  1.8760, -0.2040,
                              -0.4985,  0.0416,  1.0572);
    vec3 xyz;
    xyz.r = Yxy.r * Yxy.g / Yxy.b;
    xyz.g = Yxy.r;
    xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
    
    return XYZ2RGB * xyz;
}
`;var YAt=T(S(),1),SZ=`// See:
//    https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/

vec3 czm_acesTonemapping(vec3 color) {
    float g = 0.985;
    float a = 0.065;
    float b = 0.0001;
    float c = 0.433;
    float d = 0.238;

    color = (color * (color + a) - b) / (color * (g * color + c) + d);

    color = clamp(color, 0.0, 1.0);

    return color;
}
`;var zAt=T(S(),1),CZ=`/**
 * @private
 */
float czm_alphaWeight(float a)
{
    float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];

    // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
    // http://jcgt.org/published/0002/02/09/
    return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
}
`;var JAt=T(S(),1),VZ=`/**
 * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
 *
 * @name czm_antialias
 * @glslFunction
 *
 * @param {vec4} color1 The color on one side of the edge.
 * @param {vec4} color2 The color on the other side of the edge.
 * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
 * @param {float} dist The distance to the edge in texture coordinates.
 * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
 * @returns {vec4} The anti-aliased color.
 *
 * @example
 * // GLSL declarations
 * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
 * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
 *
 * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
 * float dist = abs(textureCoordinates.t - 0.5);
 * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
 * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
 */
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
{
    float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
    float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
    val1 = val1 * (1.0 - val2);
    val1 = val1 * val1 * (3.0 - (2.0 * val1));
    val1 = pow(val1, 0.5); //makes the transition nicer
    
    vec4 midColor = (color1 + color2) * 0.5;
    return mix(midColor, currentColor, val1);
}

vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
{
    return czm_antialias(color1, color2, currentColor, dist, 0.1);
}
`;var jAt=T(S(),1),LZ=`/**
 * Apply a HSB color shift to an RGB color.
 *
 * @param {vec3} rgb The color in RGB space.
 * @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment
 * @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
 *
 * @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
 */
vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
    // Convert rgb color to hsb
    vec3 hsb = czm_RGBToHSB(rgb);

    // Perform hsb shift
    // Hue cycles around so no clamp is needed.
    hsb.x += hsbShift.x; // hue
    hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation

    // brightness
    //
    // Some shaders such as atmosphere-related effects need to leave black
    // pixels unchanged
    if (ignoreBlackPixels) {
        hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
    } else {
        hsb.z = hsb.z + hsbShift.z;
    }
    hsb.z = clamp(hsb.z, 0.0, 1.0);

    // Convert shifted hsb back to rgb
    return czm_HSBToRGB(hsb);
}
`;var $At=T(S(),1),RZ=`/**
 * Approximately computes spherical coordinates given a normal.
 * Uses approximate inverse trigonometry for speed and consistency,
 * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
 *
 * @name czm_approximateSphericalCoordinates
 * @glslFunction
 *
 * @param {vec3} normal arbitrary-length normal.
 *
 * @returns {vec2} Approximate latitude and longitude spherical coordinates.
 */
vec2 czm_approximateSphericalCoordinates(vec3 normal) {
    // Project into plane with vertical for latitude
    float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
    float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
    return vec2(latitudeApproximation, longitudeApproximation);
}
`;var t9t=T(S(),1),ZZ=`/**
 * Compute a rational approximation to tanh(x)
 *
 * @param {float} x A real number input
 * @returns {float} An approximation for tanh(x)
*/
float czm_approximateTanh(float x) {
    float x2 = x * x;
    return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
}
`;var i9t=T(S(),1),GZ=`/**
 * Determines if the fragment is back facing
 *
 * @name czm_backFacing
 * @glslFunction 
 * 
 * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
 */
bool czm_backFacing()
{
    // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
    return gl_FrontFacing == false;
}
`;var r9t=T(S(),1),EZ=`/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a float expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {float} a Value to return if the comparison is true.
 * @param {float} b Value to return if the comparison is false.
 *
 * @returns {float} equivalent of comparison ? a : b
 */
float czm_branchFreeTernary(bool comparison, float a, float b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec2 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec2} a Value to return if the comparison is true.
 * @param {vec2} b Value to return if the comparison is false.
 *
 * @returns {vec2} equivalent of comparison ? a : b
 */
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec3 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec3} a Value to return if the comparison is true.
 * @param {vec3} b Value to return if the comparison is false.
 *
 * @returns {vec3} equivalent of comparison ? a : b
 */
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec4 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec3} a Value to return if the comparison is true.
 * @param {vec3} b Value to return if the comparison is false.
 *
 * @returns {vec3} equivalent of comparison ? a : b
 */
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}
`;var a9t=T(S(),1),IZ=`
vec4 czm_cascadeColor(vec4 weights)
{
    return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
           vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
           vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
           vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
}
`;var l9t=T(S(),1),XZ=`
uniform vec4 shadowMap_cascadeDistances;

float czm_cascadeDistance(vec4 weights)
{
    return dot(shadowMap_cascadeDistances, weights);
}
`;var u9t=T(S(),1),WZ=`
uniform mat4 shadowMap_cascadeMatrices[4];

mat4 czm_cascadeMatrix(vec4 weights)
{
    return shadowMap_cascadeMatrices[0] * weights.x +
           shadowMap_cascadeMatrices[1] * weights.y +
           shadowMap_cascadeMatrices[2] * weights.z +
           shadowMap_cascadeMatrices[3] * weights.w;
}
`;var h9t=T(S(),1),PZ=`
uniform vec4 shadowMap_cascadeSplits[2];

vec4 czm_cascadeWeights(float depthEye)
{
    // One component is set to 1.0 and all others set to 0.0.
    vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
    vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
    return near * far;
}
`;var p9t=T(S(),1),vZ=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
    float signedDistance = texture(clippingDistance, uv).r;
    return (signedDistance - 0.5) * 2.0;
}

void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
    // Position is completely outside of polygons bounds
    vec2 rectUv = clippingPosition;
    if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
        #ifdef CLIPPING_INVERSE 
            discard;
        #endif
        return;
    }

    vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
    vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
    float dimension = float(extentsLength);
    if (extentsLength > 2) {
       dimension = ceil(log2(float(extentsLength)));
    }

    vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
    vec2 uv = textureOffset + rectUv / dimension;

    float signedDistance = getSignedDistance(uv, clippingDistance);

    #ifdef CLIPPING_INVERSE
    if (signedDistance > 0.0)  {
        discard;
    }
    #else
    if (signedDistance < 0.0)  {
        discard;
    }
    #endif
}
`;var g9t=T(S(),1),wZ=`/**
 * DOC_TBA
 *
 * @name czm_columbusViewMorph
 * @glslFunction
 */
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
    // Just linear for now.
    vec3 p = mix(position2D.xyz, position3D.xyz, time);
    return vec4(p, 1.0);
}
`;var x9t=T(S(),1),FZ=`/**
 * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
 * builtin uses automatic uniforms so the atmophere settings are synced with the
 * state of the Scene, even in other contexts like Model.
 *
 * @name czm_computeAtmosphereColor
 * @glslFunction
 *
 * @param {vec3} positionWC Position of the fragment in world coords (low precision)
 * @param {vec3} lightDirection Light direction from the sun or other light source.
 * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
 * @param {vec3} mieColor The Mie scattering color computed by a scattering function
 * @param {float} opacity The opacity computed by a scattering function.
 */
vec4 czm_computeAtmosphereColor(
    vec3 positionWC,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);

    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = czm_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;

    return vec4(color, opacity);
}

/**
 * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
 * builtin uses automatic uniforms so the atmophere settings are synced with the
 * state of the Scene, even in other contexts like Model.
 *
 * @name czm_computeAtmosphereColor
 * @glslFunction
 *
 * @param {czm_ray} primaryRay Ray from the origin to sky fragment to in world coords (low precision)
 * @param {vec3} lightDirection Light direction from the sun or other light source.
 * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
 * @param {vec3} mieColor The Mie scattering color computed by a scattering function
 * @param {float} opacity The opacity computed by a scattering function.
 */
vec4 czm_computeAtmosphereColor(
    czm_ray primaryRay,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    vec3 direction = normalize(primaryRay.direction);

    float cosAngle = dot(direction, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = czm_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;

    return vec4(color, opacity);
}

`;var T9t=T(S(),1),AZ=`/**
 * Compute atmosphere scattering for the ground atmosphere and fog. This method
 * uses automatic uniforms so it is always synced with the scene settings.
 *
 * @name czm_computeGroundAtmosphereScattering
 * @glslfunction
 *
 * @param {vec3} positionWC The position of the fragment in world coordinates.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 */
void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);

    float atmosphereInnerRadius = length(positionWC);

    czm_computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );
}
`;var C9t=T(S(),1),MZ=`/**
 * Returns a position in model coordinates relative to eye taking into
 * account the current scene mode: 3D, 2D, or Columbus view.
 * <p>
 * This uses standard position attributes, <code>position3DHigh</code>, 
 * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, 
 * and should be used when writing a vertex shader for an {@link Appearance}.
 * </p>
 *
 * @name czm_computePosition
 * @glslFunction
 *
 * @returns {vec4} The position relative to eye.
 *
 * @example
 * vec4 p = czm_computePosition();
 * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
 * gl_Position = czm_modelViewProjectionRelativeToEye * p;
 *
 * @see czm_translateRelativeToEye
 */
vec4 czm_computePosition();
`;var L9t=T(S(),1),NZ=`/**
 * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
 * the transmittance value for the ray. This function uses automatic uniforms
 * so the atmosphere settings are always synced with the current scene.
 *
 * @name czm_computeScattering
 * @glslfunction
 *
 * @param {czm_ray} primaryRay The ray from the camera to the position.
 * @param {float} primaryRayLength The length of the primary ray.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 */
void czm_computeScattering(
    czm_ray primaryRay,
    float primaryRayLength,
    vec3 lightDirection,
    float atmosphereInnerRadius,
    out vec3 rayleighColor,
    out vec3 mieColor,
    out float opacity
) {
    const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
    const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
    const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Initialize the default scattering amounts to 0.
    rayleighColor = vec3(0.0);
    mieColor = vec3(0.0);
    opacity = 0.0;

    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;

    vec3 origin = vec3(0.0);

    // Calculate intersection from the camera to the outer ring of the atmosphere.
    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);

    // Return empty colors if no intersection with the atmosphere geometry.
    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
        return;
    }

    // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
    // we implement a split strategy: sky or horizon.
    // For performance reasons, instead of a if/else branch
    // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
    float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
    // Value close to 0.0: close to the horizon
    // Value close to 1.0: above in the sky
    float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));

    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
    float start_0 = primaryRayAtmosphereIntersect.start;
    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));

    // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
    // (1) from outer space we have to use more ray steps to get a realistic rendering
    // (2) within atmosphere we need fewer steps for faster rendering
    float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
    float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
    int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
    int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
    float rayPositionLength = primaryRayAtmosphereIntersect.start;
    // (1) Outside the atmosphere: constant rayStepLength
    // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
    float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
    float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
    float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));

    vec3 rayleighAccumulation = vec3(0.0);
    vec3 mieAccumulation = vec3(0.0);
    vec2 opticalDepth = vec2(0.0);
    vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);

    // Sample positions on the primary ray.
    for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {

        // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to break early instead
        if (i >= PRIMARY_STEPS) {
            break;
        }

        // Calculate sample position along viewpoint ray.
        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);

        // Calculate height of sample position above ellipsoid.
        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;

        // Calculate and accumulate density of particles at the sample position.
        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
        opticalDepth += sampleDensity;

        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
        czm_ray lightRay = czm_ray(samplePosition, lightDirection);
        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);

        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
        float lightPositionLength = 0.0;

        vec2 lightOpticalDepth = vec2(0.0);

        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
        for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {

            // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (j >= LIGHT_STEPS) {
                break;
            }

            // Calculate sample position along light ray.
            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);

            // Calculate height of the light sample position above ellipsoid.
            float lightHeight = length(lightPosition) - atmosphereInnerRadius;

            // Calculate density of photons at the light sample position.
            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;

            // Increment distance on light ray.
            lightPositionLength += lightStepLength;
        }

        // Compute attenuation via the primary ray and the light ray.
        vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));

        // Accumulate the scattering.
        rayleighAccumulation += sampleDensity.x * attenuation;
        mieAccumulation += sampleDensity.y * attenuation;

        // Increment distance on primary ray.
        rayPositionLength += (rayStepLength += rayStepLengthIncrease);
    }

    // Compute the scattering amount.
    rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
    mieColor = czm_atmosphereMieCoefficient * mieAccumulation;

    // Compute the transmittance i.e. how much light is passing through the atmosphere.
    opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
}
`;var Z9t=T(S(),1),kZ=`/**
 * @private
 */
vec2 cordic(float angle)
{
// Scale the vector by the appropriate factor for the 24 iterations to follow.
    vec2 vector = vec2(6.0725293500888267e-1, 0.0);
// Iteration 1
    float sense = (angle < 0.0) ? -1.0 : 1.0;
 //   float factor = sense * 1.0;  // 2^-0
    mat2 rotation = mat2(1.0, sense, -sense, 1.0);
    vector = rotation * vector;
    angle -= sense * 7.8539816339744828e-1;  // atan(2^-0)
// Iteration 2
    sense = (angle < 0.0) ? -1.0 : 1.0;
    float factor = sense * 5.0e-1;  // 2^-1
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.6364760900080609e-1;  // atan(2^-1)
// Iteration 3
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.5e-1;  // 2^-2
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.4497866312686414e-1;  // atan(2^-2)
// Iteration 4
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.25e-1;  // 2^-3
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.2435499454676144e-1;  // atan(2^-3)
// Iteration 5
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 6.25e-2;  // 2^-4
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 6.2418809995957350e-2;  // atan(2^-4)
// Iteration 6
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.125e-2;  // 2^-5
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.1239833430268277e-2;  // atan(2^-5)
// Iteration 7
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.5625e-2;  // 2^-6
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.5623728620476831e-2;  // atan(2^-6)
// Iteration 8
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 7.8125e-3;  // 2^-7
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 7.8123410601011111e-3;  // atan(2^-7)
// Iteration 9
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.90625e-3;  // 2^-8
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.9062301319669718e-3;  // atan(2^-8)
// Iteration 10
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.953125e-3;  // 2^-9
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.9531225164788188e-3;  // atan(2^-9)
// Iteration 11
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 9.765625e-4;  // 2^-10
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 9.7656218955931946e-4;  // atan(2^-10)
// Iteration 12
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 4.8828125e-4;  // 2^-11
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.8828121119489829e-4;  // atan(2^-11)
// Iteration 13
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.44140625e-4;  // 2^-12
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.4414062014936177e-4;  // atan(2^-12)
// Iteration 14
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.220703125e-4;  // 2^-13
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.2207031189367021e-4;  // atan(2^-13)
// Iteration 15
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 6.103515625e-5;  // 2^-14
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 6.1035156174208773e-5;  // atan(2^-14)
// Iteration 16
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.0517578125e-5;  // 2^-15
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.0517578115526096e-5;  // atan(2^-15)
// Iteration 17
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.52587890625e-5;  // 2^-16
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.5258789061315762e-5;  // atan(2^-16)
// Iteration 18
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 7.62939453125e-6;  // 2^-17
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 7.6293945311019700e-6;  // atan(2^-17)
// Iteration 19
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.814697265625e-6;  // 2^-18
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.8146972656064961e-6;  // atan(2^-18)
// Iteration 20
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.9073486328125e-6;  // 2^-19
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.9073486328101870e-6;  // atan(2^-19)
// Iteration 21
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 9.5367431640625e-7;  // 2^-20
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 9.5367431640596084e-7;  // atan(2^-20)
// Iteration 22
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 4.76837158203125e-7;  // 2^-21
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.7683715820308884e-7;  // atan(2^-21)
// Iteration 23
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.384185791015625e-7;  // 2^-22
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.3841857910155797e-7;  // atan(2^-22)
// Iteration 24
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.1920928955078125e-7;  // 2^-23
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
//    angle -= sense * 1.1920928955078068e-7;  // atan(2^-23)

    return vector;
}

/**
 * Computes the cosine and sine of the provided angle using the CORDIC algorithm.
 *
 * @name czm_cosineAndSine
 * @glslFunction
 *
 * @param {float} angle The angle in radians.
 *
 * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
 *
 * @example
 * vec2 v = czm_cosineAndSine(czm_piOverSix);
 * float cosine = v.x;
 * float sine = v.y;
 */
vec2 czm_cosineAndSine(float angle)
{
    if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
    {
        if (angle < 0.0)
        {
            return -cordic(angle + czm_pi);
        }
        else
        {
            return -cordic(angle - czm_pi);
        }
    }
    else
    {
        return cordic(angle);
    }
}
`;var E9t=T(S(),1),UZ=`/**
 * Decompresses texture coordinates that were packed into a single float.
 *
 * @name czm_decompressTextureCoordinates
 * @glslFunction
 *
 * @param {float} encoded The compressed texture coordinates.
 * @returns {vec2} The decompressed texture coordinates.
 */
 vec2 czm_decompressTextureCoordinates(float encoded)
 {
    float temp = encoded / 4096.0;
    float xZeroTo4095 = floor(temp);
    float stx = xZeroTo4095 / 4095.0;
    float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
    return vec2(stx, sty);
 }
`;var X9t=T(S(),1),DZ=`// emulated noperspective
#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
out float v_WindowZ;
#endif

/**
 * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
 * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, 
 * capping the shadow volume. More information here: 
 * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
 *
 * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring 
 * no geometry gets clipped by setting the clip space z value to 0.0 and then
 * sending the unaltered screen space z value (using emulated noperspective
 * interpolation) to the frag shader where it is clamped to [0,1] and then
 * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
 * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
 *
 * When GL_EXT_frag_depth is not available, which is the case on some mobile 
 * devices, we must attempt to fix this only in the vertex shader. 
 * The approach is to clamp the z value to the far plane, which closes the 
 * shadow volume but also distorts the geometry, so there can still be artifacts
 * on frustum seams.
 *
 * @name czm_depthClamp
 * @glslFunction
 *
 * @param {vec4} coords The vertex in clip coordinates.
 * @returns {vec4} The modified vertex.
 *
 * @example
 * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
 *
 * @see czm_writeDepthClamp
 */
vec4 czm_depthClamp(vec4 coords)
{
#ifndef LOG_DEPTH
#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
    v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
    coords.z = 0.0;
#else
    coords.z = min(coords.z, coords.w);
#endif
#endif
    return coords;
}
`;var P9t=T(S(),1),BZ=`/**
 * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system 
 * to eye coordinates.  In east-north-up coordinates, x points east, y points north, and z points along the 
 * surface normal.  East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
 * <br /><br />
 * The ellipsoid is assumed to be centered at the model coordinate's origin.
 *
 * @name czm_eastNorthUpToEyeCoordinates
 * @glslFunction
 *
 * @param {vec3} positionMC The position on the ellipsoid in model coordinates.
 * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
 *
 * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
 *
 * @example
 * // Transform a vector defined in the east-north-up coordinate 
 * // system, (0, 0, 1) which is the surface normal, to eye 
 * // coordinates.
 * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
 * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
 */
mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
{
    vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));  // normalized surface tangent in model coordinates
    vec3 tangentEC = normalize(czm_normal3D * tangentMC);                // normalized surface tangent in eye coordinates
    vec3 bitangentEC = normalize(cross(normalEC, tangentEC));            // normalized surface bitangent in eye coordinates

    return mat3(
        tangentEC.x,   tangentEC.y,   tangentEC.z,
        bitangentEC.x, bitangentEC.y, bitangentEC.z,
        normalEC.x,    normalEC.y,    normalEC.z);
}
`;var w9t=T(S(),1),OZ=`/**
 * DOC_TBA
 *
 * @name czm_ellipsoidContainsPoint
 * @glslFunction
 *
 */
bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
{
    vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
    return (dot(scaled, scaled) <= 1.0);
}
`;var A9t=T(S(),1),YZ=`/**
 * Approximate uv coordinates based on the ellipsoid normal.
 *
 * @name czm_ellipsoidTextureCoordinates
 * @glslFunction
 */
vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
{
    return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var N9t=T(S(),1),HZ=`/**
 * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
 * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
 * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
 * <code>vec3</code>s, or <code>vec4</code>s.
 *
 * @name czm_equalsEpsilon
 * @glslFunction
 *
 * @param {} left The first vector.
 * @param {} right The second vector.
 * @param {float} epsilon The epsilon to use for equality testing.
 * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
 *
 * @example
 * // GLSL declarations
 * bool czm_equalsEpsilon(float left, float right, float epsilon);
 * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
 * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
 * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
 */
bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec4(epsilon)));
}

bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec3(epsilon)));
}

bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec2(epsilon)));
}

bool czm_equalsEpsilon(float left, float right, float epsilon) {
    return (abs(left - right) <= epsilon);
}
`;var U9t=T(S(),1),zZ=`/**
 * DOC_TBA
 *
 * @name czm_eyeOffset
 * @glslFunction
 *
 * @param {vec4} positionEC DOC_TBA.
 * @param {vec3} eyeOffset DOC_TBA.
 *
 * @returns {vec4} DOC_TBA.
 */
vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
{
    // This equation is approximate in x and y.
    vec4 p = positionEC;
    vec4 zEyeOffset = normalize(p) * eyeOffset.z;
    p.xy += eyeOffset.xy + zEyeOffset.xy;
    p.z += zEyeOffset.z;
    return p;
}
`;var B9t=T(S(),1),KZ=`/**
 * Transforms a position from eye to window coordinates.  The transformation
 * from eye to clip coordinates is done using {@link czm_projection}.
 * The transform from normalized device coordinates to window coordinates is
 * done using {@link czm_viewportTransformation}, which assumes a depth range
 * of <code>near = 0</code> and <code>far = 1</code>.
 * <br /><br />
 * This transform is useful when there is a need to manipulate window coordinates
 * in a vertex shader as done by {@link BillboardCollection}.
 *
 * @name czm_eyeToWindowCoordinates
 * @glslFunction
 *
 * @param {vec4} position The position in eye coordinates to transform.
 *
 * @returns {vec4} The transformed position in window coordinates.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_projection
 * @see czm_viewportTransformation
 * @see BillboardCollection
 *
 * @example
 * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
 */
vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
{
    vec4 q = czm_projection * positionEC;                        // clip coordinates
    q.xyz /= q.w;                                                // normalized device coordinates
    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
    return q;
}
`;var Y9t=T(S(),1),JZ=`/**
 * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
 *
 * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
 * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
 * Adapted from ShaderFastLibs under MIT License.
 *
 * Chosen for the following characteristics over range [0, 1]:
 * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
 * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
 *
 * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
 * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
 *
 * @name czm_fastApproximateAtan
 * @glslFunction
 *
 * @param {float} x Value between 0 and 1 inclusive.
 *
 * @returns {float} Approximation of atan(x)
 */
float czm_fastApproximateAtan(float x) {
    return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
}

/**
 * Approximation of atan2.
 *
 * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
 * However, we replaced their atan curve with Michael Drobot's (see above).
 *
 * @name czm_fastApproximateAtan
 * @glslFunction
 *
 * @param {float} x Value between -1 and 1 inclusive.
 * @param {float} y Value between -1 and 1 inclusive.
 *
 * @returns {float} Approximation of atan2(x, y)
 */
float czm_fastApproximateAtan(float x, float y) {
    // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
    // So range-reduce using abs and by flipping whether x or y is on top.
    float t = abs(x); // t used as swap and atan result.
    float opposite = abs(y);
    float adjacent = max(t, opposite);
    opposite = min(t, opposite);

    t = czm_fastApproximateAtan(opposite / adjacent);

    // Undo range reduction
    t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
    t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
    t = czm_branchFreeTernary(y < 0.0, -t, t);
    return t;
}
`;var z9t=T(S(),1),QZ=`/**
 * Gets the color with fog at a distance from the camera.
 *
 * @name czm_fog
 * @glslFunction
 *
 * @param {float} distanceToCamera The distance to the camera in meters.
 * @param {vec3} color The original color.
 * @param {vec3} fogColor The color of the fog.
 *
 * @returns {vec3} The color adjusted for fog at the distance from the camera.
 */
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
{
    float scalar = distanceToCamera * czm_fogDensity;
    float fog = 1.0 - exp(-(scalar * scalar));
    return mix(color, fogColor, fog);
}

/**
 * Gets the color with fog at a distance from the camera.
 *
 * @name czm_fog
 * @glslFunction
 *
 * @param {float} distanceToCamera The distance to the camera in meters.
 * @param {vec3} color The original color.
 * @param {vec3} fogColor The color of the fog.
 * @param {float} fogModifierConstant A constant to modify the appearance of fog.
 *
 * @returns {vec3} The color adjusted for fog at the distance from the camera.
 */
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
{
    float scalar = distanceToCamera * czm_fogDensity;
    float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
    return mix(color, fogColor, fog);
}
`;var J9t=T(S(),1),jZ=`/**
 * Converts a color from RGB space to linear space.
 *
 * @name czm_gammaCorrect
 * @glslFunction
 *
 * @param {vec3} color The color in RGB space.
 * @returns {vec3} The color in linear space.
 */
vec3 czm_gammaCorrect(vec3 color) {
#ifdef HDR
    color = pow(color, vec3(czm_gamma));
#endif
    return color;
}

vec4 czm_gammaCorrect(vec4 color) {
#ifdef HDR
    color.rgb = pow(color.rgb, vec3(czm_gamma));
#endif
    return color;
}
`;var j9t=T(S(),1),qZ=`/**
 * DOC_TBA
 *
 * @name czm_geodeticSurfaceNormal
 * @glslFunction
 *
 * @param {vec3} positionOnEllipsoid DOC_TBA
 * @param {vec3} ellipsoidCenter DOC_TBA
 * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
 * 
 * @returns {vec3} DOC_TBA.
 */
vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
{
    return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
}
`;var $9t=T(S(),1),$Z=`/**
 * An czm_material with default values. Every material's czm_getMaterial
 * should use this default material as a base for the material it returns.
 * The default normal value is given by materialInput.normalEC.
 *
 * @name czm_getDefaultMaterial
 * @glslFunction
 *
 * @param {czm_materialInput} input The input used to construct the default material.
 *
 * @returns {czm_material} The default material.
 *
 * @see czm_materialInput
 * @see czm_material
 * @see czm_getMaterial
 */
czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
{
    czm_material material;
    material.diffuse = vec3(0.0);
    material.specular = 0.0;
    material.shininess = 1.0;
    material.normal = materialInput.normalEC;
    material.emission = vec3(0.0);
    material.alpha = 1.0;
    return material;
}
`;var tMt=T(S(),1),eG=`/**
 * Select which direction vector to use for dynamic atmosphere lighting based on an enum value
 *
 * @name czm_getDynamicAtmosphereLightDirection
 * @glslfunction
 * @see DynamicAtmosphereLightingType.js
 *
 * @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
 * @param {float} lightEnum The enum value for selecting between light sources.
 * @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
 */
vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
    const float NONE = 0.0;
    const float SCENE_LIGHT = 1.0;
    const float SUNLIGHT = 2.0;

    vec3 lightDirection =
        positionWC * float(lightEnum == NONE) +
        czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
        czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
    return normalize(lightDirection);
}
`;var iMt=T(S(),1),tG=`/**
 * Calculates the intensity of diffusely reflected light.
 *
 * @name czm_getLambertDiffuse
 * @glslFunction
 *
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 *
 * @returns {float} The intensity of the diffuse reflection.
 *
 * @see czm_phong
 *
 * @example
 * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
 * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
 * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
 */
float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
{
    return max(dot(lightDirectionEC, normalEC), 0.0);
}
`;var rMt=T(S(),1),nG=`/**
 * Calculates the specular intensity of reflected light.
 *
 * @name czm_getSpecular
 * @glslFunction
 *
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.
 *
 * @returns {float} The intensity of the specular highlight.
 *
 * @see czm_phong
 *
 * @example
 * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
 * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
 * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
 */
float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
{
    vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
    float specular = max(dot(toReflectedLight, toEyeEC), 0.0);

    // pow has undefined behavior if both parameters <= 0.
    // Prevent this by making sure shininess is at least czm_epsilon2.
    return pow(specular, max(shininess, czm_epsilon2));
}
`;var aMt=T(S(),1),iG=`/**
 * @private
 */
vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
{
    float cosAngle = cos(angleInRadians);
    float sinAngle = sin(angleInRadians);

    // time dependent sampling directions
    vec2 s0 = vec2(1.0/17.0, 0.0);
    vec2 s1 = vec2(-1.0/29.0, 0.0);
    vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
    vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);

    // rotate sampling direction by specified angle
    s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
    s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
    s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
    s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));

    vec2 uv0 = (uv/103.0) + (time * s0);
    vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
    vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
    vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);

    uv0 = fract(uv0);
    uv1 = fract(uv1);
    uv2 = fract(uv2);
    uv3 = fract(uv3);
    vec4 noise = (texture(normalMap, uv0)) +
                 (texture(normalMap, uv1)) +
                 (texture(normalMap, uv2)) +
                 (texture(normalMap, uv3));

    // average and scale to between -1 and 1
    return ((noise / 4.0) - 0.5) * 2.0;
}
`;var lMt=T(S(),1),oG=`/**
 * Adjusts the hue of a color.
 * 
 * @name czm_hue
 * @glslFunction
 * 
 * @param {vec3} rgb The color.
 * @param {float} adjustment The amount to adjust the hue of the color in radians.
 *
 * @returns {float} The color with the hue adjusted.
 *
 * @example
 * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
 */
vec3 czm_hue(vec3 rgb, float adjustment)
{
    const mat3 toYIQ = mat3(0.299,     0.587,     0.114,
                            0.595716, -0.274453, -0.321263,
                            0.211456, -0.522591,  0.311135);
    const mat3 toRGB = mat3(1.0,  0.9563,  0.6210,
                            1.0, -0.2721, -0.6474,
                            1.0, -1.107,   1.7046);
    
    vec3 yiq = toYIQ * rgb;
    float hue = atan(yiq.z, yiq.y) + adjustment;
    float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
    
    vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
    return toRGB * color;
}
`;var uMt=T(S(),1),rG=`/**
 * Converts a color in linear space to RGB space.
 *
 * @name czm_inverseGamma
 * @glslFunction
 *
 * @param {vec3} color The color in linear space.
 * @returns {vec3} The color in RGB space.
 */
vec3 czm_inverseGamma(vec3 color) {
    return pow(color, vec3(1.0 / czm_gamma));
}
`;var hMt=T(S(),1),sG=`/**
 * Determines if a time interval is empty.
 *
 * @name czm_isEmpty
 * @glslFunction 
 * 
 * @param {czm_raySegment} interval The interval to test.
 * 
 * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
 *
 * @example
 * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true
 * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
 * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
 */
bool czm_isEmpty(czm_raySegment interval)
{
    return (interval.stop < 0.0);
}
`;var pMt=T(S(),1),aG=`/**
 * Determines if a time interval is empty.
 *
 * @name czm_isFull
 * @glslFunction 
 * 
 * @param {czm_raySegment} interval The interval to test.
 * 
 * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
 *
 * @example
 * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true
 * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
 * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
 */
bool czm_isFull(czm_raySegment interval)
{
    return (interval.start == 0.0 && interval.stop == czm_infinity);
}
`;var gMt=T(S(),1),cG=`/**
 * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
 *
 * @name czm_latitudeToWebMercatorFraction
 * @glslFunction
 *
 * @param {float} latitude The geodetic latitude, in radians.
 * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
 * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
 *
 * @returns {float} The fraction of the rectangle at which the latitude occurs.  If the latitude is the southern
 *          boundary of the rectangle, the return value will be zero.  If it is the northern boundary, the return
 *          value will be 1.0.  Latitudes in between are mapped according to the Web Mercator projection.
 */ 
float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
{
    float sinLatitude = sin(latitude);
    float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
    
    return (mercatorY - southMercatorY) * oneOverMercatorHeight;
}
`;var xMt=T(S(),1),lG=`/**
 * Computes distance from an point in 2D to a line in 2D.
 *
 * @name czm_lineDistance
 * @glslFunction
 *
 * param {vec2} point1 A point along the line.
 * param {vec2} point2 A point along the line.
 * param {vec2} point A point that may or may not be on the line.
 * returns {float} The distance from the point to the line.
 */
float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
    return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
}
`;var TMt=T(S(),1),dG=`/**
 * Converts a linear RGB color to an sRGB color.
 *
 * @param {vec3|vec4} linearIn The color in linear color space.
 * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
 */
vec3 czm_linearToSrgb(vec3 linearIn) 
{
    return pow(linearIn, vec3(1.0/2.2));
}

vec4 czm_linearToSrgb(vec4 linearIn) 
{
    vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
    return vec4(srgbOut, linearIn.a);
}
`;var CMt=T(S(),1),uG=`/**
 * Computes the luminance of a color. 
 *
 * @name czm_luminance
 * @glslFunction
 *
 * @param {vec3} rgb The color.
 * 
 * @returns {float} The luminance.
 *
 * @example
 * float light = czm_luminance(vec3(0.0)); // 0.0
 * float dark = czm_luminance(vec3(1.0));  // ~1.0 
 */
float czm_luminance(vec3 rgb)
{
    // Algorithm from Chapter 10 of Graphics Shaders.
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    return dot(rgb, W);
}
`;var LMt=T(S(),1),mG=`/**
 * Find the maximum component of a vector.
 *
 * @name czm_maximumComponent
 * @glslFunction
 *
 * @param {vec2|vec3|vec4} v The input vector.
 * @returns {float} The value of the largest component.
 */
float czm_maximumComponent(vec2 v)
{
    return max(v.x, v.y);
}
float czm_maximumComponent(vec3 v)
{
    return max(max(v.x, v.y), v.z);
}
float czm_maximumComponent(vec4 v)
{
    return max(max(max(v.x, v.y), v.z), v.w);
}
`;var ZMt=T(S(),1),hG=`/**
 * Computes the size of a pixel in meters at a distance from the eye.
 * <p>
 * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
 * </p>
 * @name czm_metersPerPixel
 * @glslFunction
 *
 * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
 * @param {float} pixelRatio The scaling factor from pixel space to coordinate space
 *
 * @returns {float} The meters per pixel at positionEC.
 */
float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
{
    float width = czm_viewport.z;
    float height = czm_viewport.w;
    float pixelWidth;
    float pixelHeight;

    float top = czm_frustumPlanes.x;
    float bottom = czm_frustumPlanes.y;
    float left = czm_frustumPlanes.z;
    float right = czm_frustumPlanes.w;

    if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
    {
        float frustumWidth = right - left;
        float frustumHeight = top - bottom;
        pixelWidth = frustumWidth / width;
        pixelHeight = frustumHeight / height;
    }
    else
    {
        float distanceToPixel = -positionEC.z;
        float inverseNear = 1.0 / czm_currentFrustum.x;
        float tanTheta = top * inverseNear;
        pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
        tanTheta = right * inverseNear;
        pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
    }

    return max(pixelWidth, pixelHeight) * pixelRatio;
}

/**
 * Computes the size of a pixel in meters at a distance from the eye.
 * <p>
 * Use this version when scaling by pixel ratio.
 * </p>
 * @name czm_metersPerPixel
 * @glslFunction
 *
 * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
 *
 * @returns {float} The meters per pixel at positionEC.
 */
float czm_metersPerPixel(vec4 positionEC)
{
    return czm_metersPerPixel(positionEC, czm_pixelRatio);
}
`;var EMt=T(S(),1),fG=`/**
 * Transforms a position from model to window coordinates.  The transformation
 * from model to clip coordinates is done using {@link czm_modelViewProjection}.
 * The transform from normalized device coordinates to window coordinates is
 * done using {@link czm_viewportTransformation}, which assumes a depth range
 * of <code>near = 0</code> and <code>far = 1</code>.
 * <br /><br />
 * This transform is useful when there is a need to manipulate window coordinates
 * in a vertex shader as done by {@link BillboardCollection}.
 * <br /><br />
 * This function should not be confused with {@link czm_viewportOrthographic},
 * which is an orthographic projection matrix that transforms from window 
 * coordinates to clip coordinates.
 *
 * @name czm_modelToWindowCoordinates
 * @glslFunction
 *
 * @param {vec4} position The position in model coordinates to transform.
 *
 * @returns {vec4} The transformed position in window coordinates.
 *
 * @see czm_eyeToWindowCoordinates
 * @see czm_modelViewProjection
 * @see czm_viewportTransformation
 * @see czm_viewportOrthographic
 * @see BillboardCollection
 *
 * @example
 * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
 */
vec4 czm_modelToWindowCoordinates(vec4 position)
{
    vec4 q = czm_modelViewProjection * position;                // clip coordinates
    q.xyz /= q.w;                                                // normalized device coordinates
    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
    return q;
}
`;var XMt=T(S(),1),pG=`/**
 * DOC_TBA
 *
 * @name czm_multiplyWithColorBalance
 * @glslFunction
 */
vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
{
    // Algorithm from Chapter 10 of Graphics Shaders.
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    
    vec3 target = left * right;
    float leftLuminance = dot(left, W);
    float rightLuminance = dot(right, W);
    float targetLuminance = dot(target, W);
    
    return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
}
`;var PMt=T(S(),1),bG=`/**
 * Computes a value that scales with distance.  The scaling is clamped at the near and
 * far distances, and does not extrapolate.  This function works with the
 * {@link NearFarScalar} JavaScript class.
 *
 * @name czm_nearFarScalar
 * @glslFunction
 *
 * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
 * @param {float} cameraDistSq The square of the current distance from the camera.
 *
 * @returns {float} The value at this distance.
 */
float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
{
    float valueAtMin = nearFarScalar.y;
    float valueAtMax = nearFarScalar.w;
    float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
    float farDistanceSq = nearFarScalar.z * nearFarScalar.z;

    float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);

    t = pow(clamp(t, 0.0, 1.0), 0.2);

    return mix(valueAtMin, valueAtMax, t);
}
`;var wMt=T(S(),1),gG=` /**
  * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  *
  * @name czm_octDecode
  * @param {vec2} encoded The oct-encoded, unit-length vector
  * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
  * @returns {vec3} The decoded and normalized vector
  */
  vec3 czm_octDecode(vec2 encoded, float range)
  {
      if (encoded.x == 0.0 && encoded.y == 0.0) {
          return vec3(0.0, 0.0, 0.0);
      }

     encoded = encoded / range * 2.0 - 1.0;
     vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
     if (v.z < 0.0)
     {
         v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
     }

     return normalize(v);
  }

/**
 * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {vec2} encoded The oct-encoded, unit-length vector
 * @returns {vec3} The decoded and normalized vector
 */
 vec3 czm_octDecode(vec2 encoded)
 {
    return czm_octDecode(encoded, 255.0);
 }

 /**
 * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {float} encoded The oct-encoded, unit-length vector
 * @returns {vec3} The decoded and normalized vector
 */
 vec3 czm_octDecode(float encoded)
 {
    float temp = encoded / 256.0;
    float x = floor(temp);
    float y = (temp - x) * 256.0;
    return czm_octDecode(vec2(x, y));
 }

/**
 * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {vec2} encoded The packed oct-encoded, unit-length vectors.
 * @param {vec3} vector1 One decoded and normalized vector.
 * @param {vec3} vector2 One decoded and normalized vector.
 * @param {vec3} vector3 One decoded and normalized vector.
 */
  void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
 {
    float temp = encoded.x / 65536.0;
    float x = floor(temp);
    float encodedFloat1 = (temp - x) * 65536.0;

    temp = encoded.y / 65536.0;
    float y = floor(temp);
    float encodedFloat2 = (temp - y) * 65536.0;

    vector1 = czm_octDecode(encodedFloat1);
    vector2 = czm_octDecode(encodedFloat2);
    vector3 = czm_octDecode(vec2(x, y));
 }

`;var AMt=T(S(),1),yG=`/**
 * Packs a depth value into a vec4 that can be represented by unsigned bytes.
 *
 * @name czm_packDepth
 * @glslFunction
 *
 * @param {float} depth The floating-point depth.
 * @returns {vec4} The packed depth.
 */
vec4 czm_packDepth(float depth)
{
    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
    vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
    enc = fract(enc);
    enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
    return enc;
}
`;var NMt=T(S(),1),xG=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
    return diffuseColor / czm_pi;
}

vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
    float versine = 1.0 - VdotH;
    // pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
    float versineSquared = versine * versine;
    return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
}

#ifdef USE_ANISOTROPY
/**
 * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
 * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
 * @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
 * @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
 */
float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
{
    vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
    float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
    float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
    float v = 0.5 / (GGXV + GGXL);
    return clamp(v, 0.0, 1.0);
}

/**
 * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
 * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
 * @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
 */
float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
{
    float roughnessSquared = bitangentRoughness * tangentialRoughness;
    vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
    float w2 = roughnessSquared / dot(f, f);
    return roughnessSquared * w2 * w2 / czm_pi;
}
#endif

/**
 * Estimate the geometric self-shadowing of the microfacets in a surface,
 * using the Smith Joint GGX visibility function.
 * Note: Vis = G / (4 * NdotL * NdotV)
 * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
 * see Real-Time Rendering. Page 331 to 336.
 * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
 * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
 */
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
    float alphaRoughnessSq = alphaRoughness * alphaRoughness;

    float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
    float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);

    float GGX = GGXV + GGXL;
    if (GGX > 0.0)
    {
        return 0.5 / GGX;
    }
    return 0.0;
}

/**
 * Estimate the fraction of the microfacets in a surface that are aligned with 
 * the halfway vector, which is aligned halfway between the directions from
 * the fragment to the camera and from the fragment to the light source.
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
 * @return {float} The fraction of microfacets aligned to the halfway vector.
 */
float GGX(float alphaRoughness, float NdotH)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
    return alphaRoughnessSquared / (czm_pi * f * f);
}

/**
 * Compute the strength of the specular reflection due to direct lighting.
 *
 * @param {vec3} normal The surface normal.
 * @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
 * @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
 * @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @return {float} The strength of the specular reflection.
 */
float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
{
    float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
    float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
    float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
    float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
    float D = GGX(alphaRoughness, NdotH);
    return G * D;
}

/**
 * Compute the diffuse and specular contributions using physically based
 * rendering. This function only handles direct lighting.
 * <p>
 * This function only handles the lighting calculations. Metallic/roughness
 * and specular/glossy must be handled separately. See {@MaterialStageFS}
 * </p>
 *
 * @name czm_pbrLighting
 * @glslFunction
 *
 * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
 * @param {vec3} normalEC The surface normal in eye coordinates
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color
 */
vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
{
    vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
    float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
    float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);

    vec3 f0 = material.specular;
    float reflectance = czm_maximumComponent(f0);
    // Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
    // In this case, at grazing angle, all incident energy is reflected.
    vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
    vec3 F = fresnelSchlick2(f0, f90, VdotH);

    #if defined(USE_SPECULAR)
        F *= material.specularWeight;
    #endif

    float alphaRoughness = material.roughness * material.roughness;
    #ifdef USE_ANISOTROPY
        mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
        vec3 lightDirection = lightDirectionEC * tbn;
        vec3 viewDirection = viewDirectionEC * tbn;
        vec3 halfwayDirection = halfwayDirectionEC * tbn;
        float anisotropyStrength = material.anisotropyStrength;
        float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
        float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
        float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
        float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
        vec3 specularContribution = F * G * D;
    #else
        float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
        vec3 specularContribution = F * specularStrength;
    #endif

    vec3 diffuseColor = material.diffuse;
    // F here represents the specular contribution
    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);

    // Lo = (diffuse + specular) * Li * NdotL
    return (diffuseContribution + specularContribution) * NdotL;
}
`;var UMt=T(S(),1),_G=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral

// Input color is non-negative and resides in the Linear Rec. 709 color space.
// Output color is also Linear Rec. 709, but in the [0, 1] range.

vec3 czm_pbrNeutralTonemapping(vec3 color) {
    const float startCompression = 0.8 - 0.04;
    const float desaturation = 0.15;

    float x = min(color.r, min(color.g, color.b));
    float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
    color -= offset;

    float peak = max(color.r, max(color.g, color.b));
    if (peak < startCompression) return color;

    const float d = 1.0 - startCompression;
    float newPeak = 1.0 - d * d / (peak + d - startCompression);
    color *= newPeak / peak;

    float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
    return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
}
`;var BMt=T(S(),1),TG=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
{
    return czm_getLambertDiffuse(lightDirectionEC, material.normal);
}

float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
{
    return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
}

/**
 * Computes a color using the Phong lighting model.
 *
 * @name czm_phong
 * @glslFunction
 *
 * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
 * @param {czm_material} material The fragment's material.
 *
 * @returns {vec4} The computed color.
 *
 * @example
 * vec3 positionToEyeEC = // ...
 * czm_material material = // ...
 * vec3 lightDirectionEC = // ...
 * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
 *
 * @see czm_getMaterial
 */
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    // Diffuse from directional light sources at eye (for top-down)
    float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
    if (czm_sceneMode == czm_sceneMode3D) {
        // (and horizon views in 3D)
        diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
    }

    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);

    // Temporary workaround for adding ambient.
    vec3 materialDiffuse = material.diffuse * 0.5;

    vec3 ambient = materialDiffuse;
    vec3 color = ambient + material.emission;
    color += materialDiffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}

vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);

    vec3 ambient = vec3(0.0);
    vec3 color = ambient + material.emission;
    color += material.diffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}
`;var YMt=T(S(),1),SG=`/**
 * Computes distance from a point to a plane.
 *
 * @name czm_planeDistance
 * @glslFunction
 *
 * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
 * param {vec3} point A point in the same space as the plane.
 * returns {float} The distance from the point to the plane.
 */
float czm_planeDistance(vec4 plane, vec3 point) {
    return (dot(plane.xyz, point) + plane.w);
}

/**
 * Computes distance from a point to a plane.
 *
 * @name czm_planeDistance
 * @glslFunction
 *
 * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
 * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
 * param {vec3} point A point in the same space as the plane.
 * returns {float} The distance from the point to the plane.
 */
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
    return (dot(planeNormal, point) + planeDistance);
}
`;var zMt=T(S(),1),CG=`/**
 * Computes the point along a ray at the given time.  <code>time</code> can be positive, negative, or zero.
 *
 * @name czm_pointAlongRay
 * @glslFunction
 *
 * @param {czm_ray} ray The ray to compute the point along.
 * @param {float} time The time along the ray.
 * 
 * @returns {vec3} The point along the ray at the given time.
 * 
 * @example
 * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
 * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
 */
vec3 czm_pointAlongRay(czm_ray ray, float time)
{
    return ray.origin + (time * ray.direction);
}
`;var JMt=T(S(),1),VG=`/**
 * DOC_TBA
 *
 * @name czm_rayEllipsoidIntersectionInterval
 * @glslFunction
 */
czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
{
   // ray and ellipsoid center in eye coordinates.  radii in model coordinates.
    vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
    vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;

    q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;

    float q2 = dot(q, q);
    float qw = dot(q, w);

    if (q2 > 1.0) // Outside ellipsoid.
    {
        if (qw >= 0.0) // Looking outward or tangent (0 intersections).
        {
            return czm_emptyRaySegment;
        }
        else // qw < 0.0.
        {
            float qw2 = qw * qw;
            float difference = q2 - 1.0; // Positively valued.
            float w2 = dot(w, w);
            float product = w2 * difference;

            if (qw2 < product) // Imaginary roots (0 intersections).
            {
                return czm_emptyRaySegment;
            }
            else if (qw2 > product) // Distinct roots (2 intersections).
            {
                float discriminant = qw * qw - product;
                float temp = -qw + sqrt(discriminant); // Avoid cancellation.
                float root0 = temp / w2;
                float root1 = difference / temp;
                if (root0 < root1)
                {
                    czm_raySegment i = czm_raySegment(root0, root1);
                    return i;
                }
                else
                {
                    czm_raySegment i = czm_raySegment(root1, root0);
                    return i;
                }
            }
            else // qw2 == product.  Repeated roots (2 intersections).
            {
                float root = sqrt(difference / w2);
                czm_raySegment i = czm_raySegment(root, root);
                return i;
            }
        }
    }
    else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
    {
        float difference = q2 - 1.0; // Negatively valued.
        float w2 = dot(w, w);
        float product = w2 * difference; // Negatively valued.
        float discriminant = qw * qw - product;
        float temp = -qw + sqrt(discriminant); // Positively valued.
        czm_raySegment i = czm_raySegment(0.0, temp / w2);
        return i;
    }
    else // q2 == 1.0. On ellipsoid.
    {
        if (qw < 0.0) // Looking inward.
        {
            float w2 = dot(w, w);
            czm_raySegment i = czm_raySegment(0.0, -qw / w2);
            return i;
        }
        else // qw >= 0.0.  Looking outward or tangent.
        {
            return czm_emptyRaySegment;
        }
    }
}
`;var jMt=T(S(),1),LG=`/**
 * Compute the intersection interval of a ray with a sphere.
 *
 * @name czm_raySphereIntersectionInterval
 * @glslFunction
 *
 * @param {czm_ray} ray The ray.
 * @param {vec3} center The center of the sphere.
 * @param {float} radius The radius of the sphere.
 * @return {czm_raySegment} The intersection interval of the ray with the sphere.
 */
czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
{
    vec3 o = ray.origin;
    vec3 d = ray.direction;

    vec3 oc = o - center;

    float a = dot(d, d);
    float b = 2.0 * dot(d, oc);
    float c = dot(oc, oc) - (radius * radius);

    float det = (b * b) - (4.0 * a * c);

    if (det < 0.0) {
        return czm_emptyRaySegment;
    }

    float sqrtDet = sqrt(det);

    float t0 = (-b - sqrtDet) / (2.0 * a);
    float t1 = (-b + sqrtDet) / (2.0 * a);

    czm_raySegment result = czm_raySegment(t0, t1);
    return result;
}
`;var $Mt=T(S(),1),RG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
    return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var tNt=T(S(),1),ZG=`/**
 * Reads a value previously transformed with {@link czm_writeNonPerspective}
 * by dividing it by \`w\`, the value used in the perspective divide.
 * This function is intended to be called in a fragment shader to access a
 * \`varying\` that should not be subject to perspective interpolation.
 * For example, screen-space texture coordinates. The value should have been
 * previously written in the vertex shader with a call to
 * {@link czm_writeNonPerspective}.
 *
 * @name czm_readNonPerspective
 * @glslFunction
 *
 * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
 * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
 * @returns {float|vec2|vec3|vec4} The usable value.
 */
float czm_readNonPerspective(float value, float oneOverW) {
    return value * oneOverW;
}

vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
    return value * oneOverW;
}

vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
    return value * oneOverW;
}

vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
    return value * oneOverW;
}
`;var iNt=T(S(),1),GG=`float czm_reverseLogDepth(float logZ)
{
#ifdef LOG_DEPTH
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = exp2(log2Depth) - 1.0;
    return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
    return logZ;
}
`;var rNt=T(S(),1),EG=`/**
 * Round a floating point value. This function exists because round() doesn't
 * exist in GLSL 1.00. 
 *
 * @param {float|vec2|vec3|vec4} value The value to round
 * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
 */
float czm_round(float value) {
  return floor(value + 0.5);
}

vec2 czm_round(vec2 value) {
  return floor(value + 0.5);
}

vec3 czm_round(vec3 value) {
  return floor(value + 0.5);
}

vec4 czm_round(vec4 value) {
  return floor(value + 0.5);
}
`;var aNt=T(S(),1),IG=`/**
 * Adjusts the saturation of a color.
 * 
 * @name czm_saturation
 * @glslFunction
 * 
 * @param {vec3} rgb The color.
 * @param {float} adjustment The amount to adjust the saturation of the color.
 *
 * @returns {float} The color with the saturation adjusted.
 *
 * @example
 * vec3 greyScale = czm_saturation(color, 0.0);
 * vec3 doubleSaturation = czm_saturation(color, 2.0);
 */
vec3 czm_saturation(vec3 rgb, float adjustment)
{
    // Algorithm from Chapter 16 of OpenGL Shading Language
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    vec3 intensity = vec3(dot(rgb, W));
    return mix(intensity, rgb, adjustment);
}
`;var lNt=T(S(),1),XG=`
float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
{
    return czm_unpackDepth(czm_textureCube(shadowMap, d));
}

float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
{
#ifdef USE_SHADOW_DEPTH_TEXTURE
    return texture(shadowMap, uv).r;
#else
    return czm_unpackDepth(texture(shadowMap, uv));
#endif
}

float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
{
    return step(depth, czm_sampleShadowMap(shadowMap, uv));
}

float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
{
    return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
`;var uNt=T(S(),1),WG=`
float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
{
#ifdef USE_NORMAL_SHADING
#ifdef USE_NORMAL_SHADING_SMOOTH
    float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
#else
    float strength = step(0.0, nDotL);
#endif
    visibility *= strength;
#endif

    visibility = max(visibility, darkness);
    return visibility;
}

#ifdef USE_CUBE_MAP_SHADOW
float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec3 uvw = shadowParameters.texCoords;

    depth -= depthBias;
    float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#else
float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec2 uv = shadowParameters.texCoords;

    depth -= depthBias;
#ifdef USE_SOFT_SHADOWS
    vec2 texelStepSize = shadowParameters.texelStepSize;
    float radius = 1.0;
    float dx0 = -texelStepSize.x * radius;
    float dy0 = -texelStepSize.y * radius;
    float dx1 = texelStepSize.x * radius;
    float dy1 = texelStepSize.y * radius;
    float visibility = (
        czm_shadowDepthCompare(shadowMap, uv, depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
    ) * (1.0 / 9.0);
#else
    float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
#endif

    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#endif
`;var hNt=T(S(),1),PG=`/**
 * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.  This is similar to the GLSL
 * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
 * 
 * @name czm_signNotZero
 * @glslFunction
 *
 * @param {} value The value for which to determine the sign.
 * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
 */
float czm_signNotZero(float value)
{
    return value >= 0.0 ? 1.0 : -1.0;
}

vec2 czm_signNotZero(vec2 value)
{
    return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
}

vec3 czm_signNotZero(vec3 value)
{
    return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
}

vec4 czm_signNotZero(vec4 value)
{
    return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
}
`;var pNt=T(S(),1),vG=`/**
 * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
 * <p>
 * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
 * </p>
 *
 * @name czm_sphericalHarmonics
 * @glslFunction
 *
 * @param {vec3} normal The normalized direction.
 * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
 * @returns {vec3} The color at the direction.
 *
 * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
 */
vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
{
    vec3 L00 = coefficients[0];
    vec3 L1_1 = coefficients[1];
    vec3 L10 = coefficients[2];
    vec3 L11 = coefficients[3];
    vec3 L2_2 = coefficients[4];
    vec3 L2_1 = coefficients[5];
    vec3 L20 = coefficients[6];
    vec3 L21 = coefficients[7];
    vec3 L22 = coefficients[8];

    float x = normal.x;
    float y = normal.y;
    float z = normal.z;

    vec3 L =
          L00
        + L1_1 * y
        + L10 * z
        + L11 * x
        + L2_2 * (y * x)
        + L2_1 * (y * z)
        + L20 * (3.0 * z * z - 1.0)
        + L21 * (z * x)
        + L22 * (x * x - y * y);
        
    return max(L, vec3(0.0));
}
`;var gNt=T(S(),1),wG=`/**
 * Converts an sRGB color to a linear RGB color.
 *
 * @param {vec3|vec4} srgbIn The color in sRGB space
 * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
 */
vec3 czm_srgbToLinear(vec3 srgbIn)
{
    return pow(srgbIn, vec3(2.2));
}

vec4 czm_srgbToLinear(vec4 srgbIn) 
{
    vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
    return vec4(linearOut, srgbIn.a);
}
`;var xNt=T(S(),1),FG=`/**
 * Creates a matrix that transforms vectors from tangent space to eye space.
 *
 * @name czm_tangentToEyeSpaceMatrix
 * @glslFunction
 *
 * @param {vec3} normalEC The normal vector in eye coordinates.
 * @param {vec3} tangentEC The tangent vector in eye coordinates.
 * @param {vec3} bitangentEC The bitangent vector in eye coordinates.
 *
 * @returns {mat3} The matrix that transforms from tangent space to eye space.
 *
 * @example
 * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
 * vec3 normal = tangentToEye * texture(normalMap, st).xyz;
 */
mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
{
    vec3 normal = normalize(normalEC);
    vec3 tangent = normalize(tangentEC);
    vec3 bitangent = normalize(bitangentEC);
    return mat3(tangent.x  , tangent.y  , tangent.z,
                bitangent.x, bitangent.y, bitangent.z,
                normal.x   , normal.y   , normal.z);
}
`;var TNt=T(S(),1),AG=`/**
 * A wrapper around the texture (WebGL2) / textureCube (WebGL1)
 * function to allow for WebGL 1 support.
 * 
 * @name czm_textureCube
 * @glslFunction
 *
 * @param {samplerCube} sampler The sampler.
 * @param {vec3} p The coordinate at which to sample the texture.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
    return texture(sampler, p);
#else
    return textureCube(sampler, p);
#endif
}

/**
 * A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
 * function to allow for WebGL 1 support in fragment shaders.
 *
 * @name czm_textureCubeLod
 * @glslFunction
 *
 * @param {samplerCube} sampler The sampler.
 * @param {vec3} p The coordinate at which to sample the texture.
 * @param {float} lod The mipmap level from which to sample.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
#if __VERSION__ == 300
    return textureLod(sampler, p, lod);
#elif defined(GL_EXT_shader_texture_lod)
    return textureCubeLodEXT(sampler, p, lod);
#endif
}`;var CNt=T(S(),1),MG=`/**
 * Transforms a plane.
 * 
 * @name czm_transformPlane
 * @glslFunction
 *
 * @param {vec4} plane The plane in Hessian Normal Form.
 * @param {mat4} transform The inverse-transpose of a transformation matrix.
 */
vec4 czm_transformPlane(vec4 plane, mat4 transform) {
    vec4 transformedPlane = transform * plane;
    // Convert the transformed plane to Hessian Normal Form
    float normalMagnitude = length(transformedPlane.xyz);
    return transformedPlane / normalMagnitude;
}
`;var LNt=T(S(),1),NG=`/**
 * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
 * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
 * be relative to the eye.  As shown in the example, the position can then be transformed in eye
 * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
 * respectively.
 * <p>
 * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
 * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
 * </p>
 *
 * @name czm_translateRelativeToEye
 * @glslFunction
 *
 * @param {vec3} high The position's high bits.
 * @param {vec3} low The position's low bits.
 * @returns {vec3} The position translated to be relative to the camera's position.
 *
 * @example
 * in vec3 positionHigh;
 * in vec3 positionLow;
 *
 * void main()
 * {
 *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
 *   gl_Position = czm_modelViewProjectionRelativeToEye * p;
 * }
 *
 * @see czm_modelViewRelativeToEye
 * @see czm_modelViewProjectionRelativeToEye
 * @see czm_computePosition
 * @see EncodedCartesian3
 */
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
    vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
    // This check handles the case when NaN values have gotten into \`highDifference\`.
    // Such a thing could happen on devices running iOS.
    if (length(highDifference) == 0.0) {  
        highDifference = vec3(0);  
    }
    vec3 lowDifference = low - czm_encodedCameraPositionMCLow;

    return vec4(highDifference + lowDifference, 1.0);
}
`;var ZNt=T(S(),1),kG=`/**
 * @private
 */
vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    // Diffuse from directional light sources at eye (for top-down and horizon views)
    float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);

    if (czm_sceneMode == czm_sceneMode3D) {
        // (and horizon views in 3D)
        diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
    }

    diffuse = clamp(diffuse, 0.0, 1.0);

    float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);

    // Temporary workaround for adding ambient.
    vec3 materialDiffuse = material.diffuse * 0.5;

    vec3 ambient = materialDiffuse;
    vec3 color = ambient + material.emission;
    color += materialDiffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}
`;var ENt=T(S(),1),UG=`/**
 * Returns the transpose of the matrix.  The input <code>matrix</code> can be
 * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
 *
 * @name czm_transpose
 * @glslFunction
 *
 * @param {} matrix The matrix to transpose.
 *
 * @returns {} The transposed matrix.
 *
 * @example
 * // GLSL declarations
 * mat2 czm_transpose(mat2 matrix);
 * mat3 czm_transpose(mat3 matrix);
 * mat4 czm_transpose(mat4 matrix);
 *
 * // Transpose a 3x3 rotation matrix to find its inverse.
 * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
 *     positionMC, normalEC);
 * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
 */
mat2 czm_transpose(mat2 matrix)
{
    return mat2(
        matrix[0][0], matrix[1][0],
        matrix[0][1], matrix[1][1]);
}

mat3 czm_transpose(mat3 matrix)
{
    return mat3(
        matrix[0][0], matrix[1][0], matrix[2][0],
        matrix[0][1], matrix[1][1], matrix[2][1],
        matrix[0][2], matrix[1][2], matrix[2][2]);
}

mat4 czm_transpose(mat4 matrix)
{
    return mat4(
        matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
        matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
        matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
        matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
}
`;var XNt=T(S(),1),DG=`vec2 getLookupUv(vec2 dimensions, int i) {
    int pixY = i / int(dimensions.x);
    int pixX = i - (pixY * int(dimensions.x));
    float pixelWidth = 1.0 / dimensions.x;
    float pixelHeight = 1.0 / dimensions.y;
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    return vec2(u, v);
}

vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
    vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
    return texture(extentsTexture, getLookupUv(textureDimensions, index));
}`;var PNt=T(S(),1),BG=`/**
 * Unpacks a vec4 depth value to a float in [0, 1) range.
 *
 * @name czm_unpackDepth
 * @glslFunction
 *
 * @param {vec4} packedDepth The packed depth.
 *
 * @returns {float} The floating-point depth in [0, 1) range.
 */
float czm_unpackDepth(vec4 packedDepth)
{
    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
    return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
}
`;var wNt=T(S(),1),OG=`/**
 * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
 *
 * @name czm_unpackFloat
 * @glslFunction
 *
 * @param {vec4} packedFloat The packed float.
 *
 * @returns {float} The floating-point depth in arbitrary range.
 */
float czm_unpackFloat(vec4 packedFloat)
{
    // Convert to [0.0, 255.0] and round to integer
    packedFloat = floor(packedFloat * 255.0 + 0.5);
    float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
    float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;    
    if (exponent == -127.0)
    {
        return 0.0;
    }
    float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
    float result = sign * exp2(exponent - 23.0) * mantissa;
    return result;
}
`;var ANt=T(S(),1),YG=`/**
 * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
 * so the return value is an int.
 * <p>
 * There are also precision limitations in WebGL 1. highp int is still limited
 * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
 * </p>
 *
 * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
 *
 * @return {int} The unpacked value.
 */
 int czm_unpackUint(float packedValue) {
   float rounded = czm_round(packedValue * 255.0);
   return int(rounded);
 }

 int czm_unpackUint(vec2 packedValue) {
   vec2 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec2(1.0, 256.0)));
 }

 int czm_unpackUint(vec3 packedValue) {
   vec3 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
 }

 int czm_unpackUint(vec4 packedValue) {
   vec4 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
 }
`;var NNt=T(S(),1),HG=`/**
 * Transform metadata values following the EXT_structural_metadata spec
 * by multiplying by scale and adding the offset. Operations are always
 * performed component-wise, even for matrices.
 * 
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
 *
 * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
 */
float czm_valueTransform(float offset, float scale, float value) {
  return scale * value + offset;
}

vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
  return scale * value + offset;
}

vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
  return scale * value + offset;
}

vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
  return scale * value + offset;
}

mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
  return matrixCompMult(scale, value) + offset;
}

mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
  return matrixCompMult(scale, value) + offset;
}

mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
  return matrixCompMult(scale, value) + offset;
}
`;var UNt=T(S(),1),zG=`#ifdef LOG_DEPTH
// 1.0 at the near plane, increasing linearly from there.
out float v_depthFromNearPlusOne;
#ifdef SHADOW_MAP
out vec3 v_logPositionEC;
#endif
#endif

vec4 czm_updatePositionDepth(vec4 coords) {
#if defined(LOG_DEPTH)

#ifdef SHADOW_MAP
    vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
    v_logPositionEC = logPositionEC;
#endif

    // With the very high far/near ratios used with the logarithmic depth
    // buffer, floating point rounding errors can cause linear depth values
    // to end up on the wrong side of the far plane, even for vertices that
    // are really nowhere near it. Since we always write a correct logarithmic
    // depth value in the fragment shader anyway, we just need to make sure
    // such errors don't cause the primitive to be clipped entirely before
    // we even get to the fragment shader.
    coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
#endif

    return coords;
}

/**
 * Writes the logarithmic depth to gl_Position using the already computed gl_Position.
 *
 * @name czm_vertexLogDepth
 * @glslFunction
 */
void czm_vertexLogDepth()
{
#ifdef LOG_DEPTH
    v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
    gl_Position = czm_updatePositionDepth(gl_Position);
#endif
}

/**
 * Writes the logarithmic depth to gl_Position using the provided clip coordinates.
 * <p>
 * An example use case for this function would be moving the vertex in window coordinates
 * before converting back to clip coordinates. Use the original vertex clip coordinates.
 * </p>
 * @name czm_vertexLogDepth
 * @glslFunction
 *
 * @param {vec4} clipCoords The vertex in clip coordinates.
 *
 * @example
 * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
 */
void czm_vertexLogDepth(vec4 clipCoords)
{
#ifdef LOG_DEPTH
    v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
    czm_updatePositionDepth(clipCoords);
#endif
}
`;var BNt=T(S(),1),KG=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
{
    // Reconstruct NDC coordinates
    float x = 2.0 * screenCoordinate.x - 1.0;
    float y = 2.0 * screenCoordinate.y - 1.0;
    float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
    vec4 q = vec4(x, y, z, 1.0);

    // Reverse the perspective division to obtain clip coordinates.
    q /= screenCoordinate.w;

    // Reverse the projection transformation to obtain eye coordinates.
    if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
    {
        q = czm_inverseProjection * q;
    }
    else
    {
        float top = czm_frustumPlanes.x;
        float bottom = czm_frustumPlanes.y;
        float left = czm_frustumPlanes.z;
        float right = czm_frustumPlanes.w;

        float near = czm_currentFrustum.x;
        float far = czm_currentFrustum.y;

        q.x = (q.x * (right - left) + left + right) * 0.5;
        q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
        q.z = (q.z * (near - far) - near - far) * 0.5;
        q.w = 1.0;
    }

    return q;
}

/**
 * Transforms a position from window to eye coordinates.
 * The transform from window to normalized device coordinates is done using components
 * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
 * the inverse of <code>czm_viewportTransformation</code>. The transformation from
 * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
 * which is expected to be the scalar used in the perspective divide. The transformation
 * from clip to eye coordinates is done using {@link czm_inverseProjection}.
 *
 * @name czm_windowToEyeCoordinates
 * @glslFunction
 *
 * @param {vec4} fragmentCoordinate The position in window coordinates to transform.
 *
 * @returns {vec4} The transformed position in eye coordinates.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_eyeToWindowCoordinates
 * @see czm_inverseProjection
 * @see czm_viewport
 * @see czm_viewportTransformation
 *
 * @example
 * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
 */
vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
{
    vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
    return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
}

vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
{
    // See reverseLogDepth.glsl. This is separate to re-use the pow.
#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = exp2(log2Depth) - 1.0;
    float depthFromCamera = depthFromNear + near;
    vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
    eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
    return eyeCoordinate;
#else
    vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
#endif
    return eyeCoordinate;
}

/**
 * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
 * This function produces more accurate results for window positions with log depth than
 * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
 * of czm_windowToEyeCoordinates.
 *
 * @name czm_windowToEyeCoordinates
 * @glslFunction
 *
 * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
 * @param {float} depthOrLogDepth A depth or log depth for the fragment.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_eyeToWindowCoordinates
 * @see czm_inverseProjection
 * @see czm_viewport
 * @see czm_viewportTransformation
 *
 * @returns {vec4} The transformed position in eye coordinates.
 */
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
{
    vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
    return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
}
`;var YNt=T(S(),1),JG=`// emulated noperspective
#if !defined(LOG_DEPTH)
in float v_WindowZ;
#endif

/**
 * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
 * by writing the fragment's depth. See czm_depthClamp for more details.
 *
 * @name czm_writeDepthClamp
 * @glslFunction
 *
 * @example
 * out_FragColor = color;
 * czm_writeDepthClamp();
 *
 * @see czm_depthClamp
 */
void czm_writeDepthClamp()
{
#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
#endif
}
`;var zNt=T(S(),1),QG=`#ifdef LOG_DEPTH
in float v_depthFromNearPlusOne;

#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#endif

#endif

/**
 * Writes the fragment depth to the logarithmic depth buffer.
 * <p>
 * Use this when the vertex shader does not call {@link czm_vertexLogDepth}, for example, when
 * ray-casting geometry using a full screen quad.
 * </p>
 * @name czm_writeLogDepth
 * @glslFunction
 *
 * @param {float} depth The depth coordinate, where 1.0 is on the near plane and
 *                      depth increases in eye-space units from there
 *
 * @example
 * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
 */
void czm_writeLogDepth(float depth)
{
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    // Discard the vertex if it's not between the near and far planes.
    // We allow a bit of epsilon on the near plane comparison because a 1.0
    // from the vertex shader (indicating the vertex should be _on_ the near
    // plane) will not necessarily come here as exactly 1.0.
    if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
        discard;
    }

#ifdef POLYGON_OFFSET
    // Polygon offset: m * factor + r * units
    float factor = u_polygonOffset[0];
    float units = u_polygonOffset[1];

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    // This factor doesn't work in IE 10
    if (factor != 0.0) {
        // m = sqrt(dZdX^2 + dZdY^2);
        float x = dFdx(depth);
        float y = dFdy(depth);
        float m = sqrt(x * x + y * y);

        // Apply the factor before computing the log depth.
        depth += m * factor;
    }
#endif

#endif

    gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;

#ifdef POLYGON_OFFSET
    // Apply the units after the log depth.
    gl_FragDepth += czm_epsilon7 * units;
#endif

#endif
}

/**
 * Writes the fragment depth to the logarithmic depth buffer.
 * <p>
 * Use this when the vertex shader calls {@link czm_vertexLogDepth}.
 * </p>
 *
 * @name czm_writeLogDepth
 * @glslFunction
 */
void czm_writeLogDepth() {
#ifdef LOG_DEPTH
    czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;var JNt=T(S(),1),jG=`/**
 * Transforms a value for non-perspective interpolation by multiplying
 * it by w, the value used in the perspective divide. This function is
 * intended to be called in a vertex shader to compute the value of a
 * \`varying\` that should not be subject to perspective interpolation.
 * For example, screen-space texture coordinates. The fragment shader
 * must call {@link czm_readNonPerspective} to retrieve the final
 * non-perspective value.
 *
 * @name czm_writeNonPerspective
 * @glslFunction
 *
 * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
 * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
 * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
 *          fragment shader with {@link czm_readNonPerspective}.
 */
float czm_writeNonPerspective(float value, float w) {
    return value * w;
}

vec2 czm_writeNonPerspective(vec2 value, float w) {
    return value * w;
}

vec3 czm_writeNonPerspective(vec3 value, float w) {
    return value * w;
}

vec4 czm_writeNonPerspective(vec4 value, float w) {
    return value * w;
}
`;var Tx={czm_degreesPerRadian:VR,czm_depthRange:LR,czm_epsilon1:RR,czm_epsilon2:ZR,czm_epsilon3:GR,czm_epsilon4:ER,czm_epsilon5:IR,czm_epsilon6:XR,czm_epsilon7:WR,czm_infinity:PR,czm_oneOverPi:vR,czm_oneOverTwoPi:wR,czm_passCesium3DTile:FR,czm_passCesium3DTileClassification:AR,czm_passCesium3DTileClassificationIgnoreShow:MR,czm_passClassification:NR,czm_passCompute:kR,czm_passEnvironment:UR,czm_passGlobe:DR,czm_passOpaque:BR,czm_passOverlay:OR,czm_passTerrainClassification:YR,czm_passTranslucent:HR,czm_passVoxels:zR,czm_pi:KR,czm_piOverFour:JR,czm_piOverSix:QR,czm_piOverThree:jR,czm_piOverTwo:qR,czm_radiansPerDegree:$R,czm_sceneMode2D:eZ,czm_sceneMode3D:tZ,czm_sceneModeColumbusView:nZ,czm_sceneModeMorphing:iZ,czm_solarRadius:oZ,czm_threePiOver2:rZ,czm_twoPi:sZ,czm_webMercatorMaxLatitude:aZ,czm_depthRangeStruct:cZ,czm_material:lZ,czm_materialInput:dZ,czm_modelMaterial:uZ,czm_modelVertexOutput:mZ,czm_ray:hZ,czm_raySegment:fZ,czm_shadowParameters:pZ,czm_HSBToRGB:bZ,czm_HSLToRGB:gZ,czm_RGBToHSB:yZ,czm_RGBToHSL:xZ,czm_RGBToXYZ:_Z,czm_XYZToRGB:TZ,czm_acesTonemapping:SZ,czm_alphaWeight:CZ,czm_antialias:VZ,czm_applyHSBShift:LZ,czm_approximateSphericalCoordinates:RZ,czm_approximateTanh:ZZ,czm_backFacing:GZ,czm_branchFreeTernary:EZ,czm_cascadeColor:IZ,czm_cascadeDistance:XZ,czm_cascadeMatrix:WZ,czm_cascadeWeights:PZ,czm_clipPolygons:vZ,czm_columbusViewMorph:wZ,czm_computeAtmosphereColor:FZ,czm_computeGroundAtmosphereScattering:AZ,czm_computePosition:MZ,czm_computeScattering:NZ,czm_cosineAndSine:kZ,czm_decompressTextureCoordinates:UZ,czm_depthClamp:DZ,czm_eastNorthUpToEyeCoordinates:BZ,czm_ellipsoidContainsPoint:OZ,czm_ellipsoidTextureCoordinates:YZ,czm_equalsEpsilon:HZ,czm_eyeOffset:zZ,czm_eyeToWindowCoordinates:KZ,czm_fastApproximateAtan:JZ,czm_fog:QZ,czm_gammaCorrect:jZ,czm_geodeticSurfaceNormal:qZ,czm_getDefaultMaterial:$Z,czm_getDynamicAtmosphereLightDirection:eG,czm_getLambertDiffuse:tG,czm_getSpecular:nG,czm_getWaterNoise:iG,czm_hue:oG,czm_inverseGamma:rG,czm_isEmpty:sG,czm_isFull:aG,czm_latitudeToWebMercatorFraction:cG,czm_lineDistance:lG,czm_linearToSrgb:dG,czm_luminance:uG,czm_maximumComponent:mG,czm_metersPerPixel:hG,czm_modelToWindowCoordinates:fG,czm_multiplyWithColorBalance:pG,czm_nearFarScalar:bG,czm_octDecode:gG,czm_packDepth:yG,czm_pbrLighting:xG,czm_pbrNeutralTonemapping:_G,czm_phong:TG,czm_planeDistance:SG,czm_pointAlongRay:CG,czm_rayEllipsoidIntersectionInterval:VG,czm_raySphereIntersectionInterval:LG,czm_readDepth:RG,czm_readNonPerspective:ZG,czm_reverseLogDepth:GG,czm_round:EG,czm_saturation:IG,czm_shadowDepthCompare:XG,czm_shadowVisibility:WG,czm_signNotZero:PG,czm_sphericalHarmonics:vG,czm_srgbToLinear:wG,czm_tangentToEyeSpaceMatrix:FG,czm_textureCube:AG,czm_transformPlane:MG,czm_translateRelativeToEye:NG,czm_translucentPhong:kG,czm_transpose:UG,czm_unpackClippingExtents:DG,czm_unpackDepth:BG,czm_unpackFloat:OG,czm_unpackUint:YG,czm_valueTransform:HG,czm_vertexLogDepth:zG,czm_windowToEyeCoordinates:KG,czm_writeDepthClamp:JG,czm_writeLogDepth:QG,czm_writeNonPerspective:jG};var ZUt=T(S(),1);function fGe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,`
varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable
${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif
${n}`,n=`#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
${n}`,n}var qG=fGe;function cte(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=`
`;return i})}function lte(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=cte(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function dte(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Ms._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=lte(i,Ms._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),dte(o,t)}}))}function pGe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function bGe(e){let t=[],n=lte("main",e,t);dte(n,t),pGe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function ute(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=`
#line 0
${s[i]}`;r=cte(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,_){return a=_,`
`});let c=[];r=r.replace(/#extension.*\n/gm,function(x){return c.push(x),`
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let d=e.pickColorQualifier;l(d)&&(r=Ms.createPickFragmentShaderSource(r,d));let u="",h=c.length;for(i=0;i<h;i++)u+=c[i];t&&(u+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
    precision highp float;
    precision highp int;
#else
    precision mediump float;
    precision mediump int;
    #define highp mediump
#endif

`);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let x=p[i];x.length!==0&&(u+=`#define ${x}
`)}n.textureFloatLinear&&(u+=`#define OES_texture_float_linear

`),n.floatingPointTexture&&(u+=`#define OES_texture_float

`);let g="";e.includeBuiltIns&&(g=bGe(r)),u+=`
#line 0
`;let f=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(f)&&!/czm_out_FragColor/g.test(f)&&/out_FragColor/g.test(f)&&(u+=`layout(location = 0) out vec4 out_FragColor;

`),u+=g,u+=r,n.webgl2?u=`#version 300 es
${u}`:u=qG(u,t),u}function Ms(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}Ms.prototype.clone=function(){return new Ms({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ms.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ms.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
`);return`${t}:${n}:${i}:${o}`};Ms.prototype.createCombinedVertexShader=function(e){return ute(this,!1,e)};Ms.prototype.createCombinedFragmentShader=function(e){return ute(this,!0,e)};Ms._czmBuiltinsAndUniforms={};for(let e in Tx)Tx.hasOwnProperty(e)&&(Ms._czmBuiltinsAndUniforms[e]=Tx[e]);for(let e in _p)if(_p.hasOwnProperty(e)){let t=_p[e];typeof t.getDeclaration=="function"&&(Ms._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ms.createPickVertexShaderSource=function(e){return`${Ms.replaceMain(e,"czm_old_main")}
in vec4 pickColor; 
out vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    czm_pickColor = pickColor; 
}`};Ms.createPickFragmentShaderSource=function(e,t){let n=Ms.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    if (out_FragColor.a == 0.0) { 
       discard; 
    } 
    out_FragColor = czm_pickColor; 
}`;return`${n}
${i}`};function gGe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function mte(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function hte(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(mte(e,o))return o}}var yGe=["v_normalEC","v_normal"];Ms.findNormalVarying=function(e){return mte(e,"#ifdef HAS_NORMALS")?gGe(e,"HAS_NORMALS")?"v_normalEC":void 0:hte(e,yGe)};var xGe=["v_positionEC"];Ms.findPositionVarying=function(e){return hte(e,xGe)};var De=Ms;function Wm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Wm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Wm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function _Ge(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Wm.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new De({sources:[t]})),typeof n=="string"&&(n=new De({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?_Ge(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let d=this._context,u=t.createCombinedVertexShader(d),h=n.createCombinedFragmentShader(d),p=new $t({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Wm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){bY(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Wm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Wm.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new De({sources:[r]})),typeof s=="string"&&(s=new De({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),h=new $t({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function bY(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];bY(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Wm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];bY(this,n),--this._numberOfShaders}this._shadersToRelease={}};Wm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Wm.prototype.isDestroyed=function(){return!1};Wm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return me(this)};var $G=Wm;var $Ut=T(S(),1);function Pm(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=it.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new qt}=e,{width:c,height:d}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(d)||(d=n.videoHeight??n.naturalHeight??n.height));let u=e.preMultiplyAlpha||i===it.RGB||i===it.LUMINANCE,h=it.toInternalFormat(i,o,t),p=it.isCompressedFormat(h),g=t._gl,f=p?it.compressedTextureSizeInBytes(i,c,d):it.textureSizeInBytes(i,o,c,d);this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._dimensions=new D(c,d),this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,gte(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?it.isCompressedFormat(h)?TGe(this,n):fte(this,n):l(n.framebuffer)?CGe(this,n):pte(this,n),this._initialized=!0):bte(this),g.bindTexture(this._textureTarget,null)}function TGe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,d=a;for(let u=0;u<t.mipLevels.length;++u)c=jN(c),d=jN(d),i.compressedTexImage2D(o,u+1,r,c,d,0,t.mipLevels[u])}}function fte(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:d,flipY:u}=e,h=it.alignmentInBytes(c,d,s);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(u&&(p=it.flipY(p,c,d,s,a)),i.texImage2D(o,0,r,s,a,0,c,je.toWebGLConstant(d,n),p),l(t.mipLevels)){let g=s,f=a;for(let x=0;x<t.mipLevels.length;++x)g=jN(g),f=jN(f),i.texImage2D(o,x+1,r,g,f,0,c,je.toWebGLConstant(d,n),t.mipLevels[x])}}function SGe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:d}=e,u=it.alignmentInBytes(c,d,o);a.pixelStorei(a.UNPACK_ALIGNMENT,u),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=it.flipY(t,c,d,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,je.toWebGLConstant(d,s),t)}function CGe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function pte(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,je.toWebGLConstant(e.pixelDatatype,n),t)}function VGe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,je.toWebGLConstant(e.pixelDatatype,o),t)}function jN(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function bte(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,je.toWebGLConstant(e._pixelDatatype,t),null)}Pm.create=function(e){return new Pm(e)};Pm.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=it.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new Pm({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Pm.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){gte(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function gte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[jt.NEAREST_MIPMAP_NEAREST,jt.NEAREST_MIPMAP_LINEAR,jt.LINEAR_MIPMAP_NEAREST,jt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===je.FLOAT&&!r.textureFloatLinear||a===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?jt.NEAREST_MIPMAP_NEAREST:jt.NEAREST,i=hi.NEAREST),r.webgl2&&it.isDepthFormat(s)&&(n=jt.NEAREST,i=hi.NEAREST);let c=r._gl,d=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(d,e._texture),c.texParameteri(d,c.TEXTURE_MIN_FILTER,n),c.texParameteri(d,c.TEXTURE_MAG_FILTER,i),c.texParameteri(d,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(d,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(d,null)}Pm.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,d=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,d=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let u=!1;this._initialized||(t===0&&n===0&&c===this._width&&d===this._height?(l(i.arrayBufferView)?fte(this,i):pte(this,i),u=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),bte(this)),this._initialized=!0),u||(l(i.arrayBufferView)?SGe(this,i.arrayBufferView,t,n,c,d):VGe(this,i,t,n)),s.bindTexture(a,null)};Pm.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Pm.prototype.generateMipmap=function(e){e=y(e,df.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),me(this)};var vt=Pm;var iDt=T(S(),1);function Sx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Sx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Sx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Sx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};Sx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};Sx.prototype.isDestroyed=function(){return!1};Sx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return me(this)};var eE=Sx;var aBt=T(S(),1);var RDt=T(S(),1);var _Dt=T(S(),1);var uDt=T(S(),1);function Su(e){this.planes=y(e,[])}var tE=[new m,new m,new m];m.clone(m.UNIT_X,tE[0]);m.clone(m.UNIT_Y,tE[1]);m.clone(m.UNIT_Z,tE[2]);var B0=new m,LGe=new m,yte=new sn(new m(1,0,0),0);Su.fromBoundingSphere=function(e,t){l(t)||(t=new Su);let n=tE.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=tE[a],d=i[s],u=i[s+1];l(d)||(d=i[s]=new se),l(u)||(u=i[s+1]=new se),m.multiplyByScalar(c,-r,B0),m.add(o,B0,B0),d.x=c.x,d.y=c.y,d.z=c.z,d.w=-m.dot(c,B0),m.multiplyByScalar(c,r,B0),m.add(o,B0,B0),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-m.dot(m.negate(c,LGe),B0),s+=2}return t};Su.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(sn.fromCartesian4(t[i],yte));if(r===Ht.OUTSIDE)return Ht.OUTSIDE;r===Ht.INTERSECTING&&(n=!0)}return n?Ht.INTERSECTING:Ht.INSIDE};Su.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Su.MASK_OUTSIDE||t===Su.MASK_INSIDE)return t;let n=Su.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&(t&s)===0)continue;let a=e.intersectPlane(sn.fromCartesian4(i[o],yte));if(a===Ht.OUTSIDE)return Su.MASK_OUTSIDE;a===Ht.INTERSECTING&&(n|=s)}return n};Su.MASK_OUTSIDE=4294967295;Su.MASK_INSIDE=0;Su.MASK_INDETERMINATE=2147483647;var hs=Su;function uf(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new hs,this._orthographicMatrix=new A}function xte(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=A.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(uf.prototype,{projectionMatrix:{get:function(){return xte(this),this._orthographicMatrix}}});var RGe=new m,ZGe=new m,GGe=new m,gY=new m;uf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,RGe);m.normalize(u,u);let h=ZGe;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=GGe;m.multiplyByScalar(u,a,p),m.add(h,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=u.x,g.y=u.y,g.z=u.z,g.w=-m.dot(u,p),m.multiplyByScalar(u,s,p),m.add(h,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-u.x,g.y=-u.y,g.z=-u.z,g.w=-m.dot(m.negate(u,gY),p),m.multiplyByScalar(n,r,p),m.add(h,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,o,p),m.add(h,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,gY),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,h),m.multiplyByScalar(t,d,p),m.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,gY),p),this._cullingVolume};uf.prototype.getPixelDimensions=function(e,t,n,i,o){xte(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};uf.prototype.clone=function(e){return l(e)||(e=new uf),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};uf.prototype.equals=function(e){return l(e)&&e instanceof uf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};uf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof uf&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var Pr=uf;function Gl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Pr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}Gl.packedLength=4;Gl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Gl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Gl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function O0(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Gl.prototype,{projectionMatrix:{get:function(){return O0(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return O0(this),this._offCenterFrustum}}});Gl.prototype.computeCullingVolume=function(e,t,n){return O0(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Gl.prototype.getPixelDimensions=function(e,t,n,i,o){return O0(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Gl.prototype.clone=function(e){return l(e)||(e=new Gl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Gl.prototype.equals=function(e){return!l(e)||!(e instanceof Gl)?!1:(O0(this),O0(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Gl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Gl)?!1:(O0(this),O0(e),W.equalsEpsilon(this.width,e.width,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var an=Gl;var wDt=T(S(),1);var yY={};function EGe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var IGe=32.184,XGe=2451545;function Mte(e,t){t=q.addSeconds(e,IGe,t);let n=q.totalDays(t)-XGe;return t=q.addSeconds(t,EGe(n),t),t}var qN=new q(2451545,0,zn.TAI),WGe=1e3,Cu=W.RADIANS_PER_DEGREE,hd=W.RADIANS_PER_ARCSECOND,Ia=14959787e4,_te=new $;function Nte(e,t,n,i,o,r,s){n<0&&(n=-n,o+=W.PI);let a=e*(1-t),c=i-o,d=o,u=vGe(r-i,t),h=PGe(t,0);NGe(c,n,d,_te);let p=a*(1+t),g=Math.cos(u),f=Math.sin(u),x=1+t*g,_=p/x;return l(s)?(s.x=_*g,s.y=_*f,s.z=0):s=new m(_*g,_*f,0),$.multiplyByVector(_te,s,s)}function PGe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function vGe(e,t){let n=AGe(e,t);return MGe(n,t)}var wGe=50,FGe=W.EPSILON8;function AGe(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<wGe&&Math.abs(o-i)>FGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function MGe(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function NGe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new $(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var kGe=1.0000010178*Ia,UGe=100.46645683*Cu,DGe=129597742283429e-5*hd,Tte=16002,Ste=21863,Cte=32004,Vte=10931,Lte=14529,Rte=16368,Zte=15318,Gte=32794,BGe=64*1e-7*Ia,OGe=-152*1e-7*Ia,YGe=62*1e-7*Ia,HGe=-8*1e-7*Ia,zGe=32*1e-7*Ia,KGe=-41*1e-7*Ia,JGe=19*1e-7*Ia,QGe=-11*1e-7*Ia,jGe=-150*1e-7*Ia,qGe=-46*1e-7*Ia,$Ge=68*1e-7*Ia,eEe=54*1e-7*Ia,tEe=14*1e-7*Ia,nEe=24*1e-7*Ia,iEe=-28*1e-7*Ia,oEe=22*1e-7*Ia,Ete=10,Ite=16002,Xte=21863,Wte=10931,Pte=1473,vte=32004,wte=4387,Fte=73,rEe=-325*1e-7,sEe=-322*1e-7,aEe=-79*1e-7,cEe=232*1e-7,lEe=-52*1e-7,dEe=97*1e-7,uEe=55*1e-7,mEe=-41*1e-7,hEe=-105*1e-7,fEe=-137*1e-7,pEe=258*1e-7,bEe=35*1e-7,gEe=-116*1e-7,yEe=-88*1e-7,xEe=-112*1e-7,_Ee=-80*1e-7,nC=new q(0,0,zn.TAI);function TEe(e,t){Mte(e,nC);let i=(nC.dayNumber-qN.dayNumber+(nC.secondsOfDay-qN.secondsOfDay)/Kn.SECONDS_PER_DAY)/(Kn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=kGe+BGe*Math.cos(Tte*o)+jGe*Math.sin(Tte*o)+OGe*Math.cos(Ste*o)+qGe*Math.sin(Ste*o)+YGe*Math.cos(Cte*o)+$Ge*Math.sin(Cte*o)+HGe*Math.cos(Vte*o)+eEe*Math.sin(Vte*o)+zGe*Math.cos(Lte*o)+tEe*Math.sin(Lte*o)+KGe*Math.cos(Rte*o)+nEe*Math.sin(Rte*o)+JGe*Math.cos(Zte*o)+iEe*Math.sin(Zte*o)+QGe*Math.cos(Gte*o)+oEe*Math.sin(Gte*o),s=UGe+DGe*i+rEe*Math.cos(Ete*o)+hEe*Math.sin(Ete*o)+sEe*Math.cos(Ite*o)+fEe*Math.sin(Ite*o)+aEe*Math.cos(Xte*o)+pEe*Math.sin(Xte*o)+cEe*Math.cos(Wte*o)+bEe*Math.sin(Wte*o)+lEe*Math.cos(Pte*o)+gEe*Math.sin(Pte*o)+dEe*Math.cos(vte*o)+yEe*Math.sin(vte*o)+uEe*Math.cos(wte*o)+xEe*Math.sin(wte*o)+mEe*Math.cos(Fte*o)+_Ee*Math.sin(Fte*o),a=.0167086342-.0004203654*i,c=102.93734808*Cu+11612.3529*hd*i,d=469.97289*hd*i,u=174.87317577*Cu-8679.27034*hd*i;return Nte(r,a,d,c,u,s,t)}function kte(e,t){Mte(e,nC);let i=(nC.dayNumber-qN.dayNumber+(nC.secondsOfDay-qN.secondsOfDay)/Kn.SECONDS_PER_DAY)/Kn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*Cu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Cu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Cu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Cu,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Cu+hd*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Cu+hd*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*Cu+hd*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),R=357.52910918*Cu+hd*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*Cu-hd*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,v=4*C,P=6*C,w=2*L,M=3*L,b=4*L,Z=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-L)-235.6*Math.cos(L)+218.1*Math.cos(I-R)+181*Math.cos(I+L),c+=.014216*Math.cos(I-L)+.008551*Math.cos(I-w)-.001383*Math.cos(L)+.001356*Math.cos(I+L)-.001147*Math.cos(v-M)-914e-6*Math.cos(v-w)+869e-6*Math.cos(I-R-L)-627e-6*Math.cos(I)-394e-6*Math.cos(v-b)+282e-6*Math.cos(I-R-w)-279e-6*Math.cos(C-L)-236e-6*Math.cos(w)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(w-Z),u+=486.26*Math.cos(I-Z)-40.13*Math.cos(I)+37.51*Math.cos(Z)+25.73*Math.cos(w-Z)+19.97*Math.cos(I-R-Z),p+=-55609*Math.sin(I-L)-34711*Math.sin(I-w)-9792*Math.sin(L)+9385*Math.sin(v-M)+7505*Math.sin(v-w)+5318*Math.sin(I+L)+3484*Math.sin(v-b)-3417*Math.sin(I-R-L)-2530*Math.sin(P-b)-2376*Math.sin(I)-2075*Math.sin(I-M)-1883*Math.sin(w)-1736*Math.sin(P-5*L)+1626*Math.sin(R)-1370*Math.sin(P-M),f+=-5392*Math.sin(I-Z)-540*Math.sin(R)-441*Math.sin(I)+423*Math.sin(Z)-288*Math.sin(w-Z),_+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-L)-662.5*Math.sin(R)+396.3*Math.sin(L)-218*Math.sin(I-R);let E=2*G,X=3*G;u+=46.997*Math.cos(G)*i-.614*Math.cos(I-Z+G)*i+.614*Math.cos(I-Z-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(I-Z+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(X)*r+4e-5*Math.cos(E)*r;let F=2.116*Math.sin(G)*i-.111*Math.sin(I-Z-G)*i-.0015*Math.sin(G)*o;p+=F,_+=F,f+=-520.77*Math.sin(G)*i+13.66*Math.sin(I-Z+G)*i+1.12*Math.sin(I-G)*i-1.06*Math.sin(Z-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(I-Z+E)*o-.015*Math.sin(I-Z+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(X)*r-9e-4*Math.sin(E)*r,a*=WGe;let N=d+u*hd,O=h+p*hd,U=x+_*hd,Y=g+f*hd;return Nte(a,c,N,O,Y,U,t)}var Ate=.012300034,SEe=Ate/(Ate+1)*-1;function CEe(e,t){return t=kte(e,t),m.multiplyByScalar(t,SEe,t)}var Ute=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),nE=new m;yY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),l(t)||(t=new m),nE=TEe(e,nE),t=m.negate(nE,t),CEe(e,nE),m.subtract(t,nE,t),$.multiplyByVector(Ute,t,t),t};yY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),t=kte(e,t),$.multiplyByVector(Ute,t,t),t};var Y0=yY;var ADt=T(S(),1),$N={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};$N.getMorphTime=function(e){return e===$N.SCENE3D?1:e===$N.MORPHING?void 0:0};var oe=Object.freeze($N);var UDt=T(S(),1);function VEe(e){e=y(e,y.EMPTY_OBJECT),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,2)}var Xp=VEe;function iC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=A.clone(A.IDENTITY),this._viewportTransformation=A.clone(A.IDENTITY),this._model=A.clone(A.IDENTITY),this._view=A.clone(A.IDENTITY),this._inverseView=A.clone(A.IDENTITY),this._projection=A.clone(A.IDENTITY),this._infiniteProjection=A.clone(A.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(A.IDENTITY),this._view3DDirty=!0,this._view3D=new A,this._inverseView3DDirty=!0,this._inverseView3D=new A,this._inverseModelDirty=!0,this._inverseModel=new A,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new A,this._modelViewDirty=!0,this._modelView=new A,this._modelView3DDirty=!0,this._modelView3D=new A,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new A,this._inverseModelViewDirty=!0,this._inverseModelView=new A,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new A,this._viewProjectionDirty=!0,this._viewProjection=new A,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new A,this._modelViewProjectionDirty=!0,this._modelViewProjection=new A,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new A,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new A,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new A,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new On,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new D,this._eyeEllipsoidNormalEC=new m,this._eyeEllipsoidCurvature=new D,this._modelToEnu=new A,this._enuToModel=new A,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new B,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new m,this._atmosphereRayleighScaleHeight=new m,this._atmosphereMieCoefficient=new m,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(iC.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Bte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Bte(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){A.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,A.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,A.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return _Y(this),this._view3D}},viewRotation:{get:function(){return _Y(this),this._viewRotation}},viewRotation3D:{get:function(){return _Y(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Hte(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Hte(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return wEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return FEe(this),this._modelView}},modelView3D:{get:function(){return AEe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return BEe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return MEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return NEe(this),this._inverseModelView3D}},viewProjection:{get:function(){return kEe(this),this._viewProjection}},inverseViewProjection:{get:function(){return UEe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return DEe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return OEe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return YEe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return HEe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return zEe(this),this._normal}},normal3D:{get:function(){return KEe(this),this._normal3D}},inverseNormal:{get:function(){return JEe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return QEe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return Yte(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Yte(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ne.default)}}});function LEe(e,t){A.clone(t,e._view),A.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function REe(e,t){A.clone(t,e._inverseView),A.getMatrix3(t,e._inverseViewRotation)}function ZEe(e,t){A.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function GEe(e,t){A.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Dte=new m,EEe=new A;function IEe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,Dte)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Dte)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Pt.eastNorthUpToFixedFrame(i,n,EEe);e._enuToModel=A.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=A.inverseTransformation(e._enuToModel,e._modelToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var xY=new $,XEe=new he;function WEe(e,t){Pt.computeIcrfToCentralBodyFixedMatrix(t.time,xY);let n=Y0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(xY,n,n),m.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Y0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(xY,n,n),$.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,XEe);i.project(r,e._sunPositionColumbusView)}iC.prototype.updateCamera=function(e){LEe(this,e.viewMatrix),REe(this,e.inverseViewMatrix),IEe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof an};iC.prototype.updateFrustum=function(e){ZEe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&GEe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};iC.prototype.updatePass=function(e){this._pass=e};var PEe=[],vEe=new Xp;iC.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===oe.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),WEe(this,e);let n=y(e.light,vEe);n instanceof Xp?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,PEe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=m.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Pt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,h;l(d)?u.height>u.width?h=Math.tan(.5*d)*2/u.height:h=Math.tan(.5*d)*2/u.width:h=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,B.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Bte(e){if(e._viewportDirty){let t=e._viewport;A.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),A.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function wEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?A.inverse(e._projection,e._inverseProjection):A.clone(A.ZERO,e._inverseProjection))}function FEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,A.multiplyTransformation(e._view,e._model,e._modelView))}function AEe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,A.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function MEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,A.inverse(e.modelView,e._inverseModelView))}function NEe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,A.inverse(e.modelView3D,e._inverseModelView3D))}function kEe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,A.multiply(e._projection,e._view,e._viewProjection))}function UEe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,A.inverse(e.viewProjection,e._inverseViewProjection))}function DEe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,A.multiply(e._projection,e.modelView,e._modelViewProjection))}function BEe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function OEe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,A.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function YEe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,A.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function HEe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,A.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function zEe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;A.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function KEe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;A.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function JEe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;A.getMatrix3(e.modelView,t),$.transpose(t,t)}}function QEe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;A.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Ote=new m;function Yte(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,A.multiplyByPoint(e.inverseModel,e._cameraPosition,Ote),On.fromCartesian(Ote,e._encodedCameraPositionMC))}var jEe=new m,qEe=new m,$Ee=new m,eIe=new m,tIe=new he,nIe=new m,iIe=new A;function oIe(e,t,n,i,o,r,s,a){let c=jEe;c.x=e.y,c.y=e.z,c.z=e.x;let d=qEe;d.x=n.y,d.y=n.z,d.z=n.x;let u=$Ee;u.x=i.y,u.y=i.z,u.z=i.x;let h=eIe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,tIe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let g=s.ellipsoid,f=g.cartographicToCartesian(p,nIe),x=Pt.eastNorthUpToFixedFrame(f,g,iIe);return A.multiplyByPointAsVector(x,d,d),A.multiplyByPointAsVector(x,u,u),A.multiplyByPointAsVector(x,h,h),l(a)||(a=new A),a[0]=d.x,a[1]=u.x,a[2]=-h.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-h.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-h.z,a[11]=0,a[12]=-m.dot(d,f),a[13]=-m.dot(u,f),a[14]=m.dot(h,f),a[15]=1,a}function _Y(e){e._view3DDirty&&(e._mode===oe.SCENE3D?A.clone(e._view,e._view3D):oIe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),A.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Hte(e){e._inverseView3DDirty&&(A.inverseTransformation(e.view3D,e._inverseView3D),A.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var iE=iC;function Vu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):rIe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new $G(this),this._textureCache=new eE;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),At._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),At._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),At._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),At._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),At._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),At._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),At._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),At._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),At._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),At._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),At._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);At._minimumAliasedLineWidth=u[0],At._maximumAliasedLineWidth=u[1];let h=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);At._minimumAliasedPointSize=h[0],At._maximumAliasedPointSize=h[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);At._maximumViewportWidth=p[0],At._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);At._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);At._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!_r(d,["OES_standard_derivatives"]),this._blendMinmax=!!_r(d,["EXT_blend_minmax"]),this._elementIndexUint=!!_r(d,["OES_element_index_uint"]),this._depthTexture=!!_r(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!_r(d,["EXT_frag_depth"]),this._debugShaders=_r(d,["WEBGL_debug_shaders"]),this._textureFloat=!!_r(d,["OES_texture_float"]),this._textureHalfFloat=!!_r(d,["OES_texture_half_float"]),this._textureFloatLinear=!!_r(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!_r(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!_r(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!_r(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!_r(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!_r(d,["EXT_color_buffer_half_float"]),this._s3tc=!!_r(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!_r(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!_r(d,["WEBGL_compressed_texture_astc"]),this._etc=!!_r(d,["WEBG_compressed_texture_etc"]),this._etc1=!!_r(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!_r(d,["EXT_texture_compression_bptc"]),Zl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?_r(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,At._maximumTextureFilterAnisotropy=l(x)?d.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,R,G,I,v,P,w;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(X){E._gl.bindVertexArray(X)},V=function(X){E._gl.deleteVertexArray(X)},L=function(X,F,N,O,U){d.drawElementsInstanced(X,F,N,O,U)},R=function(X,F,N,O){d.drawArraysInstanced(X,F,N,O)},G=function(X,F){d.vertexAttribDivisor(X,F)},I=function(X){d.drawBuffers(X)}}else v=_r(d,["OES_vertex_array_object"]),l(v)&&(_=function(){return v.createVertexArrayOES()},C=function(E){v.bindVertexArrayOES(E)},V=function(E){v.deleteVertexArrayOES(E)}),P=_r(d,["ANGLE_instanced_arrays"]),l(P)&&(L=function(E,X,F,N,O){P.drawElementsInstancedANGLE(E,X,F,N,O)},R=function(E,X,F,N){P.drawArraysInstancedANGLE(E,X,F,N)},G=function(E,X){P.vertexAttribDivisorANGLE(E,X)}),w=_r(d,["WEBGL_draw_buffers"]),l(w)&&(I=function(E){w.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=R,this.glVertexAttribDivisor=G,this.glDrawBuffers=I,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!w,At._maximumDrawBuffers=this.drawBuffers?d.getParameter(ie.MAX_DRAW_BUFFERS):1,At._maximumColorAttachments=this.drawBuffers?d.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new B(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let M=new iE,b=new oc(this),Z=Ue.fromCache();this._defaultPassState=b,this._defaultRenderState=Z,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=M,this._currentRenderState=Z,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E<At._maximumVertexAttributes;E++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ue.apply(d,Z,b)}function rIe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new ae("The browser does not support WebGL.  Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function sIe(e,t){let n="WebGL Error:  ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function aIe(e,t,n,i){let o=`${sIe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function cIe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(aIe(e,t,n,i))}function lIe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function dIe(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,lIe(e,o,t))}return i}function _r(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var uIe={};Object.defineProperties(Vu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=dIe(this._originalGLContext,e?cIe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new vt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new vt({context:this,pixelFormat:it.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new vt({context:this,pixelFormat:it.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new xr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return uIe}}});function zte(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,o,t,r,n,i)}var TY;typeof WebGLRenderingContext<"u"&&(TY=[ie.BACK]);function SY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=TY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var mIe=new ti;Vu.prototype.clear=function(e,t){e=y(e,mIe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(B.equals(this._clearColor,o)||(B.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);zte(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);SY(this,c),n.clear(i)};function hIe(e,t,n,i,o){SY(e,t),zte(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function fIe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,A.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Vu.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),hIe(this,o,t,n,r),fIe(this,e,n,i)};Vu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=TY;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Vu.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=je.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=it.createTypedArray(it.RGBA,a,o,r);return SY(this,s),t.readPixels(n,i,o,r,it.RGBA,je.toWebGLConstant(a,this),c),c};var Kte={position:0,textureCoordinates:1};Vu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new lt({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:we.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:Kte,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Vu.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new $e({vertexArray:this.getViewportQuadVertexArray(),primitiveType:we.TRIANGLES,renderState:t.renderState,shaderProgram:$t.fromCache({context:this,vertexShaderSource:mx,fragmentShaderSource:e,attributeLocations:Kte}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Vu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function CY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(CY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});CY.prototype.destroy=function(){delete this._pickObjects[this.key]};Vu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects[t]=e,new CY(this._pickObjects,t,B.fromRgba(t))};Vu.prototype.isDestroyed=function(){return!1};Vu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),me(this)};var oE=Vu;var hOt=T(S(),1);var YBt=T(S(),1);function oC(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Wr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Wr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}oC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};oC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};oC.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};oC.prototype.isDestroyed=function(){return!1};oC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var rE=oC;var tOt=T(S(),1);var KBt=T(S(),1);var El={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===El.RGBA4||e===El.RGBA8||e===El.RGBA16F||e===El.RGBA32F||e===El.RGB5_A1||e===El.RGB565||e===El.DEPTH_COMPONENT16||e===El.STENCIL_INDEX8||e===El.DEPTH_STENCIL||e===El.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?El.RGBA32F:e===ie.HALF_FLOAT_OES?El.RGBA16F:El.RGBA8}},Mc=Object.freeze(El);function sE(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=At.maximumRenderbufferSize,o=y(e.format,Mc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(sE.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});sE.prototype._getRenderbuffer=function(){return this._renderbuffer};sE.prototype.isDestroyed=function(){return!1};sE.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var fd=sE;function Ss(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(Ss.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,je.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,it.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new vt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:qt.NEAREST}),this._numSamples>1){let a=Mc.getColorFormat(o);this._colorRenderbuffers[s]=new fd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new vt({context:e,width:t,height:n,pixelFormat:it.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new fd({context:e,width:t,height:n,format:Mc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new fd({context:e,width:t,height:n,format:Mc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new vt({context:e,width:t,height:n,pixelFormat:it.DEPTH_COMPONENT,pixelDatatype:je.UNSIGNED_INT,sampler:qt.NEAREST}):this._depthRenderbuffer=new fd({context:e,width:t,height:n,format:Mc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new rE({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Wr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var fi=Ss;var EOt=T(S(),1);var pOt=T(S(),1);var Cx={VERTEX:0,FRAGMENT:1,BOTH:2};Cx.includesVertexShader=function(e){return e===Cx.VERTEX||e===Cx.BOTH};Cx.includesFragmentShader=function(e){return e===Cx.FRAGMENT||e===Cx.BOTH};var ye=Object.freeze(Cx);var gOt=T(S(),1);function VY(e){this.name=e,this.fields=[]}VY.prototype.addField=function(e,t){let n=`    ${e} ${t};`;this.fields.push(n)};VY.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=["    float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var aE=VY;var xOt=T(S(),1);function LY(e){this.signature=e,this.body=[]}LY.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(`    ${e[i]}`)}else t.push(`    ${e}`)};LY.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var cE=LY;function Nc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Nc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Nc.prototype.addDefine=function(e,t,n){n=y(n,ye.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),ye.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ye.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Nc.prototype.addStruct=function(e,t,n){this._structs[e]=new aE(t),ye.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ye.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Nc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Nc.prototype.addFunction=function(e,t,n){this._functions[e]=new cE(t),ye.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ye.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Nc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Nc.prototype.addUniform=function(e,t,n){n=y(n,ye.BOTH);let i=`uniform ${e} ${t};`;ye.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ye.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Nc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Nc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=bIe(e),i};Nc.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Nc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Nc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Nc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=pIe(this),i=gIe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new De({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new De({defines:this._fragmentShaderParts.defineLines,sources:[s]});return $t.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Nc.prototype.clone=function(){return Ye(this,!0)};function pIe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function bIe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function gIe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var Vx=Nc;var KOt=T(S(),1);var POt=T(S(),1);function lE({x:e,y:t,width:n,height:i}){this.rectangle=new Ke(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function RY({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new lE({x:n,y:n,width:e-2*n,height:t-2*n})}RY.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};RY.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,s=o-t,a=r-n;return s<0||a<0?void 0:s===0&&a===0?e:s>a?(e.childNode1=new lE({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new lE({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new lE({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new lE({x:i.x,y:i.y+n,width:o,height:a}),this._findNode(e.childNode1,{width:t,height:n}))}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var rC=RY;var Jte=16;function Il(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=e.initialSize??new D(Jte,Jte);this._pixelFormat=y(e.pixelFormat,it.RGBA),this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Hn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Il.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});Il.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new Ke),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,d=i.y,u=this._subRegions.get(e);if(l(u)){let h=this._rectangles[u];c+=h.x,d+=h.y}return t.x=c/o,t.y=d/r,t.width=s/o,t.height=a/r,t};Il.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new vt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,d=this._texture,u=new Wr({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),u._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;g<h.length;++g){let f=i[g],x=h[g];if(!l(f)||!l(x)||l(p.get(g)))continue;let{x:_,y:C,width:V,height:L}=f;a.copyTexSubImage2D(c,0,_,C,x.x,x.y,V,L)}return a.bindTexture(c,null),s._initialized=!0,u._unBind(),u.destroy(),s};Il.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,s=r.width,a=r.height,c=this._subRegions,d=i.map((V,L)=>new Qte({index:L,image:V})).filter((V,L)=>l(V.image)&&!l(c.get(L))),u=0,h=0,p=0;for(let V=t;V<o.length;++V){let{width:L,height:R}=o[V].image;u=Math.max(u,L),h=Math.max(h,R),p+=L*R,d.push(o[V])}s=Math.max(u,s),a=Math.max(h,a),e.webgl2||(s=W.nextPowerOfTwo(s),a=W.nextPowerOfTwo(a));let g=p,f=1;for(;g/s/a>=1;)f*=2,s>a?a*=f:s*=f;d.sort(({image:V},{image:L})=>L.height*L.width-V.height*V.width);let x=new Array(this._nextIndex);for(let V of this._subRegions.keys())l(c.get(V))&&(x[V]=i[V]);let _,C=!1;for(;!C;){_=new rC({height:a,width:s,borderPadding:n});let V;for(V=0;V<d.length;++V){let{index:L,image:R}=d[V];if(!l(R))continue;let G=_.pack(L,R);if(!l(G)){s>a?a*=2:s*=2;break}x[L]=G.rectangle}C=V===d.length}this._texturePacker=_,this._texture=this._copyFromTexture(e,s,a,x),r.destroy(),this._rectangles=x,this._guid=Hn()};Il.prototype.getImageIndex=function(e){return this._indexById.get(e)};Il.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function Qte({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Il.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Qte({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Il.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:s}=o,a=this._texturePacker.pack(s,r);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];l(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};Il.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new vt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new rC({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function yIe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Ze)&&(e=Ze.createIfNeeded(e).fetchImage()),e}Il.prototype.addImage=function(e,t){let n=this._indexPromiseById.get(e);if(l(n))return n;let i=this._nextIndex++;return this._indexById.set(e,i),n=(async()=>(t=await yIe(t,e),this.isDestroyed()||!l(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Il.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ae(`image with id "${e}" not found in the atlas.`);let i=this._indexPromiseById.get(e);for(let[r,s]of this._subRegions.entries())if(n===s&&this._rectangles[r].equals(t))return i.then(c=>c===-1?-1:r);let o=this._nextIndex++;return this._subRegions.set(o,n),this._rectangles[o]=t.clone(),i.then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return o})};Il.prototype.isDestroyed=function(){return!1};Il.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),me(this)};var Lx=Il;var o3t=T(S(),1);function Ns(e,t,n,i){let o=Ns._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,d=o.length;for(let h=0;h<d;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function u(h,p){return Q.getSizeInBytes(p.componentDatatype)-Q.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let h=Ns._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ns._createArrayViews(a,h)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ns._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,Q.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Me.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Ns._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Q.getSizeInBytes(a.componentDatatype)}let i=n>0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ns._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Q.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Q.getSizeInBytes(a)}return n};Ns.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Ns._resize(o,this._size),Ns._appendWriters(this.writers,o)}ZY(this)};Ns._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=Q.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var xIe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Ns._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=xIe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ns.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=_Ie(this,i)||t;if(t||!l(this.va)){ZY(this);let s=this.va=[],a=W.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let d=0;d<c;++d){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=d*(i.vertexSizeInBytes*a);Ns._appendAttributes(u,i,h,this._instanced)}u=u.concat(this._precreated),s.push({va:new ni({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function _Ie(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=xt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ns._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ns.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)TIe(n[i],e,t)};function TIe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ns.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function ZY(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ns.prototype.isDestroyed=function(){return!1};Ns.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return ZY(this),me(this)};var Wp=Ns;var c3t=T(S(),1);function SIe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ze.createIfNeeded(t.positiveX).fetchImage(i),Ze.createIfNeeded(t.negativeX).fetchImage(i),Ze.createIfNeeded(t.positiveY).fetchImage(i),Ze.createIfNeeded(t.negativeY).fetchImage(i),Ze.createIfNeeded(t.positiveZ).fetchImage(i),Ze.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new xr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var dE=SIe;var I3t=T(S(),1);var g3t=T(S(),1);function H0(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Ei(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(H0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});H0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};H0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};H0.prototype.rectangleToNativeRectangle=function(e,t){let n=W.toDegrees(e.west),i=W.toDegrees(e.south),o=W.toDegrees(e.east),r=W.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};H0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=W.toDegrees(o.west),o.south=W.toDegrees(o.south),o.east=W.toDegrees(o.east),o.north=W.toDegrees(o.north),o};H0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,d=(e+1)*a+o.west,u=o.height/s,h=o.north-t*u,p=o.north-(t+1)*u;return l(i)||(i=new ce(c,p,d,h)),i.west=c,i.south=p,i.east=d,i.north=h,i};H0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=W.TWO_PI);let d=(c-i.west)/s|0;d>=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new D(d,u)};var Hi=H0;var jte=new m,qte=new m,$te=new he,GY=new m,CIe=new m,ene=new le,VIe=new Hi,uE=[new he,new he,new he,new he],mE=new D,Jr={};Jr.initialize=function(){let e=Jr._initPromise;return l(e)||(e=Ze.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Jr._terrainHeights=t}),Jr._initPromise=e),e};Jr.getMinimumMaximumHeights=function(e,t){t=y(t,ne.default);let n=tne(e),i=Jr._defaultMinTerrainHeight,o=Jr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Jr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,$te),jte),t.cartographicToCartesian(ce.southwest(e,$te),qte),m.midpoint(qte,jte,GY);let a=t.scaleToGeodeticSurface(GY,CIe);if(l(a)){let c=m.distance(GY,a);i=Math.min(i,-c)}else i=Jr._defaultMinTerrainHeight}return i=Math.max(Jr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Jr.getBoundingSphere=function(e,t){t=y(t,ne.default);let n=tne(e),i=Jr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Jr._terrainHeights[r];l(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,ene),le.union(o,ene,o)};function tne(e){he.fromRadians(e.east,e.north,0,uE[0]),he.fromRadians(e.west,e.north,0,uE[1]),he.fromRadians(e.east,e.south,0,uE[2]),he.fromRadians(e.west,e.south,0,uE[3]);let t=0,n=0,i=0,o=0,r=Jr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=uE[c];if(VIe.positionToTileXY(d,s,mE),c===0)i=mE.x,o=mE.y;else if(i!==mE.x||o!==mE.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Jr._terrainHeightsMaxLevel=6;Jr._defaultMaxTerrainHeight=9e3;Jr._defaultMinTerrainHeight=-1e5;Jr._terrainHeights=void 0;Jr._initPromise=void 0;Object.defineProperties(Jr,{initialized:{get:function(){return l(Jr._terrainHeights)}}});var di=Jr;var Mzt=T(S(),1);var A3t=T(S(),1);var W3t=T(S(),1);/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */var{entries:une,setPrototypeOf:nne,isFrozen:LIe,getPrototypeOf:RIe,getOwnPropertyDescriptor:ZIe}=Object,{freeze:Uc,seal:Lu,create:mne}=Object,{apply:vY,construct:wY}=typeof Reflect<"u"&&Reflect;Uc||(Uc=function(t){return t});Lu||(Lu=function(t){return t});vY||(vY=function(t,n,i){return t.apply(n,i)});wY||(wY=function(t,n){return new t(...n)});var e5=Dc(Array.prototype.forEach),GIe=Dc(Array.prototype.lastIndexOf),ine=Dc(Array.prototype.pop),hE=Dc(Array.prototype.push),EIe=Dc(Array.prototype.splice),n5=Dc(String.prototype.toLowerCase),EY=Dc(String.prototype.toString),one=Dc(String.prototype.match),fE=Dc(String.prototype.replace),IIe=Dc(String.prototype.indexOf),XIe=Dc(String.prototype.trim),vm=Dc(Object.prototype.hasOwnProperty),kc=Dc(RegExp.prototype.test),pE=WIe(TypeError);function Dc(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return vY(e,t,i)}}function WIe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return wY(e,n)}}function Xi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n5;nne&&nne(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(LIe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function PIe(e){for(let t=0;t<e.length;t++)vm(e,t)||(e[t]=null);return e}function Rx(e){let t=mne(null);for(let[n,i]of une(e))vm(e,n)&&(Array.isArray(i)?t[n]=PIe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Rx(i):t[n]=i);return t}function bE(e,t){for(;e!==null;){let i=ZIe(e,t);if(i){if(i.get)return Dc(i.get);if(typeof i.value=="function")return Dc(i.value)}e=RIe(e)}function n(){return null}return n}var rne=Uc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),IY=Uc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),XY=Uc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vIe=Uc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),WY=Uc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),wIe=Uc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sne=Uc(["#text"]),ane=Uc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),PY=Uc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),cne=Uc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),t5=Uc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FIe=Lu(/\{\{[\w\W]*|[\w\W]*\}\}/gm),AIe=Lu(/<%[\w\W]*|[\w\W]*%>/gm),MIe=Lu(/\$\{[\w\W]*/gm),NIe=Lu(/^data-[\-\w.\u00B7-\uFFFF]+$/),kIe=Lu(/^aria-[\-\w]+$/),hne=Lu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),UIe=Lu(/^(?:\w+script|data):/i),DIe=Lu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fne=Lu(/^html$/i),BIe=Lu(/^[a-z][.\w]*(-[.\w]+)+$/i),lne=Object.freeze({__proto__:null,ARIA_ATTR:kIe,ATTR_WHITESPACE:DIe,CUSTOM_ELEMENT:BIe,DATA_ATTR:NIe,DOCTYPE_NAME:fne,ERB_EXPR:AIe,IS_ALLOWED_URI:hne,IS_SCRIPT_OR_DATA:UIe,MUSTACHE_EXPR:FIe,TMPLIT_EXPR:MIe}),gE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},OIe=function(){return typeof window>"u"?null:window},YIe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},dne=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function pne(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OIe(),t=ln=>pne(ln);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==gE.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,f=c.prototype,x=bE(f,"cloneNode"),_=bE(f,"remove"),C=bE(f,"nextSibling"),V=bE(f,"childNodes"),L=bE(f,"parentNode");if(typeof s=="function"){let ln=n.createElement("template");ln.content&&ln.content.ownerDocument&&(n=ln.content.ownerDocument)}let R,G="",{implementation:I,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:w}=n,{importNode:M}=i,b=dne();t.isSupported=typeof une=="function"&&typeof L=="function"&&I&&I.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Z,ERB_EXPR:E,TMPLIT_EXPR:X,DATA_ATTR:F,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:Y}=lne,{IS_ALLOWED_URI:k}=lne,H=null,K=Xi({},[...rne,...IY,...XY,...WY,...sne]),te=null,z=Xi({},[...ane,...PY,...cne,...t5]),j=Object.seal(mne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ee=null,fe=null,Te=!0,de=!0,xe=!1,Ce=!0,Ie=!1,Le=!0,Ne=!1,Oe=!1,qe=!1,Rt=!1,Lt=!1,ke=!1,zt=!0,ut=!1,mt="user-content-",Pn=!0,cn=!1,ge={},Ve=null,bn=Xi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),pt=null,so=Xi({},["audio","video","img","source","image","track"]),Eo=null,oa=Xi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gr="http://www.w3.org/1998/Math/MathML",_s="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml",rt=Fe,ze=!1,Qe=null,bt=Xi({},[Gr,_s,Fe],EY),Ot=Xi({},["mi","mo","mn","ms","mtext"]),Cn=Xi({},["annotation-xml"]),Io=Xi({},["title","style","font","a","script"]),So=null,Ka=["application/xhtml+xml","text/html"],Ja="text/html",Ci=null,bi=null,ra=n.createElement("form"),zr=function(Re){return Re instanceof RegExp||Re instanceof Function},Tl=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(bi&&bi===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=Rx(Re),So=Ka.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Ja:Re.PARSER_MEDIA_TYPE,Ci=So==="application/xhtml+xml"?EY:n5,H=vm(Re,"ALLOWED_TAGS")?Xi({},Re.ALLOWED_TAGS,Ci):K,te=vm(Re,"ALLOWED_ATTR")?Xi({},Re.ALLOWED_ATTR,Ci):z,Qe=vm(Re,"ALLOWED_NAMESPACES")?Xi({},Re.ALLOWED_NAMESPACES,EY):bt,Eo=vm(Re,"ADD_URI_SAFE_ATTR")?Xi(Rx(oa),Re.ADD_URI_SAFE_ATTR,Ci):oa,pt=vm(Re,"ADD_DATA_URI_TAGS")?Xi(Rx(so),Re.ADD_DATA_URI_TAGS,Ci):so,Ve=vm(Re,"FORBID_CONTENTS")?Xi({},Re.FORBID_CONTENTS,Ci):bn,ee=vm(Re,"FORBID_TAGS")?Xi({},Re.FORBID_TAGS,Ci):{},fe=vm(Re,"FORBID_ATTR")?Xi({},Re.FORBID_ATTR,Ci):{},ge=vm(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,Te=Re.ALLOW_ARIA_ATTR!==!1,de=Re.ALLOW_DATA_ATTR!==!1,xe=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Re.SAFE_FOR_TEMPLATES||!1,Le=Re.SAFE_FOR_XML!==!1,Ne=Re.WHOLE_DOCUMENT||!1,Rt=Re.RETURN_DOM||!1,Lt=Re.RETURN_DOM_FRAGMENT||!1,ke=Re.RETURN_TRUSTED_TYPE||!1,qe=Re.FORCE_BODY||!1,zt=Re.SANITIZE_DOM!==!1,ut=Re.SANITIZE_NAMED_PROPS||!1,Pn=Re.KEEP_CONTENT!==!1,cn=Re.IN_PLACE||!1,k=Re.ALLOWED_URI_REGEXP||hne,rt=Re.NAMESPACE||Fe,Ot=Re.MATHML_TEXT_INTEGRATION_POINTS||Ot,Cn=Re.HTML_INTEGRATION_POINTS||Cn,j=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&zr(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&zr(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(j.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(de=!1),Lt&&(Rt=!0),ge&&(H=Xi({},sne),te=[],ge.html===!0&&(Xi(H,rne),Xi(te,ane)),ge.svg===!0&&(Xi(H,IY),Xi(te,PY),Xi(te,t5)),ge.svgFilters===!0&&(Xi(H,XY),Xi(te,PY),Xi(te,t5)),ge.mathMl===!0&&(Xi(H,WY),Xi(te,cne),Xi(te,t5))),Re.ADD_TAGS&&(H===K&&(H=Rx(H)),Xi(H,Re.ADD_TAGS,Ci)),Re.ADD_ATTR&&(te===z&&(te=Rx(te)),Xi(te,Re.ADD_ATTR,Ci)),Re.ADD_URI_SAFE_ATTR&&Xi(Eo,Re.ADD_URI_SAFE_ATTR,Ci),Re.FORBID_CONTENTS&&(Ve===bn&&(Ve=Rx(Ve)),Xi(Ve,Re.FORBID_CONTENTS,Ci)),Pn&&(H["#text"]=!0),Ne&&Xi(H,["html","head","body"]),H.table&&(Xi(H,["tbody"]),delete ee.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw pE('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw pE('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=Re.TRUSTED_TYPES_POLICY,G=R.createHTML("")}else R===void 0&&(R=YIe(g,o)),R!==null&&typeof G=="string"&&(G=R.createHTML(""));Uc&&Uc(Re),bi=Re}},yo=Xi({},[...IY,...XY,...vIe]),Er=Xi({},[...WY,...wIe]),yp=function(Re){let Zt=L(Re);(!Zt||!Zt.tagName)&&(Zt={namespaceURI:rt,tagName:"template"});let gn=n5(Re.tagName),pr=n5(Zt.tagName);return Qe[Re.namespaceURI]?Re.namespaceURI===_s?Zt.namespaceURI===Fe?gn==="svg":Zt.namespaceURI===Gr?gn==="svg"&&(pr==="annotation-xml"||Ot[pr]):!!yo[gn]:Re.namespaceURI===Gr?Zt.namespaceURI===Fe?gn==="math":Zt.namespaceURI===_s?gn==="math"&&Cn[pr]:!!Er[gn]:Re.namespaceURI===Fe?Zt.namespaceURI===_s&&!Cn[pr]||Zt.namespaceURI===Gr&&!Ot[pr]?!1:!Er[gn]&&(Io[gn]||!yo[gn]):!!(So==="application/xhtml+xml"&&Qe[Re.namespaceURI]):!1},Kr=function(Re){hE(t.removed,{element:Re});try{L(Re).removeChild(Re)}catch{_(Re)}},mu=function(Re,Zt){try{hE(t.removed,{attribute:Zt.getAttributeNode(Re),from:Zt})}catch{hE(t.removed,{attribute:null,from:Zt})}if(Zt.removeAttribute(Re),Re==="is")if(Rt||Lt)try{Kr(Zt)}catch{}else try{Zt.setAttribute(Re,"")}catch{}},Qa=function(Re){let Zt=null,gn=null;if(qe)Re="<remove></remove>"+Re;else{let La=one(Re,/^[\r\n\t ]+/);gn=La&&La[0]}So==="application/xhtml+xml"&&rt===Fe&&(Re='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Re+"</body></html>");let pr=R?R.createHTML(Re):Re;if(rt===Fe)try{Zt=new p().parseFromString(pr,So)}catch{}if(!Zt||!Zt.documentElement){Zt=I.createDocument(rt,"template",null);try{Zt.documentElement.innerHTML=ze?G:pr}catch{}}let ja=Zt.body||Zt.documentElement;return Re&&gn&&ja.insertBefore(n.createTextNode(gn),ja.childNodes[0]||null),rt===Fe?w.call(Zt,Ne?"html":"body")[0]:Ne?Zt.documentElement:ja},$y=function(Re){return v.call(Re.ownerDocument||Re,Re,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},sa=function(Re){return Re instanceof h&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof u)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},Sl=function(Re){return typeof a=="function"&&Re instanceof a};function Wc(ln,Re,Zt){e5(ln,gn=>{gn.call(t,Re,Zt,bi)})}let ls=function(Re){let Zt=null;if(Wc(b.beforeSanitizeElements,Re,null),sa(Re))return Kr(Re),!0;let gn=Ci(Re.nodeName);if(Wc(b.uponSanitizeElement,Re,{tagName:gn,allowedTags:H}),Re.hasChildNodes()&&!Sl(Re.firstElementChild)&&kc(/<[/\w]/g,Re.innerHTML)&&kc(/<[/\w]/g,Re.textContent)||Re.nodeType===gE.progressingInstruction||Le&&Re.nodeType===gE.comment&&kc(/<[/\w]/g,Re.data))return Kr(Re),!0;if(!H[gn]||ee[gn]){if(!ee[gn]&&fu(gn)&&(j.tagNameCheck instanceof RegExp&&kc(j.tagNameCheck,gn)||j.tagNameCheck instanceof Function&&j.tagNameCheck(gn)))return!1;if(Pn&&!Ve[gn]){let pr=L(Re)||Re.parentNode,ja=V(Re)||Re.childNodes;if(ja&&pr){let La=ja.length;for(let Cl=La-1;Cl>=0;--Cl){let qh=x(ja[Cl],!0);qh.__removalCount=(Re.__removalCount||0)+1,pr.insertBefore(qh,C(Re))}}}return Kr(Re),!0}return Re instanceof c&&!yp(Re)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&kc(/<\/no(script|embed|frames)/i,Re.innerHTML)?(Kr(Re),!0):(Ie&&Re.nodeType===gE.text&&(Zt=Re.textContent,e5([Z,E,X],pr=>{Zt=fE(Zt,pr," ")}),Re.textContent!==Zt&&(hE(t.removed,{element:Re.cloneNode()}),Re.textContent=Zt)),Wc(b.afterSanitizeElements,Re,null),!1)},hu=function(Re,Zt,gn){if(zt&&(Zt==="id"||Zt==="name")&&(gn in n||gn in ra))return!1;if(!(de&&!fe[Zt]&&kc(F,Zt))){if(!(Te&&kc(N,Zt))){if(!te[Zt]||fe[Zt]){if(!(fu(Re)&&(j.tagNameCheck instanceof RegExp&&kc(j.tagNameCheck,Re)||j.tagNameCheck instanceof Function&&j.tagNameCheck(Re))&&(j.attributeNameCheck instanceof RegExp&&kc(j.attributeNameCheck,Zt)||j.attributeNameCheck instanceof Function&&j.attributeNameCheck(Zt))||Zt==="is"&&j.allowCustomizedBuiltInElements&&(j.tagNameCheck instanceof RegExp&&kc(j.tagNameCheck,gn)||j.tagNameCheck instanceof Function&&j.tagNameCheck(gn))))return!1}else if(!Eo[Zt]){if(!kc(k,fE(gn,U,""))){if(!((Zt==="src"||Zt==="xlink:href"||Zt==="href")&&Re!=="script"&&IIe(gn,"data:")===0&&pt[Re])){if(!(xe&&!kc(O,fE(gn,U,"")))){if(gn)return!1}}}}}}return!0},fu=function(Re){return Re!=="annotation-xml"&&one(Re,Y)},pu=function(Re){Wc(b.beforeSanitizeAttributes,Re,null);let{attributes:Zt}=Re;if(!Zt||sa(Re))return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},pr=Zt.length;for(;pr--;){let ja=Zt[pr],{name:La,namespaceURI:Cl,value:qh}=ja,YL=Ci(La),Pc=La==="value"?qh:XIe(qh);if(gn.attrName=YL,gn.attrValue=Pc,gn.keepAttr=!0,gn.forceKeepAttr=void 0,Wc(b.uponSanitizeAttribute,Re,gn),Pc=gn.attrValue,ut&&(YL==="id"||YL==="name")&&(mu(La,Re),Pc=mt+Pc),Le&&kc(/((--!?|])>)|<\/(style|title)/i,Pc)){mu(La,Re);continue}if(gn.forceKeepAttr||(mu(La,Re),!gn.keepAttr))continue;if(!Ce&&kc(/\/>/i,Pc)){mu(La,Re);continue}Ie&&e5([Z,E,X],hq=>{Pc=fE(Pc,hq," ")});let mq=Ci(Re.nodeName);if(hu(mq,YL,Pc)){if(R&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Cl)switch(g.getAttributeType(mq,YL)){case"TrustedHTML":{Pc=R.createHTML(Pc);break}case"TrustedScriptURL":{Pc=R.createScriptURL(Pc);break}}try{Cl?Re.setAttributeNS(Cl,La,Pc):Re.setAttribute(La,Pc),sa(Re)?Kr(Re):ine(t.removed)}catch{}}}Wc(b.afterSanitizeAttributes,Re,null)},Fo=function ln(Re){let Zt=null,gn=$y(Re);for(Wc(b.beforeSanitizeShadowDOM,Re,null);Zt=gn.nextNode();)Wc(b.uponSanitizeShadowNode,Zt,null),ls(Zt),pu(Zt),Zt.content instanceof r&&ln(Zt.content);Wc(b.afterSanitizeShadowDOM,Re,null)};return t.sanitize=function(ln){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Zt=null,gn=null,pr=null,ja=null;if(ze=!ln,ze&&(ln="<!-->"),typeof ln!="string"&&!Sl(ln))if(typeof ln.toString=="function"){if(ln=ln.toString(),typeof ln!="string")throw pE("dirty is not a string, aborting")}else throw pE("toString is not a function");if(!t.isSupported)return ln;if(Oe||Tl(Re),t.removed=[],typeof ln=="string"&&(cn=!1),cn){if(ln.nodeName){let qh=Ci(ln.nodeName);if(!H[qh]||ee[qh])throw pE("root node is forbidden and cannot be sanitized in-place")}}else if(ln instanceof a)Zt=Qa("<!---->"),gn=Zt.ownerDocument.importNode(ln,!0),gn.nodeType===gE.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?Zt=gn:Zt.appendChild(gn);else{if(!Rt&&!Ie&&!Ne&&ln.indexOf("<")===-1)return R&&ke?R.createHTML(ln):ln;if(Zt=Qa(ln),!Zt)return Rt?null:ke?G:""}Zt&&qe&&Kr(Zt.firstChild);let La=$y(cn?ln:Zt);for(;pr=La.nextNode();)ls(pr),pu(pr),pr.content instanceof r&&Fo(pr.content);if(cn)return ln;if(Rt){if(Lt)for(ja=P.call(Zt.ownerDocument);Zt.firstChild;)ja.appendChild(Zt.firstChild);else ja=Zt;return(te.shadowroot||te.shadowrootmode)&&(ja=M.call(i,ja,!0)),ja}let Cl=Ne?Zt.outerHTML:Zt.innerHTML;return Ne&&H["!doctype"]&&Zt.ownerDocument&&Zt.ownerDocument.doctype&&Zt.ownerDocument.doctype.name&&kc(fne,Zt.ownerDocument.doctype.name)&&(Cl="<!DOCTYPE "+Zt.ownerDocument.doctype.name+`>
`+Cl),Ie&&e5([Z,E,X],qh=>{Cl=fE(Cl,qh," ")}),R&&ke?R.createHTML(Cl):Cl},t.setConfig=function(){let ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tl(ln),Oe=!0},t.clearConfig=function(){bi=null,Oe=!1},t.isValidAttribute=function(ln,Re,Zt){bi||Tl({});let gn=Ci(ln),pr=Ci(Re);return hu(gn,pr,Zt)},t.addHook=function(ln,Re){typeof Re=="function"&&hE(b[ln],Re)},t.removeHook=function(ln,Re){if(Re!==void 0){let Zt=GIe(b[ln],Re);return Zt===-1?void 0:EIe(b[ln],Zt,1)[0]}return ine(b[ln])},t.removeHooks=function(ln){b[ln]=[]},t.removeAllHooks=function(){b=dne()},t}var bne=pne();var HIe=0,FY={};function mf(e,t){let n,i=e;l(FY[i])?n=FY[i]:(n=HIe++,FY[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(mf.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=bne.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});mf.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};mf.prototype.equals=function(e){return mf.equals(this,e)};mf.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};mf.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new mf(e.html,t)};mf.clone=function(e){if(l(e))return new mf(e.html,e.showOnScreen)};var Ct=mf;var N3t=T(S(),1),zIe={NONE:0,LERC:1},Ru=Object.freeze(zIe);var JHt=T(S(),1);var _Ht=T(S(),1);var Y3t=T(S(),1);function Bc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Bc.fromCorners=function(e,t,n){return l(n)||(n=new Bc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Bc.fromPoints=function(e,t){if(l(t)||(t=new Bc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],g=p.x,f=p.y,x=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(f,i),s=Math.max(f,s),o=Math.min(x,o),a=Math.max(x,a)}let d=t.minimum;d.x=n,d.y=i,d.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=m.midpoint(d,u,t.center),t};Bc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new Bc(e.minimum,e.maximum,e.center)};Bc.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var i5=new m;Bc.intersectPlane=function(e,t){i5=m.subtract(e.maximum,e.minimum,i5);let n=m.multiplyByScalar(i5,.5,i5),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=m.dot(e.center,i)+t.distance;return r-o>0?Ht.INSIDE:r+o<0?Ht.OUTSIDE:Ht.INTERSECTING};Bc.prototype.clone=function(e){return Bc.clone(this,e)};Bc.prototype.intersectPlane=function(e){return Bc.intersectPlane(this,e)};Bc.prototype.equals=function(e){return Bc.equals(this,e)};var z0=Bc;var $3t=T(S(),1);function hf(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(hf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var gne=new m;hf.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,gne);return MY(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};hf.prototype.isScaledSpacePointVisible=function(e){return MY(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var KIe=new m;hf.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=KIe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),MY(e,o,i)};hf.prototype.computeHorizonCullingPoint=function(e,t,n){return _ne(this._ellipsoid,e,t,n)};var yne=ne.clone(ne.UNIT_SPHERE);hf.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=xne(this._ellipsoid,n,yne);return _ne(o,e,t,i)};hf.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Tne(this._ellipsoid,e,t,n,i,o)};hf.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=xne(this._ellipsoid,o,yne);return Tne(s,e,t,n,i,r)};var JIe=[];hf.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,JIe),o=le.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var QIe=new m;function xne(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,QIe);e=ne.fromCartesian3(i,n)}return e}function _ne(e,t,n,i){l(i)||(i=new m);let o=Vne(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=Sne(e,c,o);if(d<0)return;r=Math.max(r,d)}return Cne(o,r,i)}var o5=new m;function Tne(e,t,n,i,o,r){l(r)||(r=new m),i=y(i,3),o=y(o,m.ZERO);let s=Vne(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){o5.x=n[c]+o.x,o5.y=n[c+1]+o.y,o5.z=n[c+2]+o.z;let u=Sne(e,o5,s);if(u<0)return;a=Math.max(a,u)}return Cne(s,a,r)}function MY(e,t,n){let i=t,o=n,r=m.subtract(e,i,gne),s=-m.dot(r,i);return!(o<0?s>0:s>o&&s*s/m.magnitudeSquared(r)>o)}var jIe=new m,qIe=new m;function Sne(e,t,n){let i=e.transformPositionToScaledSpace(t,jIe),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,qIe);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function Cne(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var AY=new m;function Vne(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,AY),m.normalize(AY,AY))}var Pp=hf;var IYt=T(S(),1);var hYt=T(S(),1);var NY=new se;function ff(e,t){t=y(t,ne.default),e=t.scaleToGeodeticSurface(e);let n=Pt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(A.getColumn(n,0,NY)),this._yAxis=m.fromCartesian4(A.getColumn(n,1,NY));let i=m.fromCartesian4(A.getColumn(n,2,NY));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(ff.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var $Ie=new z0;ff.fromPoints=function(e,t){let n=z0.fromPoints(e,$Ie);return new ff(n.center,t)};var Lne=new pn,r5=new m;ff.prototype.projectPointOntoPlane=function(e,t){let n=Lne;n.origin=e,m.normalize(e,n.direction);let i=qn.rayPlane(n,this._plane,r5);if(l(i)||(m.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,r5)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new D(r,s)}};ff.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};ff.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new D);let n=Lne;n.origin=e,m.clone(this._plane.normal,n.direction);let i=qn.rayPlane(n,this._plane,r5);l(i)||(m.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,r5));let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return t.x=r,t.y=s,t};ff.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var eXe=new m;ff.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new m);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=eXe;return m.multiplyByScalar(o,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(r,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};ff.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Qr=ff;function Ni(e,t){this.center=m.clone(y(e,m.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Ni.packedLength=m.packedLength+$.packedLength;Ni.pack=function(e,t,n){return n=y(n,0),m.pack(e.center,t,n),$.pack(e.halfAxes,t,n+m.packedLength),t};Ni.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ni),m.unpack(e,t,n.center),$.unpack(e,t+m.packedLength,n.halfAxes),n};var tXe=new m,nXe=new m,iXe=new m,oXe=new m,rXe=new m,sXe=new m,aXe=new $,cXe={unitary:new $,diagonal:new $};Ni.fromPoints=function(e,t){if(l(t)||(t=new Ni),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=m.ZERO,t;let n,i=e.length,o=m.clone(e[0],tXe);for(n=1;n<i;n++)m.add(o,e[n],o);let r=1/i;m.multiplyByScalar(o,r,o);let s=0,a=0,c=0,d=0,u=0,h=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],o,nXe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,d+=p.y*p.y,u+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,c*=r,d*=r,u*=r,h*=r;let g=aXe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=d,g[5]=u,g[6]=c,g[7]=u,g[8]=h;let f=$.computeEigenDecomposition(g,cXe),x=$.clone(f.unitary,t.halfAxes),_=$.getColumn(x,0,oXe),C=$.getColumn(x,1,rXe),V=$.getColumn(x,2,sXe),L=-Number.MAX_VALUE,R=-Number.MAX_VALUE,G=-Number.MAX_VALUE,I=Number.MAX_VALUE,v=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],L=Math.max(m.dot(_,p),L),R=Math.max(m.dot(C,p),R),G=Math.max(m.dot(V,p),G),I=Math.min(m.dot(_,p),I),v=Math.min(m.dot(C,p),v),P=Math.min(m.dot(V,p),P);_=m.multiplyByScalar(_,.5*(I+L),_),C=m.multiplyByScalar(C,.5*(v+R),C),V=m.multiplyByScalar(V,.5*(P+G),V);let w=m.add(_,C,t.center);m.add(w,V,w);let M=iXe;return M.x=L-I,M.y=R-v,M.z=G-P,m.multiplyByScalar(M,.5,M),$.multiplyByScale(t.halfAxes,M,t.halfAxes),t};var Xne=new m,lXe=new m;function Rne(e,t,n,i,o,r,s,a,c,d,u){l(u)||(u=new Ni);let h=u.halfAxes;$.setColumn(h,0,t,h),$.setColumn(h,1,n,h),$.setColumn(h,2,i,h);let p=Xne;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+d)/2;let g=lXe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(d-c)/2;let f=u.center;return p=$.multiplyByVector(h,p,p),m.add(e,p,f),$.multiplyByScale(h,g,h),u}var Zne=new he,dXe=new m,uXe=new he,mXe=new he,hXe=new he,fXe=new he,pXe=new he,bXe=new m,Gne=new m,gXe=new m,Ene=new m,yXe=new m,xXe=new D,_Xe=new D,TXe=new D,SXe=new D,CXe=new D,VXe=new m,LXe=new m,RXe=new m,ZXe=new m,GXe=new D,EXe=new m,IXe=new m,XXe=new m,WXe=new sn(m.UNIT_X,0);Ni.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ne.default);let r,s,a,c,d,u,h;if(e.width<=W.PI){let v=ce.center(e,Zne),P=i.cartographicToCartesian(v,dXe),w=new Qr(P,i);h=w.plane;let M=v.longitude,b=e.south<0&&e.north>0?0:v.latitude,Z=he.fromRadians(M,e.north,n,uXe),E=he.fromRadians(e.west,e.north,n,mXe),X=he.fromRadians(e.west,b,n,hXe),F=he.fromRadians(e.west,e.south,n,fXe),N=he.fromRadians(M,e.south,n,pXe),O=i.cartographicToCartesian(Z,bXe),U=i.cartographicToCartesian(E,Gne),Y=i.cartographicToCartesian(X,gXe),k=i.cartographicToCartesian(F,Ene),H=i.cartographicToCartesian(N,yXe),K=w.projectPointToNearestOnPlane(O,xXe),te=w.projectPointToNearestOnPlane(U,_Xe),z=w.projectPointToNearestOnPlane(Y,TXe),j=w.projectPointToNearestOnPlane(k,SXe),ee=w.projectPointToNearestOnPlane(H,CXe);return r=Math.min(te.x,z.x,j.x),s=-r,c=Math.max(te.y,K.y),a=Math.min(j.y,ee.y),E.height=F.height=t,U=i.cartographicToCartesian(E,Gne),k=i.cartographicToCartesian(F,Ene),d=Math.min(sn.getPointDistance(h,U),sn.getPointDistance(h,k)),u=n,Rne(w.origin,w.xAxis,w.yAxis,w.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,x=ce.center(e,Zne).longitude,_=m.fromRadians(x,f,n,i,VXe);_.z=0;let V=Math.abs(_.x)<W.EPSILON10&&Math.abs(_.y)<W.EPSILON10?m.UNIT_X:m.normalize(_,LXe),L=m.UNIT_Z,R=m.cross(V,L,RXe);h=sn.fromPointNormal(_,V,WXe);let G=m.fromRadians(x+W.PI_OVER_TWO,f,n,i,ZXe);s=m.dot(sn.projectPointOntoPlane(h,G,GXe),R),r=-s,c=m.fromRadians(0,e.north,g?t:n,i,EXe).z,a=m.fromRadians(0,e.south,p?t:n,i,IXe).z;let I=m.fromRadians(e.east,f,n,i,XXe);return d=sn.getPointDistance(h,I),u=0,Rne(_,R,L,V,r,s,a,c,d,u,o)};Ni.fromTransformation=function(e,t){return l(t)||(t=new Ni),t.center=A.getTranslation(e,t.center),t.halfAxes=A.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Ni.clone=function(e,t){if(l(e))return l(t)?(m.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Ni(e.center,e.halfAxes)};Ni.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),d=m.dot(i,n)+t.distance;return d<=-c?Ht.OUTSIDE:d>=c?Ht.INSIDE:Ht.INTERSECTING};var Wne=new m,Pne=new m,vne=new m,PXe=new m,Ine=new m,vXe=new m;Ni.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,Xne),i=e.halfAxes,o=$.getColumn(i,0,Wne),r=$.getColumn(i,1,Pne),s=$.getColumn(i,2,vne),a=m.magnitude(o),c=m.magnitude(r),d=m.magnitude(s),u=!0,h=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,c>0?m.divideByScalar(r,c,r):h=!1,d>0?m.divideByScalar(s,d,s):p=!1;let g=!u+!h+!p,f,x,_;if(g===1){let R=o;f=r,x=s,h?p||(R=s,x=o):(R=r,f=o),_=m.cross(f,x,Ine),R===o?o=_:R===r?r=_:R===s&&(s=_)}else if(g===2){f=o,h?f=r:p&&(f=s);let R=m.UNIT_Y;R.equalsEpsilon(f,W.EPSILON3)&&(R=m.UNIT_X),x=m.cross(f,R,PXe),m.normalize(x,x),_=m.cross(f,x,Ine),m.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let C=vXe;C.x=m.dot(n,o),C.y=m.dot(n,r),C.z=m.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-d?(L=C.z+d,V+=L*L):C.z>d&&(L=C.z-d,V+=L*L),V};var wXe=new m,FXe=new m;Ni.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ga);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Wne),d=$.getColumn(a,1,Pne),u=$.getColumn(a,2,vne),h=m.add(c,d,wXe);m.add(h,u,h),m.add(h,s,h);let p=m.subtract(h,t,FXe),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var AXe=new m,MXe=new m,NXe=new m;Ni.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,AXe),r=$.getColumn(i,1,MXe),s=$.getColumn(i,2,NXe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var kXe=new $;Ni.computeTransformation=function(e,t){l(t)||(t=new A);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,kXe);return A.fromRotationTranslation(i,n,t)};var UXe=new le;Ni.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,UXe);return!t.isBoundingSphereVisible(n)};Ni.prototype.intersectPlane=function(e){return Ni.intersectPlane(this,e)};Ni.prototype.distanceSquaredTo=function(e){return Ni.distanceSquaredTo(this,e)};Ni.prototype.computePlaneDistances=function(e,t,n){return Ni.computePlaneDistances(this,e,t,n)};Ni.prototype.computeCorners=function(e){return Ni.computeCorners(this,e)};Ni.prototype.computeTransformation=function(e){return Ni.computeTransformation(this,e)};Ni.prototype.isOccluded=function(e){return Ni.isOccluded(this,e)};Ni.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Ni.prototype.clone=function(e){return Ni.clone(this,e)};Ni.prototype.equals=function(e){return Ni.equals(this,e)};var Gn=Ni;var JYt=T(S(),1);var wYt=T(S(),1);var s5={};s5.getHeight=function(e,t,n){return(e-n)*t+n};var DXe=new he;s5.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,DXe);if(!l(r))return m.clone(e,o);let s=s5.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Tr=s5;var AYt=T(S(),1),BXe={NONE:0,BITS12:1},ks=Object.freeze(BXe);var Zx=new m,OXe=new m,Zu=new D,a5=new A,YXe=new A,HXe=Math.pow(2,12);function rc(e,t,n,i,o,r,s,a,c,d){let u=ks.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,f=t.maximum,x=m.subtract(f,g,OXe),_=i-n;Math.max(m.maximumComponent(x),_)<HXe-1?u=ks.BITS12:u=ks.NONE,h=A.inverseTransformation(o,new A);let V=m.negate(g,Zx);A.multiply(A.fromTranslation(V,a5),h,h);let L=Zx;L.x=1/x.x,L.y=1/x.y,L.z=1/x.z,A.multiply(A.fromScale(L,a5),h,h),p=A.clone(o),A.setTranslation(p,m.ZERO,p),o=A.clone(o,new A);let R=A.fromTranslation(g,a5),G=A.fromScale(x,YXe),I=A.multiply(R,G,a5);A.multiply(o,I,o),A.multiply(p,I,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(d,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}rc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===ks.BITS12){n=A.multiplyByPoint(this.toScaledENU,n,Zx),n.x=W.clamp(n.x,0,1),n.y=W.clamp(n.y,0,1),n.z=W.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,h=W.clamp((o-this.minimumHeight)/u,0,1);D.fromElements(n.x,n.y,Zu);let p=wn.compressTextureCoordinates(Zu);D.fromElements(n.z,h,Zu);let g=wn.compressTextureCoordinates(Zu);D.fromElements(c,d,Zu);let f=wn.compressTextureCoordinates(Zu);if(e[t++]=p,e[t++]=g,e[t++]=f,this.hasWebMercatorT){D.fromElements(s,0,Zu);let x=wn.compressTextureCoordinates(Zu);e[t++]=x}}else m.subtract(n,this.center,Zx),e[t++]=Zx.x,e[t++]=Zx.y,e[t++]=Zx.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=wn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var zXe=new m,wne=new m;rc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let h=s*i+u,p=s*r+u;t[p]=e[h]}let a=this.decodePosition(t,s,zXe),c=n.geodeticSurfaceNormal(a,wne),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};rc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};rc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new m),t*=this.stride,this.quantization===ks.BITS12){let i=wn.decompressTextureCoordinates(e[t],Zu);n.x=i.x,n.y=i.y;let o=wn.decompressTextureCoordinates(e[t+1],Zu);return n.z=o.x,A.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};rc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,wne),a=this.decodeHeight(e,t),c=Tr.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};rc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new D),t*=this.stride,this.quantization===ks.BITS12?wn.decompressTextureCoordinates(e[t+2],n):D.fromElements(e[t+4],e[t+5],n)};rc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===ks.BITS12?wn.decompressTextureCoordinates(e[t+1],Zu).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};rc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===ks.BITS12?wn.decompressTextureCoordinates(e[t+3],Zu).x:e[t+6]};rc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return D.fromElements(o,r,n)};rc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};rc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case ks.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var c5={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},l5={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};rc.prototype.getAttributes=function(e){let t=Q.FLOAT,n=Q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===ks.NONE){s(c5.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(c5.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(c5.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(l5.compressed0,a?4:3),c&&s(l5.compressed1,1),this.hasGeodeticSurfaceNormals&&s(l5.geodeticSurfaceNormal,3)}return r};rc.prototype.getAttributeLocations=function(){return this.quantization===ks.NONE?c5:l5};rc.clone=function(e,t){if(l(e))return l(t)||(t=new rc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=A.clone(e.toScaledENU),t.fromScaledENU=A.clone(e.fromScaledENU),t.matrix=A.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var sc=rc;var iHt=T(S(),1);function Xl(e){this._ellipsoid=y(e,ne.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Xl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Xl.mercatorAngleToGeodeticLatitude=function(e){return W.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Xl.geodeticLatitudeToMercatorAngle=function(e){e>Xl.MaximumLatitude?e=Xl.MaximumLatitude:e<-Xl.MaximumLatitude&&(e=-Xl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Xl.MaximumLatitude=Xl.mercatorAngleToGeodeticLatitude(Math.PI);Xl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Xl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};Xl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Xl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Wi=Xl;var pf={};pf.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var kY=new m,KXe=new A,JXe=new m,QXe=new m;pf.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=W.PI_OVER_TWO,a=W.toRadians,c=e.heightmap,d=e.width,u=e.height,h=e.skirtHeight,p=h>0,g=y(e.isGeographic,!0),f=y(e.ellipsoid,ne.default),x=1/f.maximumRadius,_=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),V,L,R,G;l(C)?(V=C.west,L=C.south,R=C.east,G=C.north):g?(V=a(_.west),L=a(_.south),R=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),R=_.east*x,G=s-2*o(r(-_.north*x)));let I=e.relativeToCenter,v=l(I);I=v?I:m.ZERO;let P=y(e.includeWebMercatorT,!1),w=y(e.exaggeration,1),M=y(e.exaggerationRelativeHeight,0),Z=w!==1,E=y(e.structure,pf.DEFAULT_STRUCTURE),X=y(E.heightScale,pf.DEFAULT_STRUCTURE.heightScale),F=y(E.heightOffset,pf.DEFAULT_STRUCTURE.heightOffset),N=y(E.elementsPerHeight,pf.DEFAULT_STRUCTURE.elementsPerHeight),O=y(E.stride,pf.DEFAULT_STRUCTURE.stride),U=y(E.elementMultiplier,pf.DEFAULT_STRUCTURE.elementMultiplier),Y=y(E.isBigEndian,pf.DEFAULT_STRUCTURE.isBigEndian),k=ce.computeWidth(_),H=ce.computeHeight(_),K=k/(d-1),te=H/(u-1);g||(k*=x,H*=x);let z=f.radiiSquared,j=z.x,ee=z.y,fe=z.z,Te=65536,de=-65536,xe=Pt.eastNorthUpToFixedFrame(I,f),Ce=A.inverseTransformation(xe,KXe),Ie,Le;P&&(Ie=Wi.geodeticLatitudeToMercatorAngle(L),Le=1/(Wi.geodeticLatitudeToMercatorAngle(G)-Ie));let Ne=JXe;Ne.x=Number.POSITIVE_INFINITY,Ne.y=Number.POSITIVE_INFINITY,Ne.z=Number.POSITIVE_INFINITY;let Oe=QXe;Oe.x=Number.NEGATIVE_INFINITY,Oe.y=Number.NEGATIVE_INFINITY,Oe.z=Number.NEGATIVE_INFINITY;let qe=Number.POSITIVE_INFINITY,Rt=d*u,Lt=h>0?d*2+u*2:0,ke=Rt+Lt,zt=new Array(ke),ut=new Array(ke),mt=new Array(ke),Pn=P?new Array(ke):[],cn=Z?new Array(ke):[],ge=0,Ve=u,bn=0,pt=d;p&&(--ge,++Ve,--bn,++pt);let so=1e-5;for(let Qe=ge;Qe<Ve;++Qe){let bt=Qe;bt<0&&(bt=0),bt>=u&&(bt=u-1);let Ot=_.north-te*bt;g?Ot=a(Ot):Ot=s-2*o(r(-Ot*x));let Cn=(Ot-L)/(G-L);Cn=W.clamp(Cn,0,1);let Io=Qe===ge,So=Qe===Ve-1;h>0&&(Io?Ot+=so*H:So&&(Ot-=so*H));let Ka=t(Ot),Ja=n(Ot),Ci=fe*Ja,bi;P&&(bi=(Wi.geodeticLatitudeToMercatorAngle(Ot)-Ie)*Le);for(let ra=bn;ra<pt;++ra){let zr=ra;zr<0&&(zr=0),zr>=d&&(zr=d-1);let Tl=bt*(d*O)+zr*O,yo;if(N===1)yo=c[Tl];else{yo=0;let Fo;if(Y)for(Fo=0;Fo<N;++Fo)yo=yo*U+c[Tl+Fo];else for(Fo=N-1;Fo>=0;--Fo)yo=yo*U+c[Tl+Fo]}yo=yo*X+F,de=Math.max(de,yo),Te=Math.min(Te,yo);let Er=_.west+K*zr;g?Er=a(Er):Er=Er*x;let yp=(Er-V)/(R-V);yp=W.clamp(yp,0,1);let Kr=bt*d+zr;if(h>0){let Fo=ra===bn,ln=ra===pt-1,Re=Io||So||Fo||ln;if((Io||So)&&(Fo||ln))continue;Re&&(yo-=h,Fo?(Kr=Rt+(u-bt-1),Er-=so*k):So?Kr=Rt+u+(d-zr-1):ln?(Kr=Rt+u+d+bt,Er+=so*k):Io&&(Kr=Rt+u+d+u+zr))}let mu=Ka*t(Er),Qa=Ka*n(Er),$y=j*mu,sa=ee*Qa,Wc=1/i($y*mu+sa*Qa+Ci*Ja),ls=$y*Wc,hu=sa*Wc,fu=Ci*Wc,pu=new m;pu.x=ls+mu*yo,pu.y=hu+Qa*yo,pu.z=fu+Ja*yo,A.multiplyByPoint(Ce,pu,kY),m.minimumByComponent(kY,Ne,Ne),m.maximumByComponent(kY,Oe,Oe),qe=Math.min(qe,yo),zt[Kr]=pu,mt[Kr]=new D(yp,Cn),ut[Kr]=yo,P&&(Pn[Kr]=bi),Z&&(cn[Kr]=f.geodeticSurfaceNormal(pu))}}let Eo=le.fromPoints(zt),oa;l(C)&&(oa=Gn.fromRectangle(C,Te,de,f));let Gr;v&&(Gr=new Pp(f).computeHorizonCullingPointPossiblyUnderEllipsoid(I,zt,Te));let _s=new z0(Ne,Oe,I),Fe=new sc(I,_s,qe,de,xe,!1,P,Z,w,M),rt=new Float32Array(ke*Fe.stride),ze=0;for(let Qe=0;Qe<ke;++Qe)ze=Fe.encode(rt,ze,zt[Qe],mt[Qe],ut[Qe],void 0,Pn[Qe],cn[Qe]);return{vertices:rt,maximumHeight:de,minimumHeight:Te,encoding:Fe,boundingSphere3D:Eo,orientedBoundingBox:oa,occludeePointInScaledSpace:Gr}};var sC=pf;var CHt=T(S(),1);function K0(){pe.throwInstantiationError()}Object.defineProperties(K0.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});K0.prototype.interpolateHeight=pe.throwInstantiationError;K0.prototype.isChildAvailable=pe.throwInstantiationError;K0.prototype.createMesh=pe.throwInstantiationError;K0.prototype.upsample=pe.throwInstantiationError;K0.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;K0.maximumAsynchronousTasks=5;var wm=K0;var RHt=T(S(),1);function jXe(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){this.center=e,this.vertices=t,this.stride=y(d,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=u,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=x}var Gu=jXe;var WHt=T(S(),1);function Oc(){pe.throwInstantiationError()}Object.defineProperties(Oc.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var Fne=[];Oc.getRegularGridIndices=function(e,t){let n=Fne[e];l(n)||(Fne[e]=n=[]);let i=n[t];return l(i)||(e*t<W.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),kne(e,t,i,0)),i};var Ane=[];Oc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Ane[e];l(n)||(Ane[e]=n=[]);let i=n[t];if(!l(i)){let o=Oc.getRegularGridIndices(e,t),r=Nne(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var Mne=[];Oc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Mne[e];l(n)||(Mne[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=Nne(e,t),h=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,g=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,x=Ae.createTypedArray(c,d);kne(e,t,x,0),Oc.addSkirtIndices(h,p,g,f,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Oc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=d5(e,a,r,s),a+=e.length,s=d5(t,a,r,s),a+=t.length,s=d5(n,a,r,s),a+=n.length,d5(i,a,r,s)};function Nne(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function kne(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function d5(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Oc.heightmapTerrainQuality=.25;Oc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Oc.heightmapTerrainQuality/(t*n)};Oc.prototype.requestTileGeometry=pe.throwInstantiationError;Oc.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Oc.prototype.getTileDataAvailable=pe.throwInstantiationError;Oc.prototype.loadTileDataAvailability=pe.throwInstantiationError;var jr=Oc;function vp(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,Ru.NONE);let t=sC.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Ru.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(vp.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Une="createVerticesFromHeightmap",qXe=new yi(Une),$Xe=new yi(Une,wm.maximumAsynchronousTasks);vp.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(ce.center(u)),p=this._structure,f=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?$Xe:qXe).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ei,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(_))return;let C=this;return Promise.resolve(_).then(function(V){let L;C._skirtHeight>0?L=jr.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=jr.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let R=V.gridWidth*V.gridHeight;return C._mesh=new Gu(h,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,R,V.minimumHeight,V.maximumHeight,le.clone(V.boundingSphere3D),m.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Gn.clone(V.orientedBoundingBox),sc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};vp.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(ce.center(d)),h=this._structure,g=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let f=sC.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ei,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=jr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=jr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new Gu(u,f.vertices,x.indices,x.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};vp.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,h=r.heightScale,p=l(this._mesh),g=this._encoding===Ru.LERC;if(!p&&g)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=Dne(_,C,u,h,e,i,o,t,n)}else x=eWe(this._buffer,a,c,s,d,e,i,o,t,n),x=x*h+u;return x};vp.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,h=u.stride,p=new this._bufferType(c*d*h),g=a.vertices,f=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=u.heightOffset,V=u.heightScale,L=u.elementsPerHeight,R=u.elementMultiplier,G=u.isBigEndian,I=Math.pow(R,L-1);for(let v=0;v<d;++v){let P=W.lerp(_.north,_.south,v/(d-1));for(let w=0;w<c;++w){let M=W.lerp(_.west,_.east,w/(c-1)),b=Dne(g,f,C,V,x,c,d,M,P);b=b<u.lowestEncodedHeight?u.lowestEncodedHeight:b,b=b>u.highestEncodedHeight?u.highestEncodedHeight:b,tWe(p,L,R,I,h,G,v*c+w,b)}}return Promise.resolve(new vp({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};vp.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};vp.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function eWe(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),h=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,g=p+1;g>=s&&(g=s-1,p=s-2);let f=h|0,x=f+1;x>=a&&(x=a-1,f=a-2);let _=u-p,C=h-f;f=a-1-f,x=a-1-x;let V=u5(e,t,n,i,o,f*s+p),L=u5(e,t,n,i,o,f*s+g),R=u5(e,t,n,i,o,x*s+p),G=u5(e,t,n,i,o,x*s+g);return Bne(_,C,V,L,R,G)}function Dne(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),h=d|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let x=d-h,_=u-g;g=s-1-g,f=s-1-f;let C=(t.decodeHeight(e,g*r+h)-n)/i,V=(t.decodeHeight(e,g*r+p)-n)/i,L=(t.decodeHeight(e,f*r+h)-n)/i,R=(t.decodeHeight(e,f*r+p)-n)/i;return Bne(x,_,C,V,L,R)}function Bne(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function u5(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function tWe(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Xa=vp;var tzt=T(S(),1);function lC(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Gx=new ce;function nWe(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}lC.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)nWe(e,g,p,s)||s.push(new aC(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,Gx);let a=Gx.west,c=Gx.north;r.tileXYToRectangle(i,o,e,Gx);let d=Gx.east,u=Gx.south,h=new aWe(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];UY(g.extent,h)&&cWe(this._maximumLevel,g,h)}};lC.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(cC(i.extent,e)){t=i;break}}return l(t)?yE(void 0,t,e):-1};var iWe=[],oWe=[],rWe=new ce,sWe=new ce;lC.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=iWe;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,rWe)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,sWe))):t.push(e);let n=oWe;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)xE(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var One=new he;lC.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Gx);return ce.center(i,One),this.computeMaximumLevelAtPosition(One)>=e};lC.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function aC(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(aC.prototype,{nw:{get:function(){return this._nw||(this._nw=new aC(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new aC(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new aC(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new aC(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function aWe(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function UY(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function cWe(e,t,n){for(;t.level<e;)if(m5(t.nw.extent,n))t=t.nw;else if(m5(t.ne.extent,n))t=t.ne;else if(m5(t.sw.extent,n))t=t.sw;else if(m5(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Xo(t.rectangles,n.level,lWe);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function lWe(e,t){return e.level-t}function m5(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function cC(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function yE(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&cC(t._nw.extent,n),s=t._ne&&cC(t._ne.extent,n),a=t._sw&&cC(t._sw.extent,n),c=t._se&&cC(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,yE(t,t._nw,n))),s&&(i=Math.max(i,yE(t,t._ne,n))),a&&(i=Math.max(i,yE(t,t._sw,n))),c&&(i=Math.max(i,yE(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];cC(a,n)&&(i=a.level)}t=t.parent}return i}function xE(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||UY(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=dWe(e[s.level],s)}xE(e,t._nw,n),xE(e,t._ne,n),xE(e,t._sw,n),xE(e,t._se,n)}function dWe(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];UY(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Fm=lC;var lzt=T(S(),1);var ozt=T(S(),1);function uWe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=`
${o}`),t}var bf=uWe;function h5(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}h5.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new h5(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${bf(i)}`),c};h5.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Co=h5;var gzt=T(S(),1);function J0(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Wi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(J0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});J0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};J0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};J0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};J0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,h=this._rectangleNortheastInMeters.y-(t+1)*d;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=u,i):new ce(a,h,c,u)};J0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new D(o.west,o.south)),a=r.unproject(new D(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};J0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,f=p/a|0;f>=o&&(f=o-1);let x=g/d|0;return x>=r&&(x=r-1),l(n)?(n.x=f,n.y=x,n):new D(f,x)};var qr=J0;var mWe=15;function Yne(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}Yne.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function hWe(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Ct(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Hi(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new qr(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Ru.LERC:Ru.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Fm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Fm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function fWe(e,t,n){try{let i=await t.fetchJson();hWe(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Co.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Q0(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(Q0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Q0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ze.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new Yne(t);await fWe(o,i);let r=new Q0(t);return o.build(r),r._resource=n,r};Q0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(DY(this,n+1,e*2,t*2))){let h=Hne(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new Xa({buffer:h[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):mWe,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(h){if(l(a)&&a.state===jn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=jn.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function DY(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Q0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Q0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=DY(this,n,e,t);if(l(i))return i;Hne(this,n,e,t)};Q0.prototype.loadTileDataAvailability=function(e,t,n){};function pWe(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new D(e.x+1,e.y+1),u=!1,h=!1;for(;!(u&&h);){let p=d.x,g=h?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new D(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!h){let f=d.y*t;for(let x=e.x;x<=p;++x)if(i[f+x]!==s){h=!0;break}h?(a.push(new D(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,h=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function bWe(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new D(0,0)];for(;a.length>0;){let c=a.pop(),d=pWe(c,n,i,o);if(d.value===1){let h=d.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function Hne(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ho({throttle:!1,throttleByServer:!0,type:ds.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(h)?(h=h.then(function(p){let g=bWe(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let x=0;x<g.length;++x){let _=g[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return DY(e,t,n,i)}),c[a]={promise:h,request:d},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:d}):{}}var BY=Q0;var kzt=T(S(),1),gWe={NONE:0,GEODESIC:1,RHUMB:2},en=Object.freeze(gWe);var Dzt=T(S(),1),yWe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},ac=Object.freeze(yWe);var Yzt=T(S(),1);function Ex(){this._array=[],this._hash={}}Object.defineProperties(Ex.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Ex.prototype.contains=function(e){return l(this._hash[e])};Ex.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Ex.prototype.get=function(e){return this._hash[e]};Ex.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Ex.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Gt=Ex;var qzt=T(S(),1);var zne="https://dev.virtualearth.net/REST/v1/Locations";function OY(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ze({url:zne,queryParameters:n}),this._credit=new Ct('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(OY.prototype,{url:{get:function(){return zne}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});OY.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,d,c)}})})};var YY=OY;var dKt=T(S(),1);var xWe=new m;function gf(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}gf.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new gf({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};gf.fromAxisAlignedBoundingBox=function(e){return new gf({minimum:e.minimum,maximum:e.maximum})};gf.packedLength=2*m.packedLength+1;gf.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var Jne=new m,Qne=new m,Kne={minimum:Jne,maximum:Qne,offsetAttribute:void 0};gf.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Jne),o=m.unpack(e,t+m.packedLength,Qne),r=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Kne.offsetAttribute=r===-1?void 0:r,new gf(Kne))};gf.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new mn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=m.subtract(n,t,xWe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===rn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new lt({attributes:i,indices:o,primitiveType:we.LINES,boundingSphere:new le(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var Am=gf;var hKt=T(S(),1);function HY(){}Object.defineProperties(HY.prototype,{credit:{get:function(){}}});HY.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var zY=HY;var KKt=T(S(),1);var NKt=T(S(),1);var RKt=T(S(),1);var _Kt=T(S(),1);function dC(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}dC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof ve)return ve};dC.prototype.evaluate=pe.throwInstantiationError;dC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};dC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};dC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var no=dC;function uC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=no.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(uC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});uC.prototype.findTimeInterval=no.prototype.findTimeInterval;uC.prototype.wrapTime=no.prototype.wrapTime;uC.prototype.clampTime=no.prototype.clampTime;uC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var j0=uC;var EKt=T(S(),1);var jne={};jne.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new m,s[a]=new m;o[0]=n[0]/t[0],r[0]=m.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var mC=jne;var qne=[],$ne=[],eie=[],tie=[];function _We(e,t,n){let i=qne,o=eie,r=$ne,s=tie;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new m),m.clone(n,c),mC.solve(i,r,o,s)}function TWe(e){let t=qne,n=eie,i=$ne,o=tie;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r+1],e[r-1],s),m.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r],e[r-1],s),m.multiplyByScalar(s,3,s),mC.solve(t,i,n,o)}function Wl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=no.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Wl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Wl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Wl({times:t,points:n,inTangents:r,outTangents:o})};Wl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new j0({points:n,times:t});let i=TWe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Wl({times:t,points:n,inTangents:r,outTangents:o})};Wl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=no.getPointType(n[0]);if(n.length<3)return new j0({points:n,times:t});let s=_We(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Wl({times:t,points:n,inTangents:c,outTangents:a})};Wl.hermiteCoefficientMatrix=new A(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Wl.prototype.findTimeInterval=no.prototype.findTimeInterval;var SWe=new se,hC=new m;Wl.prototype.wrapTime=no.prototype.wrapTime;Wl.prototype.clampTime=no.prototype.clampTime;Wl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,d=SWe;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=A.multiplyByVector(Wl.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let h=this._pointType;return h===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[s],u.x,t),h.multiplyByScalar(n[s+1],u.y,hC),h.add(t,hC,t),h.multiplyByScalar(r[s],u.z,hC),h.add(t,hC,t),h.multiplyByScalar(o[s],u.w,hC),h.add(t,hC,t))};var q0=Wl;var CWe=new se,nie=new m,fC=new m;function VWe(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let d=(a-i)*o;return m.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=CWe;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,h,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,h=m.subtract(t[2],c,nie),m.multiplyByScalar(h,.5,h),p=A.multiplyByVector(q0.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],h=e.lastTangent,u=m.subtract(d,t[r-1],nie),m.multiplyByScalar(u,.5,u),p=A.multiplyByVector(q0.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],h=t[r+2],p=A.multiplyByVector($0.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(c,p.x,o),m.multiplyByScalar(d,p.y,fC),m.add(o,fC,o),m.multiplyByScalar(u,p.z,fC),m.add(o,fC,o),m.multiplyByScalar(h,p.w,fC),m.add(o,fC,o)}}var LWe=new m,RWe=new m;function $0(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=LWe,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=RWe,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=VWe(this),this._lastTimeIndex=0}Object.defineProperties($0.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});$0.catmullRomCoefficientMatrix=new A(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);$0.prototype.findTimeInterval=no.prototype.findTimeInterval;$0.prototype.wrapTime=no.prototype.wrapTime;$0.prototype.clampTime=no.prototype.clampTime;$0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var KY=$0;var rQt=T(S(),1);var tJt=T(S(),1);var qKt=T(S(),1);function eg(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),eg.decode(e)}eg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};eg.decodeWithFromCharCode=function(e){let t="",n=ZWe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function _E(e,t,n){return t<=e&&e<=n}function ZWe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let d=e[c];if(i===0){if(_E(d,0,127)){s.push(d);continue}if(_E(d,194,223)){i=1,t=d&31;continue}if(_E(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(_E(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new ae("String decoding failed.")}if(!_E(d,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|d&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?eg.decode=eg.decodeWithTextDecoder:eg.decode=eg.decodeWithFromCharCode;var Pl=eg;function GWe(e,t,n){return JSON.parse(Pl(e,t,n))}var Jo=GWe;var fJt=T(S(),1),QY=T(dd(),1);var sJt=T(S(),1);var JY,iie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNTZhYmEzOS1hNmFhLTQ1OTAtODk0Mi1lM2U3M2FlMjIxZTMiLCJpZCI6MjU5LCJpYXQiOjE3NDEwMTMyNzF9.J_SThPuEuresJ_TioZat6GbGcDLEruo269cV5QQxiqM",f5={};f5.defaultAccessToken=iie;f5.defaultServer=new Ze({url:"https://api.cesium.com/"});f5.getDefaultTokenCredit=function(e){if(e===iie){if(!l(JY)){let t=`<b>             This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i>             with an access token from your ion account before making any Cesium API calls.             You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;JY=new Ct(t,!0)}return JY}};var Mm=f5;function Yc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:EWe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ze.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new QY.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Yc.prototype=Object.create(Ze.prototype),Yc.prototype.constructor=Yc);Yc.fromAssetId=function(e,t){let n=Yc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Yc(i,n)})};Object.defineProperties(Yc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Yc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Yc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Ct.getIonCredit),i=Mm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Ct.clone(i)),n};Yc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Yc(t._ionEndpoint,t._ionEndpointResource)),e=Ze.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Yc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ze.prototype.fetchImage.call(this,e)};Yc.prototype._makeRequest=function(e){return this._isExternal||new QY.default(this.url).authority()!==this._ionEndpointDomain?Ze.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ze.prototype._makeRequest.call(this,e))};Yc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Mm.defaultServer),i=y(t.accessToken,Mm.defaultAccessToken);n=Ze.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function EWe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var pd=Yc;var vJt=T(S(),1);var xJt=T(S(),1);var p5={};p5.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,h,p,g,f,x;return d===1?s?(u=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(x=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};p5.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,h=r-a,p=i-a,g=1/(h*d+u*p),f=t-a,x=e-s,_=(h*x+u*f)*g,C=(-p*x+d*f)*g,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new m(_,C,V)};p5.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=d/h,g=u/h;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new D),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var wp=p5;function tg(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=g5(e.westIndices,o,t),this._southIndices=g5(e.southIndices,r,t),this._eastIndices=g5(e.eastIndices,o,t),this._northIndices=g5(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(tg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var b5=[];function g5(e,t,n){b5.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)b5[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(b5.sort(t),Ae.createTypedArray(n,b5)):e}var oie="createVerticesFromQuantizedTerrainMesh",IWe=new yi(oie),XWe=new yi(oie,wm.maximumAsynchronousTasks);tg.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),h=(a?XWe:IWe).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(g){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ae.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),V=g.center,L=g.minimumHeight,R=g.maximumHeight,G=p._boundingSphere,I=p._orientedBoundingBox,v=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),P=g.vertexStride,w=sc.clone(g.encoding);return p._mesh=new Gu(V,C,_,g.indexCountWithoutSkirts,f,L,R,G,v,P,I,w,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var WWe=new yi("upsampleQuantizedTerrainMesh",wm.maximumAsynchronousTasks);tg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=WWe.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,x=d?g*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:g*.5,C=d?this._northSkirtHeight:g*.5,V=this._credits;return Promise.resolve(p).then(function(L){let R=new Uint16Array(L.vertices),G=Ae.createTypedArray(R.length/3,L.indices),I;return l(L.encodedNormals)&&(I=new Uint8Array(L.encodedNormals)),new tg({quantizedVertices:R,indices:G,encodedNormals:I,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:le.clone(L.boundingSphere),orientedBoundingBox:Gn.clone(L.orientedBoundingBox),horizonOcclusionPoint:m.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:f,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var jY=32767,rie=new m;tg.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=jY;let o=W.clamp((n-e.south)/e.height,0,1);return o*=jY,l(this._mesh)?FWe(this,i,o):AWe(this,i,o)};function sie(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=h}var PWe=new D,vWe=new D,wWe=new D;function FWe(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,PWe),g=r.decodeTextureCoordinates(o,u,vWe),f=r.decodeTextureCoordinates(o,h,wWe);if(sie(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let x=wp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,rie);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,h);return x.x*_+x.y*C+x.z*V}}}}function AWe(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=i[d],g=i[u],f=i[h],x=o[d],_=o[u],C=o[h];if(sie(t,n,p,x,g,_,f,C)){let V=wp.computeBarycentricCoordinates(t,n,p,x,g,_,f,C,rie);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[d]+V.y*r[u]+V.z*r[h];return W.lerp(e._minimumHeight,e._maximumHeight,L/jY)}}}}tg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};tg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Ix=tg;function MWe(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function cie(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ne.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}cie.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function lie(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Co.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Co.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Co.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new qr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Co.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}if(e.levelZeroMaximumGeometricError=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Co.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(h)){g=new Fm(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let _=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let V=0;V<_.length;++V){let L=_[V],R=C-L.endY-1,G=C-L.startY-1;e.overallAvailability[x].push([L.startX,R,L.endX,G]),g.addAvailableTileRange(x,L.startX,R,L.endX,G)}}}else l(h)&&(u=new Fm(e.tilingScheme,d),g=new Fm(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new MWe({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await eH(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function NWe(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=Co.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return eH(e,n);throw new ae(i)}async function kWe(e,t,n){await lie(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Fm(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Ct(e.attribution);e.tileCredits.push(o)}return!0}async function eH(e,t){try{let n=await e.layerJsonResource.fetchJson();return kWe(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await lie(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):NWe(e,n,t)}}function Nm(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var qY={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function aie(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function UWe(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Xa({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function DWe(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*d,g=Uint16Array.BYTES_PER_ELEMENT*3,f=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*f,C=new DataView(t),V=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let R=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new le(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+u,!0));a+=h;let I=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let v=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*g,v>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let w=P.subarray(0,v),M=P.subarray(v,2*v),b=P.subarray(v*2,3*v);wn.zigZagDeltaDecode(w,M,b),a%x!==0&&(a+=x-a%x);let Z=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=Ae.createTypedArrayFromArrayBuffer(v,t,a,Z*f);a+=Z*_;let X=0,F=E.length;for(let de=0;de<F;++de){let xe=E[de];E[de]=X-xe,xe===0&&++X}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ae.createTypedArrayFromArrayBuffer(v,t,a,N);a+=N*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ae.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Ae.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*x;let K=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Ae.createTypedArrayFromArrayBuffer(v,t,a,K);a+=K*x;let z,j;for(;a<C.byteLength;){let de=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,de===qY.OCT_VERTEX_NORMALS&&e._requestVertexNormals)z=new Uint8Array(t,a,v*2);else if(de===qY.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,xe);else if(de===qY.METADATA&&e._requestMetadata){let Ce=C.getUint32(a,!0);if(Ce>0){let Le=Jo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ce).available;if(l(Le))for(let Ne=0;Ne<Le.length;++Ne){let Oe=n+Ne+1,qe=Le[Ne],Rt=e._tilingScheme.getNumberOfYTilesAtLevel(Oe);for(let Lt=0;Lt<qe.length;++Lt){let ke=qe[Lt],zt=Rt-ke.endY-1,ut=Rt-ke.startY-1;e.availability.addAvailableTileRange(Oe,ke.startX,zt,ke.endX,ut),r.availability.addAvailableTileRange(Oe,ke.startX,zt,ke.endX,ut)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=xe}let ee=e.getLevelMaximumGeometricError(n)*5,fe=e._tilingScheme.tileXYToRectangle(i,o,n),Te=Gn.fromRectangle(fe,L,R,e._tilingScheme.ellipsoid);return new Ix({center:V,minimumHeight:L,maximumHeight:R,boundingSphere:G,orientedBoundingBox:Te,horizonOcclusionPoint:I,quantizedVertices:P,encodedNormals:z,indices:E,westIndices:O,southIndices:Y,eastIndices:H,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}Nm.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let h=tH(this,e,t,n,u,d===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):die(this,e,t,n,r,i)};function die(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=aie(void 0)):d=aie(c);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?UWe(e,f,i,t,n):DWe(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(Nm.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});Nm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Nm.fromIonAssetId=async function(e,t){let n=await pd.fromAssetId(e);return Nm.fromUrl(n,t)};Nm.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ze.createIfNeeded(e);n.appendForwardSlash();let i=new cie(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await eH(i);let o=new Nm(t);return i.build(o),o};Nm.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(tH(this,e,t,n,i[r],r===0).result)return;return!1};Nm.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=tH(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function $Y(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function tH(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=$Y(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let h;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new Ho({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});h=die(e,u.x,u.y,u.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}u=$Y(o,u.x,u.y,u.level)}return{result:!1}}Nm._getAvailabilityTile=$Y;var Xx=Nm;var KQt=T(S(),1);var kQt=T(S(),1);var uQt=T(S(),1);var iH={},y5=new m,uie=new m,mie=new ve,hie=new $;function pC(e,t,n,i,o,r,s,a,c,d){let u=e+t;m.multiplyByScalar(i,Math.cos(u),y5),m.multiplyByScalar(n,Math.sin(u),uie),m.add(y5,uie,y5);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*h+o*p)/a;return ve.fromAxisAngle(y5,f,mie),$.fromQuaternion(mie,hie),$.multiplyByVector(hie,c,d),m.normalize(d,d),m.multiplyByScalar(d,a,d),d}var fie=new m,pie=new m,nH=new m,BWe=new m;iH.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,d=n?c:0;for(let u=0;u<c;u+=3){let h=u+1,p=u+2,g=m.fromArray(e,u,fie);i.scaleToGeodeticSurface(g,g);let f=m.clone(g,pie),x=i.geodeticSurfaceNormal(g,BWe),_=m.multiplyByScalar(x,o,nH);m.add(g,_,g),n&&(m.multiplyByScalar(x,r,_),m.add(f,_,f),a[u+d]=f.x,a[h+d]=f.y,a[p+d]=f.z),a[u]=g.x,a[h]=g.y,a[p]=g.z}return a};var OWe=new m,YWe=new m,HWe=new m;iH.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,d=o*o,u=o*i,h=m.magnitude(s),p=m.normalize(s,OWe),g=m.cross(m.UNIT_Z,s,YWe);g=m.normalize(g,g);let f=m.cross(p,g,HWe),x=1+Math.ceil(W.PI_OVER_TWO/a),_=W.PI_OVER_TWO/(x-1),C=W.PI_OVER_TWO-x*_;C<0&&(x-=Math.ceil(Math.abs(C)/_));let V=2*(x*(x+2)),L=t?new Array(V*3):void 0,R=0,G=fie,I=pie,v=x*4*3,P=v-1,w=0,M=n?new Array(v):void 0,b,Z,E,X,F;for(C=W.PI_OVER_TWO,G=pC(C,r,f,g,c,u,d,h,p,G),t&&(L[R++]=G.x,L[R++]=G.y,L[R++]=G.z),n&&(M[P--]=G.z,M[P--]=G.y,M[P--]=G.x),C=W.PI_OVER_TWO-_,b=1;b<x+1;++b){if(G=pC(C,r,f,g,c,u,d,h,p,G),I=pC(Math.PI-C,r,f,g,c,u,d,h,p,I),t){for(L[R++]=G.x,L[R++]=G.y,L[R++]=G.z,E=2*b+2,Z=1;Z<E-1;++Z)X=Z/(E-1),F=m.lerp(G,I,X,nH),L[R++]=F.x,L[R++]=F.y,L[R++]=F.z;L[R++]=I.x,L[R++]=I.y,L[R++]=I.z}n&&(M[P--]=G.z,M[P--]=G.y,M[P--]=G.x,M[w++]=I.x,M[w++]=I.y,M[w++]=I.z),C=W.PI_OVER_TWO-(b+1)*_}for(b=x;b>1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,G=pC(-C,r,f,g,c,u,d,h,p,G),I=pC(C+Math.PI,r,f,g,c,u,d,h,p,I),t){for(L[R++]=G.x,L[R++]=G.y,L[R++]=G.z,E=2*(b-1)+2,Z=1;Z<E-1;++Z)X=Z/(E-1),F=m.lerp(G,I,X,nH),L[R++]=F.x,L[R++]=F.y,L[R++]=F.z;L[R++]=I.x,L[R++]=I.y,L[R++]=I.z}n&&(M[P--]=G.z,M[P--]=G.y,M[P--]=G.x,M[w++]=I.x,M[w++]=I.y,M[w++]=I.z)}C=W.PI_OVER_TWO,G=pC(-C,r,f,g,c,u,d,h,p,G);let N={};return t&&(L[R++]=G.x,L[R++]=G.y,L[R++]=G.z,N.positions=L,N.numPts=x),n&&(M[P--]=G.z,M[P--]=G.y,M[P--]=G.x,N.outerPositions=M),N};var vl=iH;var pQt=T(S(),1);function zWe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Et=zWe;var bC=new m,oH=new m,rH=new m,bie=new m,Cs=new D,gie=new $,KWe=new $,sH=new ve,yie=new m,xie=new m,_ie=new m,T5=new he,Tie=new m,Sie=new D,Cie=new D;function Vie(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,h=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,g=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,x=u?new Float32Array(d*3):void 0,_=0,C=yie,V=xie,L=_ie,R=new Ei(a),G=R.project(a.cartesianToCartographic(o,T5),Tie),I=a.scaleToGeodeticSurface(o,bC);a.geodeticSurfaceNormal(I,I);let v=gie,P=KWe;if(c!==0){let F=ve.fromAxisAngle(I,c,sH);v=$.fromQuaternion(F,v),F=ve.fromAxisAngle(I,-c,sH),P=$.fromQuaternion(F,P)}else v=$.clone($.IDENTITY,v),P=$.clone($.IDENTITY,P);let w=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Sie),M=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Cie),b=e.length,Z=n?b:0,E=Z/3*2;for(let F=0;F<b;F+=3){let N=F+1,O=F+2,U=m.fromArray(e,F,bC);if(i.st){let Y=$.multiplyByVector(v,U,oH),k=R.project(a.cartesianToCartographic(Y,T5),rH);m.subtract(k,G,k),Cs.x=(k.x+r)/(2*r),Cs.y=(k.y+s)/(2*s),w.x=Math.min(Cs.x,w.x),w.y=Math.min(Cs.y,w.y),M.x=Math.max(Cs.x,M.x),M.y=Math.max(Cs.y,M.y),n&&(h[_+E]=Cs.x,h[_+1+E]=Cs.y),h[_++]=Cs.x,h[_++]=Cs.y}(i.normal||i.tangent||i.bitangent||u)&&(C=a.geodeticSurfaceNormal(U,C),u&&(x[F+Z]=-C.x,x[N+Z]=-C.y,x[O+Z]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=m.normalize(m.cross(m.UNIT_Z,C,V),V),$.multiplyByVector(P,V,V)),i.normal&&(p[F]=C.x,p[N]=C.y,p[O]=C.z,n&&(p[F+Z]=-C.x,p[N+Z]=-C.y,p[O+Z]=-C.z)),i.tangent&&(g[F]=V.x,g[N]=V.y,g[O]=V.z,n&&(g[F+Z]=-V.x,g[N+Z]=-V.y,g[O+Z]=-V.z)),i.bitangent&&(L=m.normalize(m.cross(C,V,L),L),f[F]=L.x,f[N]=L.y,f[O]=L.z,n&&(f[F+Z]=L.x,f[N+Z]=L.y,f[O+Z]=L.z))))}if(i.st){b=h.length;for(let F=0;F<b;F+=2)h[F]=(h[F]-w.x)/(M.x-w.x),h[F+1]=(h[F+1]-w.y)/(M.y-w.y)}let X=new mn;if(i.position){let F=vl.raisePositionsToHeight(e,t,n);X.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:F})}if(i.st&&(X.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(X.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(X.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(X.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),u&&(X.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let F=new Uint8Array(d);if(t.offsetAttribute===rn.TOP)F=F.fill(1,0,d/2);else{let N=t.offsetAttribute===rn.NONE?0:1;F=F.fill(N)}X.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return X}function Lie(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var Wx=new m;function JWe(e){let t=e.center;Wx=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Wx),e.height,Wx),Wx=m.add(t,Wx,Wx);let n=new le(Wx,e.semiMajorAxis),i=vl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Vie(o,e,!1),a=Lie(r);return a=Ae.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function QWe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,h=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,g=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,x=n.bitangent?new Float32Array(u*3):void 0,_=t.shadowVolume,C=_?new Float32Array(u*3):void 0,V=0,L=yie,R=xie,G=_ie,I=new Ei(s),v=I.project(s.cartesianToCartographic(i,T5),Tie),P=s.scaleToGeodeticSurface(i,bC);s.geodeticSurfaceNormal(P,P);let w=ve.fromAxisAngle(P,d,sH),M=$.fromQuaternion(w,gie),b=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Sie),Z=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Cie),E=e.length,X=E/3*2;for(let N=0;N<E;N+=3){let O=N+1,U=N+2,Y=m.fromArray(e,N,bC),k;if(n.st){let K=$.multiplyByVector(M,Y,oH),te=I.project(s.cartesianToCartographic(K,T5),rH);m.subtract(te,v,te),Cs.x=(te.x+o)/(2*o),Cs.y=(te.y+r)/(2*r),b.x=Math.min(Cs.x,b.x),b.y=Math.min(Cs.y,b.y),Z.x=Math.max(Cs.x,Z.x),Z.y=Math.max(Cs.y,Z.y),p[V+X]=Cs.x,p[V+1+X]=Cs.y,p[V++]=Cs.x,p[V++]=Cs.y}Y=s.scaleToGeodeticSurface(Y,Y),k=m.clone(Y,oH),L=s.geodeticSurfaceNormal(Y,L),_&&(C[N+E]=-L.x,C[O+E]=-L.y,C[U+E]=-L.z);let H=m.multiplyByScalar(L,a,bie);if(Y=m.add(Y,H,Y),H=m.multiplyByScalar(L,c,H),k=m.add(k,H,k),n.position&&(h[N+E]=k.x,h[O+E]=k.y,h[U+E]=k.z,h[N]=Y.x,h[O]=Y.y,h[U]=Y.z),n.normal||n.tangent||n.bitangent){G=m.clone(L,G);let K=m.fromArray(e,(N+3)%E,bie);m.subtract(K,Y,K);let te=m.subtract(k,Y,rH);L=m.normalize(m.cross(te,K,L),L),n.normal&&(g[N]=L.x,g[O]=L.y,g[U]=L.z,g[N+E]=L.x,g[O+E]=L.y,g[U+E]=L.z),n.tangent&&(R=m.normalize(m.cross(G,L,R),R),f[N]=R.x,f[O]=R.y,f[U]=R.z,f[N+E]=R.x,f[N+1+E]=R.y,f[N+2+E]=R.z),n.bitangent&&(x[N]=G.x,x[O]=G.y,x[U]=G.z,x[N+E]=G.x,x[O+E]=G.y,x[U+E]=G.z)}}if(n.st){E=p.length;for(let N=0;N<E;N+=2)p[N]=(p[N]-b.x)/(Z.x-b.x),p[N+1]=(p[N+1]-b.y)/(Z.y-b.y)}let F=new mn;if(n.position&&(F.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(F.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(F.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(F.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(F.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),_&&(F.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===rn.TOP)N=N.fill(1,0,u/2);else{let O=t.offsetAttribute===rn.NONE?0:1;N=N.fill(O)}F.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return F}function jWe(e){let t=e.length/3,n=Ae.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var x5=new le,_5=new le;function qWe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,bC),e.height,bC);x5.center=m.add(t,o,x5.center),x5.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),_5.center=m.add(t,o,_5.center),_5.radius=i;let r=vl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=le.union(x5,_5),u=Vie(s,e,!0),h=Lie(a),p=h.length;h.length=p*2;let g=s.length/3;for(let R=0;R<p;R+=3)h[R+p]=h[R+2]+g,h[R+1+p]=h[R+1]+g,h[R+2+p]=h[R]+g;let f=Ae.createTypedArray(g*2/3,h),x=new lt({attributes:u,indices:f,primitiveType:we.TRIANGLES}),_=QWe(c,e);h=jWe(c);let C=Ae.createTypedArray(c.length*2/3,h),V=new lt({attributes:_,indices:C,primitiveType:we.TRIANGLES}),L=Fn.combineInstances([new Et({geometry:x}),new Et({geometry:V})]);return{boundingSphere:d,attributes:L[0].attributes,indices:L[0].indices}}function Rie(e,t,n,i,o,r,s){let c=vl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=c.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=m.fromArray(c,p*3);let h=ce.fromCartesianArray(u,r,s);return h.width>W.PI&&(h.north=h.north>0?W.PI_OVER_TWO-W.EPSILON7:h.north,h.south=h.south<0?W.EPSILON7-W.PI_OVER_TWO:h.south,h.east=W.PI,h.west=-W.PI),h}function xf(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Xe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Xe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}xf.packedLength=m.packedLength+ne.packedLength+Xe.packedLength+9;xf.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Zie=new m,Gie=new ne,Eie=new Xe,yf={center:Zie,ellipsoid:Gie,vertexFormat:Eie,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};xf.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Zie);t+=m.packedLength;let o=ne.unpack(e,t,Gie);t+=ne.packedLength;let r=Xe.unpack(e,t,Eie);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,f=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=f===-1?void 0:f,n):(yf.height=u,yf.extrudedHeight=p,yf.granularity=h,yf.stRotation=d,yf.rotation=c,yf.semiMajorAxis=s,yf.semiMinorAxis=a,yf.shadowVolume=g,yf.offsetAttribute=f===-1?void 0:f,new xf(yf))};xf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ne.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,W.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Rie(n,o,r,a,s,i,t)};xf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=qWe(o);else if(r=JWe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===rn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:we.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};xf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new xf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};function $We(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=vl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return lt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(xf.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Rie(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=$We(this)),this._textureCoordinateRotationPoints}}});var Hc=xf;function Fp(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Hc(n),this._workerName="createCircleGeometry"}Fp.packedLength=Hc.packedLength;Fp.pack=function(e,t,n){return Hc.pack(e._ellipseGeometry,t,n)};var Iie=new Hc({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Wa={center:new m,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Xe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Fp.unpack=function(e,t,n){let i=Hc.unpack(e,t,Iie);return Wa.center=m.clone(i._center,Wa.center),Wa.ellipsoid=ne.clone(i._ellipsoid,Wa.ellipsoid),Wa.ellipsoid=ne.clone(i._ellipsoid,Iie._ellipsoid),Wa.height=i._height,Wa.extrudedHeight=i._extrudedHeight,Wa.granularity=i._granularity,Wa.vertexFormat=Xe.clone(i._vertexFormat,Wa.vertexFormat),Wa.stRotation=i._stRotation,Wa.shadowVolume=i._shadowVolume,l(n)?(Wa.semiMajorAxis=i._semiMajorAxis,Wa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Hc(Wa),n):(Wa.radius=i._semiMajorAxis,new Fp(Wa))};Fp.createGeometry=function(e){return Hc.createGeometry(e._ellipseGeometry)};Fp.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new Fp({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Fp.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var aH=Fp;var g4t=T(S(),1);var d4t=T(S(),1);var Xie=new m,Px=new m;function e2e(e){let t=e.center;Px=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Px),e.height,Px),Px=m.add(t,Px,Px);let n=new le(Px,e.semiMajorAxis),i=vl.computeEllipsePositions(e,!1,!0).outerPositions,o=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:vl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ae.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var S5=new le,C5=new le;function t2e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,Xie),e.height,Xie);S5.center=m.add(t,o,S5.center),S5.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),C5.center=m.add(t,o,C5.center),C5.radius=i;let r=vl.computeEllipsePositions(e,!1,!0).outerPositions,s=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:vl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=le.union(S5,C5),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===rn.TOP)f=f.fill(1,0,c/2);else{let x=e.offsetAttribute===rn.NONE?0:1;f=f.fill(x)}s.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=y(e.numberOfVerticalLines,16);d=W.clamp(d,0,c/2);let u=Ae.createTypedArray(c,c*2+d*2);c/=2;let h=0,p;for(p=0;p<c;++p)u[h++]=p,u[h++]=(p+1)%c,u[h++]=p+c,u[h++]=(p+1)%c+c;let g;if(d>0){let f=Math.min(d,c);g=Math.round(c/f);let x=Math.min(g*d,c);for(p=0;p<x;p+=g)u[h++]=p,u[h++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function gC(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}gC.packedLength=m.packedLength+ne.packedLength+8;gC.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Wie=new m,Pie=new ne,Ap={center:Wie,ellipsoid:Pie,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};gC.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Wie);t+=m.packedLength;let o=ne.unpack(e,t,Pie);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(Ap.height=c,Ap.extrudedHeight=u,Ap.granularity=d,Ap.rotation=a,Ap.semiMajorAxis=r,Ap.semiMinorAxis=s,Ap.numberOfVerticalLines=h,Ap.offsetAttribute=p===-1?void 0:p,new gC(Ap))};gC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=t2e(o);else if(r=e2e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===rn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:we.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var bd=gC;function yC(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new bd(n),this._workerName="createCircleOutlineGeometry"}yC.packedLength=bd.packedLength;yC.pack=function(e,t,n){return bd.pack(e._ellipseGeometry,t,n)};var n2e=new bd({center:new m,semiMajorAxis:1,semiMinorAxis:1}),gd={center:new m,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};yC.unpack=function(e,t,n){let i=bd.unpack(e,t,n2e);return gd.center=m.clone(i._center,gd.center),gd.ellipsoid=ne.clone(i._ellipsoid,gd.ellipsoid),gd.height=i._height,gd.extrudedHeight=i._extrudedHeight,gd.granularity=i._granularity,gd.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(gd.semiMajorAxis=i._semiMajorAxis,gd.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new bd(gd),n):(gd.radius=i._semiMajorAxis,new yC(gd))};yC.createGeometry=function(e){return bd.createGeometry(e._ellipseGeometry)};var cH=yC;var W4t=T(S(),1);var x4t=T(S(),1),i2e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},vr=Object.freeze(i2e);var T4t=T(S(),1),o2e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},fo=Object.freeze(o2e);var C4t=T(S(),1),lH;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?lH=function(){return performance.now()}:lH=function(){return Date.now()};var xi=lH;function dH(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=q.clone(t):l(n)?t=q.clone(n):l(i)?t=q.addDays(i,-1,new q):t=q.now(),l(n)?n=q.clone(n):n=q.clone(t),l(i)?i=q.clone(i):i=q.addDays(n,1,new q),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,vr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xi(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,fo.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(dH.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){q.equals(this._currentTime,e)||(this._clockStep===fo.SYSTEM_CLOCK&&(this._clockStep=fo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===fo.SYSTEM_CLOCK&&(this._clockStep=fo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===fo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===fo.SYSTEM_CLOCK&&(this._clockStep=fo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});dH.prototype.tick=function(){let e=xi(),t=q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===fo.SYSTEM_CLOCK)t=q.now(t);else{let i=this._multiplier;if(n===fo.TICK_DEPENDENT)t=q.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=q.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===vr.CLAMPED)q.lessThan(t,r)?t=q.clone(r,t):q.greaterThan(t,s)&&(t=q.clone(s,t),this.onStop.raiseEvent(this));else if(o===vr.LOOP_STOP)for(q.lessThan(t,r)&&(t=q.clone(r,t));q.greaterThan(t,s);)t=q.addSeconds(r,q.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var km=dH;var M4t=T(S(),1);function xC(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([B.floatToByte(e),B.floatToByte(t),B.floatToByte(n),B.floatToByte(i)])}Object.defineProperties(xC.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});xC.fromColor=function(e){return new xC(e.red,e.green,e.blue,e.alpha)};xC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};xC.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Yt=xC;var U4t=T(S(),1);function _C(e){this._value=e,this._valueType=no.getPointType(e)}Object.defineProperties(_C.prototype,{value:{get:function(){return this._value}}});_C.prototype.findTimeInterval=function(e){};_C.prototype.wrapTime=function(e){return 0};_C.prototype.clampTime=function(e){return 0};_C.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var TE=_C;var Z8t=T(S(),1);var H4t=T(S(),1);var vie=W.EPSILON10;function r2e(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,h=-1;for(s=1;s<r;++s)c=e[s],t(a,c,vie)?(l(d)||(d=e.slice(0,s),u=s-1,h=0),o&&i.push(s)):(l(d)&&(d.push(c),u=s,o&&(h=i.length)),a=c);return n&&t(e[0],e[r-1],vie)&&(o&&(l(d)?i.splice(h,0,u):i.push(r-1)),l(d)?d.length-=1:d=e.slice(0,-1)),l(d)?d:e}var To=r2e;var q4t=T(S(),1);var SE={},s2e=new m,wie=new m,Fie=new m,Aie=new m,Mie=new Gn;SE.validOutline=function(e){let n=Gn.fromPoints(e,Mie).halfAxes,i=$.getColumn(n,0,wie),o=$.getColumn(n,1,Fie),r=$.getColumn(n,2,Aie),s=m.magnitude(i),a=m.magnitude(o),c=m.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};SE.computeProjectTo2DArguments=function(e,t,n,i){let o=Gn.fromPoints(e,Mie),r=o.halfAxes,s=$.getColumn(r,0,wie),a=$.getColumn(r,1,Fie),c=$.getColumn(r,2,Aie),d=m.magnitude(s),u=m.magnitude(a),h=m.magnitude(c),p=Math.min(d,u,h);if(d===0&&(u===0||h===0)||u===0&&h===0)return!1;let g,f;return(p===u||p===h)&&(g=s),p===d?g=a:p===h&&(f=a),(p===d||p===u)&&(f=c),m.normalize(g,n),m.normalize(f,i),m.clone(o.center,t),!0};function Nie(e,t,n,i,o){let r=m.subtract(e,t,s2e),s=m.dot(n,r),a=m.dot(i,r);return D.fromElements(s,a,o)}SE.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Nie(i[r],e,t,n);return o}};SE.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Nie(i,e,t,n,o)}};var Mp=SE;var n8t=T(S(),1);var sjt=T(S(),1);function mH(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),h=Math.sin(4*d),p=Math.sin(6*d),g=Math.sin(8*d),f=Math.sin(10*d),x=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function a2e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,h=u*c,p=h*c,g=p*c,f=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),R=Math.sin(8*i),G=Math.cos(8*i),I=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*u/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*L+(1097*i*p/65536+42783*i*g/1048576)*G+8011*i*g/1048576*v+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*_+(151*u/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*V+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*R+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*P}function TC(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function c2e(e,t,n,i,o){let r=TC(e._ellipticity,n),s=TC(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function l2e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=mH(e._ellipticity,t,o);d=(mH(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var d2e=new m,uH=new m;function kie(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,uH),d2e),r=m.normalize(i.cartographicToCartesian(n,uH),uH),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=c2e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=l2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Uie(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=mH(o,i,e.latitude),h=n*Math.cos(t),p=u+h;if(c=a2e(p,o,i),Math.abs(t)<W.EPSILON10)a=W.negativePiToPi(e.longitude);else{let g=TC(o,e.latitude),f=TC(o,c);d=Math.tan(t)*(f-g),a=W.negativePiToPi(e.longitude+d)}}else{c=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}d=n/u,t>0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function Np(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&kie(this,e,t,i)}Object.defineProperties(Np.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});Np.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ne.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let h=Uie(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Np(e,h,r):(o.setEndPoints(e,h),o)};Np.prototype.setEndPoints=function(e,t){kie(this,e,t,this._ellipsoid)};Np.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Np.prototype.interpolateUsingSurfaceDistance=function(e,t){return Uie(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Np.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,h;do{h=u;let p=n*Math.sin(h),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,h,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};Np.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=TC(n,o.latitude),s=TC(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Pa=Np;var ljt=T(S(),1);function u2e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var va=u2e;var Zjt=T(S(),1);var ujt=T(S(),1);function pH(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Bie(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,d;if(i&&(r=b2e(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let u=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let g=e[p],f=e[p+1];g<a&&(a=g),f<c&&(c=f),g>u&&(u=g),f>h&&(h=f)}d=Math.max(u-a,h-c),d=d!==0?32767/d:0}return VE(r,s,n,a,c,d,0),s}function Bie(e,t,n,i,o){let r;if(o===Z2e(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Die(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Die(s/i|0,e[s],e[s+1],r);return r&&SC(r,r.next)&&(RE(r),r=r.next),r}function vx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(SC(n,n.next)||wr(n.prev,n,n.next)===0)){if(RE(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function VE(e,t,n,i,o,r,s){if(!e)return;!s&&r&&T2e(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?h2e(e,i,o,r):m2e(e)){t.push(c.i,e.i,d.i),RE(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=f2e(vx(e),t),VE(e,t,n,i,o,r,2)):s===2&&p2e(e,t,n,i,o,r):VE(vx(e),t,n,i,o,r,1);break}}}function m2e(e){let t=e.prev,n=e,i=e.next;if(wr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=Math.min(o,r,s),h=Math.min(a,c,d),p=Math.max(o,r,s),g=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=g&&CE(o,a,r,c,s,d,f.x,f.y)&&wr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function h2e(e,t,n,i){let o=e.prev,r=e,s=e.next;if(wr(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,h=r.y,p=s.y,g=Math.min(a,c,d),f=Math.min(u,h,p),x=Math.max(a,c,d),_=Math.max(u,h,p),C=hH(g,f,t,n,i),V=hH(x,_,t,n,i),L=e.prevZ,R=e.nextZ;for(;L&&L.z>=C&&R&&R.z<=V;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&CE(a,u,c,h,d,p,L.x,L.y)&&wr(L.prev,L,L.next)>=0||(L=L.prevZ,R.x>=g&&R.x<=x&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&CE(a,u,c,h,d,p,R.x,R.y)&&wr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;L&&L.z>=C;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&CE(a,u,c,h,d,p,L.x,L.y)&&wr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;R&&R.z<=V;){if(R.x>=g&&R.x<=x&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&CE(a,u,c,h,d,p,R.x,R.y)&&wr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function f2e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!SC(i,o)&&Yie(i,n,n.next,o)&&LE(i,o)&&LE(o,i)&&(t.push(i.i,n.i,o.i),RE(n),RE(n.next),n=e=o),n=n.next}while(n!==e);return vx(n)}function p2e(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&V2e(s,a)){let c=Hie(s,a);s=vx(s,s.next),c=vx(c,c.next),VE(s,t,n,i,o,r,0),VE(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function b2e(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,d=Bie(e,a,c,i,!1);d===d.next&&(d.steiner=!0),o.push(C2e(d))}o.sort(g2e);for(let r=0;r<o.length;r++)n=y2e(o[r],n);return n}function g2e(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function y2e(e,t){let n=x2e(e,t);if(!n)return t;let i=Hie(n,e);return vx(i,i.next),vx(n,n.next)}function x2e(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(SC(e,n))return n;do{if(SC(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x<n.next.x?n:n.next,h===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,d=s.y,u=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Oie(o<d?i:r,o,c,d,o<d?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);LE(n,e)&&(h<u||h===u&&(n.x>s.x||n.x===s.x&&_2e(s,n)))&&(s=n,u=h)}n=n.next}while(n!==a);return s}function _2e(e,t){return wr(e.prev,e,t.prev)<0&&wr(t.next,e,e.next)<0}function T2e(e,t,n,i){let o=e;do o.z===0&&(o.z=hH(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,S2e(o)}function S2e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d<n&&(a++,s=s.nextZ,!!s);d++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function hH(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function C2e(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Oie(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function CE(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Oie(e,t,n,i,o,r,s,a)}function V2e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!L2e(e,t)&&(LE(e,t)&&LE(t,e)&&R2e(e,t)&&(wr(e.prev,e,t.prev)||wr(e,t.prev,t))||SC(e,t)&&wr(e.prev,e,e.next)>0&&wr(t.prev,t,t.next)>0)}function wr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function SC(e,t){return e.x===t.x&&e.y===t.y}function Yie(e,t,n,i){let o=L5(wr(e,t,n)),r=L5(wr(e,t,i)),s=L5(wr(n,i,e)),a=L5(wr(n,i,t));return!!(o!==r&&s!==a||o===0&&V5(e,n,t)||r===0&&V5(e,i,t)||s===0&&V5(n,e,i)||a===0&&V5(n,t,i))}function V5(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function L5(e){return e>0?1:e<0?-1:0}function L2e(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Yie(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function LE(e,t){return wr(e.prev,e,e.next)<0?wr(e,t,e.next)>=0&&wr(e,e.prev,t)>=0:wr(e,t,e.prev)<0||wr(e,e.next,t)<0}function R2e(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Hie(e,t){let n=fH(e.i,e.x,e.y),i=fH(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Die(e,t,n,i){let o=fH(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function RE(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function fH(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Z2e(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var G2e=new m,E2e=new m,ng={};ng.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};ng.computeWindingOrder2D=function(e){return ng.computeArea2D(e)>0?us.COUNTER_CLOCKWISE:us.CLOCKWISE};ng.triangulate=function(e,t){let n=D.packArray(e);return pH(n,t,2)};var Qie=new m,jie=new m,qie=new m,zie=new m,Kie=new m,Jie=new m,kp=new m,$ie=new D,eoe=new D,toe=new D,CC=new D;ng.computeSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let L=t[a];if(d[h++]=L.x,d[h++]=L.y,d[h++]=L.z,r){let R=i[a];u[p++]=R.x,u[p++]=R.y}}let g=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=_*_;for(;s.length>0;){let L=s.pop(),R=s.pop(),G=s.pop(),I=m.fromArray(d,G*3,Qie),v=m.fromArray(d,R*3,jie),P=m.fromArray(d,L*3,qie),w,M,b;r&&(w=D.fromArray(u,G*2,$ie),M=D.fromArray(u,R*2,eoe),b=D.fromArray(u,L*2,toe));let Z=m.multiplyByScalar(m.normalize(I,zie),x,zie),E=m.multiplyByScalar(m.normalize(v,Kie),x,Kie),X=m.multiplyByScalar(m.normalize(P,Jie),x,Jie),F=m.magnitudeSquared(m.subtract(Z,E,kp)),N=m.magnitudeSquared(m.subtract(E,X,kp)),O=m.magnitudeSquared(m.subtract(X,Z,kp)),U=Math.max(F,N,O),Y,k,H;U>C?F===U?(Y=`${Math.min(G,R)} ${Math.max(G,R)}`,a=f[Y],l(a)||(k=m.add(I,v,kp),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(w,M,CC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(G,a,L),s.push(a,R,L)):N===U?(Y=`${Math.min(R,L)} ${Math.max(R,L)}`,a=f[Y],l(a)||(k=m.add(v,P,kp),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(M,b,CC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(R,a,G),s.push(a,L,G)):O===U&&(Y=`${Math.min(L,G)} ${Math.max(L,G)}`,a=f[Y],l(a)||(k=m.add(P,I,kp),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(b,w,CC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(L,a,R),s.push(a,G,R)):(g.push(G),g.push(R),g.push(L))}let V={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:we.TRIANGLES};return r&&(V.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new lt(V)};var I2e=new he,X2e=new he,W2e=new he,bH=new he;ng.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let G=t[a];if(d[h++]=G.x,d[h++]=G.y,d[h++]=G.z,r){let I=i[a];u[p++]=I.x,u[p++]=I.y}}let g=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=new Pa(void 0,void 0,e),V=new Pa(void 0,void 0,e),L=new Pa(void 0,void 0,e);for(;s.length>0;){let G=s.pop(),I=s.pop(),v=s.pop(),P=m.fromArray(d,v*3,Qie),w=m.fromArray(d,I*3,jie),M=m.fromArray(d,G*3,qie),b,Z,E;r&&(b=D.fromArray(u,v*2,$ie),Z=D.fromArray(u,I*2,eoe),E=D.fromArray(u,G*2,toe));let X=e.cartesianToCartographic(P,I2e),F=e.cartesianToCartographic(w,X2e),N=e.cartesianToCartographic(M,W2e);C.setEndPoints(X,F);let O=C.surfaceDistance;V.setEndPoints(F,N);let U=V.surfaceDistance;L.setEndPoints(N,X);let Y=L.surfaceDistance,k=Math.max(O,U,Y),H,K,te,z,j;k>_?O===k?(H=`${Math.min(v,I)} ${Math.max(v,I)}`,a=f[H],l(a)||(K=C.interpolateUsingFraction(.5,bH),te=(X.height+F.height)*.5,z=m.fromRadians(K.longitude,K.latitude,te,e,kp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(b,Z,CC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(v,a,G),s.push(a,I,G)):U===k?(H=`${Math.min(I,G)} ${Math.max(I,G)}`,a=f[H],l(a)||(K=V.interpolateUsingFraction(.5,bH),te=(F.height+N.height)*.5,z=m.fromRadians(K.longitude,K.latitude,te,e,kp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(Z,E,CC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(I,a,v),s.push(a,G,v)):Y===k&&(H=`${Math.min(G,v)} ${Math.max(G,v)}`,a=f[H],l(a)||(K=L.interpolateUsingFraction(.5,bH),te=(N.height+X.height)*.5,z=m.fromRadians(K.longitude,K.latitude,te,e,kp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(E,b,CC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(G,a,I),s.push(a,v,I)):(g.push(v),g.push(I),g.push(G))}let R={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:we.TRIANGLES};return r&&(R.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new lt(R)};ng.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ne.default);let o=G2e,r=E2e;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),m.multiplyByScalar(o,t,o),m.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var ii=ng;var Ejt=T(S(),1);function ig(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(ig.prototype,{length:{get:function(){return this._length}}});ig.prototype.enqueue=function(e){this._array.push(e),this._length++};ig.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};ig.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ig.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ig.prototype.clear=function(){this._array.length=this._offset=this._length=0};ig.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var og=ig;var Qo={};Qo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d<c;++d,n+=i.packedLength)i.pack(s[d],t,n)}if(l(a)){let c=a.length;for(let d=0;d<c;++d)o.push(a[d])}}return n};Qo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=Qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var wx=new D;function ooe(e,t,n,i){return D.subtract(t,e,wx),D.multiplyByScalar(wx,n/i,wx),D.add(e,wx,wx),[wx.x,wx.y]}var rg=new m;function P2e(e,t,n,i){return m.subtract(t,e,rg),m.multiplyByScalar(rg,n/i,rg),m.add(e,rg,rg),[rg.x,rg.y,rg.z]}Qo.subdivideLineCount=function(e,t,n){let o=m.distance(e,t)/n,r=Math.max(0,Math.ceil(W.log2(o)));return Math.pow(2,r)};var Z5=new he,G5=new he,v2e=new he,w2e=new m,R5=new Pa;Qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,Z5),r=e.cartesianToCartographic(n,G5),a=new Pa(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(W.log2(a)));return Math.pow(2,c)};Qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=Qo.subdivideLineCount(n,i,o),a=D.distance(e,t),c=a/s,d=r;d.length=s*2;let u=0;for(let h=0;h<s;h++){let p=ooe(e,t,h*c,a);d[u++]=p[0],d[u++]=p[1]}return d};Qo.subdivideLine=function(e,t,n,i){let o=Qo.subdivideLineCount(e,t,n),r=m.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let d=0;d<o;d++){let u=P2e(e,t,d*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};Qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,Z5),c=n.cartesianToCartographic(o,G5);R5.setEndPoints(a,c);let d=R5.surfaceDistance/r,u=Math.max(0,Math.ceil(W.log2(d))),h=Math.pow(2,u),p=D.distance(e,t),g=p/h,f=s;f.length=h*2;let x=0;for(let _=0;_<h;_++){let C=ooe(e,t,_*g,p);f[x++]=C[0],f[x++]=C[1]}return f};Qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,Z5),s=e.cartesianToCartographic(n,G5),a=new Pa(r,s,e);if(l(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=a.surfaceDistance/i,d=Math.max(0,Math.ceil(W.log2(c))),u=Math.pow(2,d),h=a.surfaceDistance/u,p=o;p.length=u*3;let g=0;for(let f=0;f<u;f++){let x=a.interpolateUsingSurfaceDistance(f*h,v2e),_=e.cartographicToCartesian(x,w2e);p[g++]=_.x,p[g++]=_.y,p[g++]=_.z}return p};var F2e=new m,A2e=new m,M2e=new m,N2e=new m;Qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ne.default);let r=F2e,s=A2e,a=M2e,c=N2e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let d=e.attributes.position.values,u=d.length/2;for(let h=0;h<u;h+=3)m.fromArray(d,h,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(r,n,s),s=m.add(c,s,s),d[h+u]=s.x,d[h+1+u]=s.y,d[h+2+u]=s.z,o&&(c=m.clone(a,c)),s=m.multiplyByScalar(r,t,s),s=m.add(c,s,s),d[h]=s.x,d[h+1]=s.y,d[h+2]=s.z}return e};Qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new og;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),d=c.positions;if(t)for(a=d.length,r=0;r<a;r++)n.scaleToGeodeticSurface(d[r],d[r]);if(d=To(d,m.equalsEpsilon,!0),d.length<3)continue;let u=c.holes?c.holes.length:0;for(r=0;r<u;r++){let h=c.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=To(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(d)}return i};var k2e=new he;function U2e(e,t,n){let i=n.cartesianToCartographic(e,Z5),o=n.cartesianToCartographic(t,G5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;R5.setEndPoints(i,o);let r=R5.findIntersectionWithLatitude(0,k2e);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>W.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function D2e(e,t,n,i){if(i===en.RHUMB)return U2e(e,t,n);let o=qn.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var B2e=new he;function O2e(e,t,n){let i=[],o,r,s,a,c,d=0;for(;d<e.length;){o=e[d],r=e[(d+1)%e.length],s=W.sign(o.z),a=W.sign(r.z);let u=h=>t.cartesianToCartographic(h,B2e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=D2e(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function roe(e,t,n,i,o,r,s){let a=[],c=r,d=h=>p=>p.position===h,u=[];do{let h=n[c];a.push(h);let p=i.findIndex(d(c)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:x,next:_}=g;if(g.visited=!0,x===0){if(_===0){let R=i[p-(s?1:-1)];if(R?.position===c+1)R.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}f||u.push(c);let V=p+(s?1:-1),L=i[V];if(!l(L)){++c;continue}c=L.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let h of u)t=roe(e,++t,n,i,0,h,!s);return t}Qo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=O2e(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((d,u)=>d.theta-u.theta);let c=s[0].z>=0;o=roe(i,o,s,a,1,0,c)}return i};Qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new og;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),h=u.positions,p=u.holes,g,f;if(i)for(f=h.length,g=0;g<f;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=To(h,m.equalsEpsilon,!0)),h.length<3)continue;let x=n(h);if(!l(x))continue;let _=[],C=ii.computeWindingOrder2D(x);if(C===us.CLOCKWISE&&(x.reverse(),h=h.slice().reverse()),d){d=!1;let I=[h];if(I=r(I,I),I.length>1){for(let v of I)c.enqueue(new va(v,p));continue}}let V=h.slice(),L=l(p)?p.length:0,R=[],G;for(g=0;g<L;g++){let I=p[g],v=I.positions;if(i)for(f=v.length,G=0;G<f;++G)o.scaleToGeodeticSurface(v[G],v[G]);if(t||(v=To(v,m.equalsEpsilon,!0)),v.length<3)continue;let P=n(v);if(!l(P))continue;C=ii.computeWindingOrder2D(P),C===us.CLOCKWISE&&(P.reverse(),v=v.slice().reverse()),R.push(v),_.push(V.length),V=V.concat(v),x=x.concat(P);let w=0;for(l(I.holes)&&(w=I.holes.length),G=0;G<w;G++)c.enqueue(I.holes[G])}s.push({outerRing:h,holes:R}),a.push({positions:V,positions2D:x,holes:_})}return{hierarchy:s,polygons:a}};var Y2e=new D,H2e=new m,z2e=new ve,K2e=new $;Qo.computeBoundingRectangle=function(e,t,n,i,o){let r=ve.fromAxisAngle(e,i,z2e),s=$.fromQuaternion(r,K2e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let g=m.clone(n[p],H2e);$.multiplyByVector(s,g,g);let f=t(g,Y2e);l(f)&&(a=Math.min(a,f.x),c=Math.max(c,f.x),d=Math.min(d,f.y),u=Math.max(u,f.y))}return o.x=a,o.y=d,o.width=c-a,o.height=u-d,o};Qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ii.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,d=l(n),u=d?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),g=0;for(let _=0;_<h;_++){let C=c[_];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let f={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:we.TRIANGLES};d&&(f.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:D.packArray(u)}));let x=new lt(f);return r.normal?Fn.computeNormal(x):x}if(s===en.GEODESIC)return ii.computeSubdivision(e,c,a,u,i);if(s===en.RHUMB)return ii.computeRhumbLineSubdivision(e,c,a,u,i)};var noe=[],ioe=[],J2e=new m,Q2e=new m;Qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,d,u,h,p,g,f,x=e.length,_=0,C=0,V=l(t),L=V?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),V&&(f=x*2*2,g=new Array(f*2)),c=0;c<x;c++)d=e[c],u=e[(c+1)%x],s[_]=s[_+a]=d.x,++_,s[_]=s[_+a]=d.y,++_,s[_]=s[_+a]=d.z,++_,s[_]=s[_+a]=u.x,++_,s[_]=s[_+a]=u.y,++_,s[_]=s[_+a]=u.z,++_,V&&(h=L[c],p=L[(c+1)%x],g[C]=g[C+f]=h.x,++C,g[C]=g[C+f]=h.y,++C,g[C]=g[C+f]=p.x,++C,g[C]=g[C+f]=p.y,++C);else{let P=W.chordLength(i,n.maximumRadius),w=0;if(r===en.GEODESIC)for(c=0;c<x;c++)w+=Qo.subdivideLineCount(e[c],e[(c+1)%x],P);else if(r===en.RHUMB)for(c=0;c<x;c++)w+=Qo.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],P);for(a=(w+x)*3,s=new Array(a*2),V&&(f=(w+x)*2,g=new Array(f*2)),c=0;c<x;c++){d=e[c],u=e[(c+1)%x];let M,b;V&&(h=L[c],p=L[(c+1)%x]),r===en.GEODESIC?(M=Qo.subdivideLine(d,u,P,ioe),V&&(b=Qo.subdivideTexcoordLine(h,p,d,u,P,noe))):r===en.RHUMB&&(M=Qo.subdivideRhumbLine(n,d,u,P,ioe),V&&(b=Qo.subdivideTexcoordRhumbLine(h,p,n,d,u,P,noe)));let Z=M.length;for(let E=0;E<Z;++E,++_)s[_]=M[E],s[_+a]=M[E];if(s[_]=u.x,s[_+a]=u.x,++_,s[_]=u.y,s[_+a]=u.y,++_,s[_]=u.z,s[_+a]=u.z,++_,V){let E=b.length;for(let X=0;X<E;++X,++C)g[C]=b[X],g[C+f]=b[X];g[C]=p.x,g[C+f]=p.x,++C,g[C]=p.y,g[C+f]=p.y,++C}}}x=s.length;let R=Ae.createTypedArray(x/3,x-e.length*6),G=0;for(x/=6,c=0;c<x;c++){let P=c,w=P+1,M=P+x,b=M+1;d=m.fromArray(s,P*3,J2e),u=m.fromArray(s,w*3,Q2e),!m.equalsEpsilon(d,u,W.EPSILON10,W.EPSILON10)&&(R[G++]=P,R[G++]=M,R[G++]=w,R[G++]=w,R[G++]=M,R[G++]=b)}let I={attributes:new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:R,primitiveType:we.TRIANGLES};return V&&(I.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),new lt(I)};var kn=Qo;var j2e=new m,q2e=new Ke,$2e=new D,ePe=new D,tPe=new m,nPe=new m,iPe=new m,ZE=new m,oPe=new m,rPe=new m,soe=new ve,sPe=new $,aPe=new $,cPe=new m;function lPe(e,t,n,i,o,r,s,a,c){let d=e.positions,u=ii.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let h=Ae.createTypedArray(d.length,u.length);h.set(u);let p=sPe;if(i!==0){let b=ve.fromAxisAngle(s,i,soe);if(p=$.fromQuaternion(b,p),t.tangent||t.bitangent){b=ve.fromAxisAngle(s,-i,soe);let Z=$.fromQuaternion(b,aPe);a=m.normalize($.multiplyByVector(Z,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=ePe;t.st&&(g.x=n.x,g.y=n.y);let f=d.length,x=f*3,_=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,V=t.tangent?new Float32Array(x):void 0,L=t.bitangent?new Float32Array(x):void 0,R=t.st?new Float32Array(f*2):void 0,G=0,I=0,v=0,P=0,w=0;for(let b=0;b<f;b++){let Z=d[b];if(_[G++]=Z.x,_[G++]=Z.y,_[G++]=Z.z,t.st)if(l(o)&&o.positions.length===f)R[w++]=o.positions[b].x,R[w++]=o.positions[b].y;else{let E=$.multiplyByVector(p,Z,j2e),X=r(E,$2e);D.subtract(X,g,X);let F=W.clamp(X.x/n.width,0,1),N=W.clamp(X.y/n.height,0,1);R[w++]=F,R[w++]=N}t.normal&&(C[I++]=s.x,C[I++]=s.y,C[I++]=s.z),t.tangent&&(V[P++]=a.x,V[P++]=a.y,V[P++]=a.z),t.bitangent&&(L[v++]=c.x,L[v++]=c.y,L[v++]=c.z)}let M=new mn;return t.position&&(M.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_})),t.normal&&(M.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(M.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(M.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.st&&(M.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:R})),new lt({attributes:M,indices:h,primitiveType:we.TRIANGLES})}function Fx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Xe.DEFAULT);this._vertexFormat=Xe.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=kn.computeHierarchyPackedLength(t,m)+Xe.packedLength+ne.packedLength+(l(n)?kn.computeHierarchyPackedLength(n,D):1)+2}Fx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Fx(t)};Fx.pack=function(e,t,n){return n=y(n,0),n=kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=kn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var dPe=ne.clone(ne.UNIT_SPHERE),uPe=new Xe,mPe={polygonHierarchy:{}};Fx.unpack=function(e,t,n){t=y(t,0);let i=kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,dPe);t+=ne.packedLength;let r=Xe.unpack(e,t,uPe);t+=Xe.packedLength;let s=e[t++],a=e[t]===-1?void 0:kn.unpackPolygonHierarchy(e,t,D);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new Fx(mPe)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Fx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=To(s,m.equalsEpsilon,!0),s.length<3)return;let a=tPe,c=nPe,d=iPe,u=oPe,h=rPe;if(!Mp.computeProjectTo2DArguments(s,ZE,u,h))return;if(a=m.cross(u,h,a),a=m.normalize(a,a),!m.equalsEpsilon(ZE,m.ZERO,W.EPSILON6)){let w=e._ellipsoid.geodeticSurfaceNormal(ZE,cPe);m.dot(a,w)<0&&(a=m.negate(a,a),u=m.negate(u,u))}let g=Mp.createProjectPointsTo2DFunction(ZE,u,h),f=Mp.createProjectPointTo2DFunction(ZE,u,h);t.tangent&&(c=m.clone(u,c)),t.bitangent&&(d=m.clone(h,d));let x=kn.polygonsFromHierarchy(n,r,g,!1),_=x.hierarchy,C=x.polygons,V=function(w){return w},L=r?kn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let R=le.fromPoints(s),G=kn.computeBoundingRectangle(a,f,s,i,q2e),I=[];for(let w=0;w<C.length;w++){let M=new Et({geometry:lPe(C[w],t,G,i,r?L[w]:void 0,f,a,c,d)});I.push(M)}let v=Fn.combineInstances(I)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Ae.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new lt({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:R})};var GE=Fx;var O8t=T(S(),1);function hPe(e){let t=e.length,n=new Float64Array(t*3),i=Ae.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n})});return new lt({attributes:s,indices:i,primitiveType:we.LINES})}function Ax(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=kn.computeHierarchyPackedLength(t,m)+1}Ax.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new Ax(t)};Ax.pack=function(e,t,n){return n=y(n,0),n=kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var fPe={polygonHierarchy:{}};Ax.unpack=function(e,t,n){t=y(t,0);let i=kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Ax(fPe)),n._polygonHierarchy=i,n.packedLength=o,n};Ax.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=To(n,m.equalsEpsilon,!0),n.length<3||!Mp.validOutline(n))return;let o=kn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Et({geometry:hPe(o[c])});r.push(d)}let s=Fn.combineInstances(r)[0],a=le.fromPoints(t.positions);return new lt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Eu=Ax;var H8t=T(S(),1),pPe={ROUNDED:0,MITERED:1,BEVELED:2},Pi=Object.freeze(pPe);var d6t=T(S(),1);var D7t=T(S(),1);var h7t=T(S(),1);var e7t=T(S(),1);function bPe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),d=c*a,u=Math.atan2(a,r),h=c*s,p=h*h,g=1-p,f=Math.sqrt(g),x=t/4,_=x*x,C=_*x,V=_*_,L=1+x-3*_/4+5*C/4-175*V/64,R=1-x+15*_/8-35*C/8,G=1-3*x+35*_/4,I=1-5*x,v=L*u-R*Math.sin(2*u)*x/2-G*Math.sin(4*u)*_/16-I*Math.sin(6*u)*C/48-Math.sin(8*u)*5*V/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=s,P.tanU=a,P.cosineU=c,P.sineU=d,P.sigma=u,P.sineAlpha=h,P.sineSquaredAlpha=p,P.cosineSquaredAlpha=g,P.cosineAlpha=f,P.u2Over4=x,P.u4Over16=_,P.u6Over64=C,P.u8Over256=V,P.a0=L,P.a1=R,P.a2=G,P.a3=I,P.distanceRatio=v}function gPe(e,t){return e*t*(4+e*(4-3*t))/16}function aoe(e,t,n,i,o,r,s){let a=gPe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function yPe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,d=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),h=Math.cos(d),p=Math.sin(d),g=Math.cos(u),f=Math.sin(u),x=h*g,_=h*f,C=p*f,V=p*g,L=c,R=W.TWO_PI,G=Math.cos(L),I=Math.sin(L),v,P,w,M,b;do{G=Math.cos(L),I=Math.sin(L);let k=_-V*G;w=Math.sqrt(g*g*I*I+k*k),P=C+x*G,v=Math.atan2(w,P);let H;w===0?(H=0,M=1):(H=x*I/w,M=1-H*H),R=L,b=P-2*C/M,isFinite(b)||(b=0),L=c+aoe(a,H,M,v,w,P,b)}while(Math.abs(L-R)>W.EPSILON12);let Z=M*(t*t-n*n)/(n*n),E=1+Z*(4096+Z*(Z*(320-175*Z)-768))/16384,X=Z*(256+Z*(Z*(74-47*Z)-128))/1024,F=b*b,N=X*w*(b+X*(P*(2*F-1)-X*b*(4*w*w-3)*(4*F-3)/6)/4),O=n*E*(v-N),U=Math.atan2(g*I,_-V*G),Y=Math.atan2(h*I,_*G-V);e._distance=O,e._startHeading=U,e._endHeading=Y,e._uSquared=Z}var xPe=new m,gH=new m;function coe(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,gH),xPe),r=m.normalize(i.cartographicToCartesian(n,gH),gH);yPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,bPe(e)}function EE(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&coe(this,e,t,i)}Object.defineProperties(EE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});EE.prototype.setEndPoints=function(e,t){coe(this,e,t,this._ellipsoid)};EE.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};EE.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*g*o/3+i*(1-f+7*_/4-15*x/4+579*g/64-(_-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(f/2-_+71*x/32-85*g/16)*a+(5*_/16-5*x/4+383*g/96)*c-h*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*d+539*g*u/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let R=Math.cos(2*n.sigma+C),G=Math.sin(C),I=Math.cos(C),v=n.cosineU*I,P=n.sineU*G,M=Math.atan2(G*n.sineHeading,v-P*n.cosineHeading)-aoe(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,I,R);return l(t)?(t.longitude=this._start.longitude+M,t.latitude=L,t.height=0,t):new he(this._start.longitude+M,L,0)};var Up=EE;var zc={};zc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};zc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var _Pe=new he;zc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,_Pe).height}return i};var TPe=new A,SPe=new m,loe=new m,CPe=new sn(m.UNIT_X,0),doe=new m,VPe=new sn(m.UNIT_X,0),LPe=new m,RPe=new m,xH=[];function moe(e,t,n){let i=xH;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var I5=new he,E5=new he,sg=new m,_H=new m,ZPe=new m,yH=new Up,IE=new Pa;function GPe(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,_H),d=i.scaleToGeodeticSurface(t,ZPe),u=zc.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,I5),p=i.cartesianToCartographic(d,E5),g=moe(u,o,r);yH.setEndPoints(h,p);let f=yH.surfaceDistance/u,x=a;h.height=o;let _=i.cartographicToCartesian(h,sg);m.pack(_,s,x),x+=3;for(let C=1;C<u;C++){let V=yH.interpolateUsingSurfaceDistance(C*f,E5);V.height=g[C],_=i.cartographicToCartesian(V,sg),m.pack(_,s,x),x+=3}return x}function EPe(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,I5),d=i.cartesianToCartographic(t,E5),u=zc.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let h=moe(u,o,r);IE.ellipsoid.equals(i)||(IE=new Pa(void 0,void 0,i)),IE.setEndPoints(c,d);let p=IE.surfaceDistance/u,g=a;c.height=o;let f=i.cartographicToCartesian(c,sg);m.pack(f,s,g),g+=3;for(let x=1;x<u;x++){let _=IE.interpolateUsingSurfaceDistance(x*p,E5);_.height=h[x],f=i.cartographicToCartesian(_,sg),m.pack(f,s,g),g+=3}return g}zc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,A.IDENTITY);let o=A.inverseTransformation(t,TPe),r=A.multiplyByPoint(o,m.ZERO,SPe),s=m.normalize(A.multiplyByPointAsVector(o,m.UNIT_Y,loe),loe),a=sn.fromPointNormal(r,s,CPe),c=m.normalize(A.multiplyByPointAsVector(o,m.UNIT_X,doe),doe),d=sn.fromPointNormal(r,c,VPe),u=1;n.push(m.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g<p;++g){let f=e[g];if(sn.getPointDistance(d,h)<0||sn.getPointDistance(d,f)<0){let x=qn.lineSegmentPlane(h,f,a,LPe);if(l(x)){let _=m.multiplyByScalar(s,5e-9,RPe);sn.getPointDistance(a,h)<0&&m.negate(_,_),n.push(m.add(x,_,new m)),i.push(u+1),m.negate(_,_),n.push(m.add(x,_,new m)),u=1}}n.push(m.clone(e[g])),u++,h=f}i.push(u)}return{positions:n,lengths:i}};zc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ne.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],_H);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(x,sg);m.multiplyByScalar(_,o,_),m.add(x,_,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,W.RADIANS_PER_DEGREE);s=W.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=zc.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),h=0;for(c=0;c<n-1;c++){let x=t[c],_=t[c+1],C=r?o[c]:o,V=r?o[c+1]:o;h=GPe(x,_,s,i,C,V,u,h)}xH.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,I5);g.height=r?o[n-1]:o;let f=i.cartographicToCartesian(g,sg);return m.pack(f,u,d-3),u};var uoe=new he,IPe=new he;zc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ne.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],_H);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(C,sg);m.multiplyByScalar(V,o,V),m.add(C,V,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,W.RADIANS_PER_DEGREE),a=0,c,d=i.cartesianToCartographic(t[0],uoe),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],IPe),a+=zc.numberOfPointsRhumbLine(d,u,s),d=he.clone(u,uoe);let h=(a+1)*3,p=new Array(h),g=0;for(c=0;c<n-1;c++){let C=t[c],V=t[c+1],L=r?o[c]:o,R=r?o[c+1]:o;g=EPe(C,V,s,i,L,R,p,g)}xH.length=0;let f=t[n-1],x=i.cartesianToCartographic(f,I5);x.height=r?o[n-1]:o;let _=i.cartographicToCartesian(x,sg);return m.pack(_,p,h-3),p};zc.generateCartesianArc=function(e){let t=zc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};zc.generateCartesianRhumbArc=function(e){let t=zc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};var vi=zc;var W7t=T(S(),1);var g7t=T(S(),1);var hoe={};function XE(e,t){l(hoe[e])||(hoe[e]=!0,console.warn(y(t,e)))}XE.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";XE.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored";XE.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored";XE.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var _t=XE;var da=[new m,new m],XPe=new m,WPe=new m,PPe=new m,vPe=new m,wPe=new m,FPe=new m,APe=new m,MPe=new m,NPe=new m,VC=new m,X5=new m,WE={},TH=new he;function kPe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];TH=t.cartesianToCartographic(o,TH),n[i]=TH.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function SH(e,t,n,i){let o=e[0],r=e[1],s=m.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),d;if(t===n){for(d=0;d<a;d++)c[d]=t;return c.push(n),c}let h=(n-t)/a;for(d=1;d<a;d++){let p=t+d*h;c[d]=p}return c[0]=t,c.push(n),c}var W5=new m,P5=new m;function UPe(e,t,n,i){let o=new Qr(n,i),r=o.projectPointOntoPlane(m.add(n,e,W5),W5),s=o.projectPointOntoPlane(m.add(n,t,P5),P5),a=D.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var DPe=new m(-1,0,0),Mx=new A,BPe=new A,CH=new $,OPe=$.IDENTITY.clone(),YPe=new m,HPe=new se,foe=new m;function Dp(e,t,n,i,o,r,s,a){let c=YPe,d=HPe;Mx=Pt.eastNorthUpToFixedFrame(e,o,Mx),c=A.multiplyByPointAsVector(Mx,DPe,c),c=m.normalize(c,c);let u=UPe(c,t,e,o);CH=$.fromRotationZ(u,CH),foe.z=r,Mx=A.multiplyTransformation(Mx,A.fromRotationTranslation(CH,foe,BPe),Mx);let h=OPe;h[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)d=m.fromArray(n,g,d),d=$.multiplyByVector(h,d,d),d=A.multiplyByPoint(Mx,d,d),i.push(d.x,d.y,d.z);return i}var zPe=new m;function VH(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,zPe);i=Dp(c,t,n,i,o,r[a/3],s,1)}return i}function KPe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function poe(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var boe=new ve,goe=new m,yoe=new $;function xoe(e,t,n,i,o,r,s,a,c,d){let u=m.angleBetween(m.subtract(t,e,VC),m.subtract(n,e,X5)),h=i===Pi.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=$.fromQuaternion(ve.fromAxisAngle(m.negate(e,VC),u/(h+1),boe),yoe):p=$.fromQuaternion(ve.fromAxisAngle(e,u/(h+1),boe),yoe);let g,f;if(t=m.clone(t,goe),h>0){let x=d?2:1;for(let _=0;_<h;_++)t=$.multiplyByVector(p,t,t),g=m.subtract(t,e,VC),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(t,X5),s=Dp(f,g,a,s,r,c,1,x)}else g=m.subtract(t,e,VC),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(t,X5),s=Dp(f,g,a,s,r,c,1,1),n=m.clone(n,goe),g=m.subtract(n,e,VC),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(n,X5),s=Dp(f,g,a,s,r,c,1,1);return s}WE.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];D.equals(r,s)||n.push(s)}return n};WE.angleIsGreaterThanPi=function(e,t,n,i){let o=new Qr(n,i),r=o.projectPointOntoPlane(m.add(n,e,W5),W5),s=o.projectPointOntoPlane(m.add(n,t,P5),P5);return s.x*r.y-s.y*r.x>=0};var JPe=new m,QPe=new m;WE.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=kPe(e,r),a=i._granularity,c=i._cornerType,d=o?KPe(t,n):poe(t,n),u=o?poe(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,f=[],x=o?[]:void 0,_=XPe,C=WPe,V=PPe,L=vPe,R=wPe,G=FPe,I=APe,v=MPe,P=NPe,w=e[0],M=e[1];L=r.geodeticSurfaceNormal(w,L),_=m.subtract(M,w,_),_=m.normalize(_,_),v=m.cross(L,_,v),v=m.normalize(v,v);let b=s[0],Z=s[1];o&&(x=Dp(w,v,u,x,r,b+h,1,1)),P=m.clone(w,P),w=M,C=m.negate(_,C);let E,X;for(let O=1;O<g-1;O++){let U=o?2:1;if(M=e[O+1],w.equals(M)){_t("Positions are too close and are considered equivalent with rounding error.");continue}_=m.subtract(M,w,_),_=m.normalize(_,_),L=r.geodeticSurfaceNormal(w,L);let Y=m.multiplyByScalar(L,m.dot(_,L),JPe);m.subtract(_,Y,Y),m.normalize(Y,Y);let k=m.multiplyByScalar(L,m.dot(C,L),QPe);if(m.subtract(C,k,k),m.normalize(k,k),!W.equalsEpsilon(Math.abs(m.dot(Y,k)),1,W.EPSILON7)){V=m.add(_,C,V),V=m.normalize(V,V),V=m.cross(V,L,V),V=m.cross(L,V,V),V=m.normalize(V,V);let K=1/Math.max(.25,m.magnitude(m.cross(V,C,VC))),te=WE.angleIsGreaterThanPi(_,C,w,r);te?(R=m.add(w,m.multiplyByScalar(V,K*p,V),R),G=m.add(R,m.multiplyByScalar(v,p,G),G),da[0]=m.clone(P,da[0]),da[1]=m.clone(G,da[1]),E=SH(da,b+h,Z+h,a),X=vi.generateArc({positions:da,granularity:a,ellipsoid:r}),f=VH(X,v,d,f,r,E,1),v=m.cross(L,_,v),v=m.normalize(v,v),I=m.add(R,m.multiplyByScalar(v,p,I),I),c===Pi.ROUNDED||c===Pi.BEVELED?xoe(R,G,I,c,te,r,f,d,Z+h,o):(V=m.negate(V,V),f=Dp(w,V,d,f,r,Z+h,K,U)),P=m.clone(I,P)):(R=m.add(w,m.multiplyByScalar(V,K*p,V),R),G=m.add(R,m.multiplyByScalar(v,-p,G),G),da[0]=m.clone(P,da[0]),da[1]=m.clone(G,da[1]),E=SH(da,b+h,Z+h,a),X=vi.generateArc({positions:da,granularity:a,ellipsoid:r}),f=VH(X,v,d,f,r,E,1),v=m.cross(L,_,v),v=m.normalize(v,v),I=m.add(R,m.multiplyByScalar(v,-p,I),I),c===Pi.ROUNDED||c===Pi.BEVELED?xoe(R,G,I,c,te,r,f,d,Z+h,o):f=Dp(w,V,d,f,r,Z+h,K,U),P=m.clone(I,P)),C=m.negate(_,C)}else f=Dp(P,v,d,f,r,b+h,1,1),P=w;b=Z,Z=s[O+1],w=M}da[0]=m.clone(P,da[0]),da[1]=m.clone(w,da[1]),E=SH(da,b+h,Z+h,a),X=vi.generateArc({positions:da,granularity:a,ellipsoid:r}),f=VH(X,v,d,f,r,E,1),o&&(x=Dp(w,v,u,x,r,Z+h,1,1)),g=f.length;let F=o?g+x.length:g,N=new Float64Array(F);return N.set(f),o&&N.set(x,g),N};var Um=WE;var RH={},LC=new m,Voe=new m,jPe=new m,_oe=new m,Kc=[new m,new m],Loe=new m,Roe=new m,Zoe=new m,qPe=new m,$Pe=new m,eve=new m,tve=new m,nve=new m,ive=new m,ove=new m,Toe=new ve,Soe=new $;function v5(e,t,n,i,o){let r=m.angleBetween(m.subtract(t,e,LC),m.subtract(n,e,Voe)),s=i===Pi.BEVELED?1:Math.ceil(r/W.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let d;o?d=$.fromQuaternion(ve.fromAxisAngle(m.negate(e,LC),r/s,Toe),Soe):d=$.fromQuaternion(ve.fromAxisAngle(e,r/s,Toe),Soe);let u=0;t=m.clone(t,LC);for(let h=0;h<s;h++)t=$.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function rve(e){let t=Loe,n=Roe,i=Zoe,o=e[1];n=m.fromArray(e[1],o.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let r=v5(t,n,i,Pi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(o,0,i),t=m.midpoint(n,i,t);let c=v5(t,n,i,Pi.ROUNDED,!1);return[r,c]}function Coe(e,t,n,i){let o=LC;return i?o=m.add(e,t,o):(t=m.negate(t,t),o=m.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function LH(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=m.multiplyByScalar(t,n,LC),a=m.negate(s,Voe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let h=m.fromArray(e,u,jPe),p=m.add(h,a,_oe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=m.add(h,s,_oe);r[d--]=g.z,r[d--]=g.y,r[d--]=g.x}return i.push(o,r),i}RH.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var sve=new m,ave=new m;RH.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Loe,c=Roe,d=Zoe,u=qPe,h=$Pe,p=eve,g=tve,f=nve,x=ive,_=ove,C=[],V=s?[]:void 0,L=s?[]:void 0,R=n[0],G=n[1];c=m.normalize(m.subtract(G,R,c),c),a=i.geodeticSurfaceNormal(R,a),u=m.normalize(m.cross(a,c,u),u),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),g=m.clone(R,g),R=G,d=m.negate(c,d);let I,v=[],P,w=n.length;for(P=1;P<w-1;P++){a=i.geodeticSurfaceNormal(R,a),G=n[P+1],c=m.normalize(m.subtract(G,R,c),c);let b=m.multiplyByScalar(a,m.dot(c,a),sve);m.subtract(c,b,b),m.normalize(b,b);let Z=m.multiplyByScalar(a,m.dot(d,a),ave);if(m.subtract(d,Z,Z),m.normalize(Z,Z),!W.equalsEpsilon(Math.abs(m.dot(b,Z)),1,W.EPSILON7)){h=m.normalize(m.add(c,d,h),h),h=m.cross(h,a,h),h=m.cross(a,h,h),h=m.normalize(h,h);let X=o/Math.max(.25,m.magnitude(m.cross(h,d,LC))),F=Um.angleIsGreaterThanPi(c,d,R,i);h=m.multiplyByScalar(h,X,h),F?(f=m.add(R,h,f),_=m.add(f,m.multiplyByScalar(u,o,_),_),x=m.add(f,m.multiplyByScalar(u,o*2,x),x),Kc[0]=m.clone(g,Kc[0]),Kc[1]=m.clone(_,Kc[1]),I=vi.generateArc({positions:Kc,granularity:t,ellipsoid:i}),C=LH(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=m.clone(x,p),u=m.normalize(m.cross(a,c,u),u),x=m.add(f,m.multiplyByScalar(u,o*2,x),x),g=m.add(f,m.multiplyByScalar(u,o,g),g),r===Pi.ROUNDED||r===Pi.BEVELED?v.push({leftPositions:v5(f,p,x,r,F)}):v.push({leftPositions:Coe(R,m.negate(h,h),x,F)})):(x=m.add(R,h,x),_=m.add(x,m.negate(m.multiplyByScalar(u,o,_),_),_),f=m.add(x,m.negate(m.multiplyByScalar(u,o*2,f),f),f),Kc[0]=m.clone(g,Kc[0]),Kc[1]=m.clone(_,Kc[1]),I=vi.generateArc({positions:Kc,granularity:t,ellipsoid:i}),C=LH(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=m.clone(f,p),u=m.normalize(m.cross(a,c,u),u),f=m.add(x,m.negate(m.multiplyByScalar(u,o*2,f),f),f),g=m.add(x,m.negate(m.multiplyByScalar(u,o,g),g),g),r===Pi.ROUNDED||r===Pi.BEVELED?v.push({rightPositions:v5(x,p,f,r,F)}):v.push({rightPositions:Coe(R,h,f,F)})),d=m.negate(c,d)}R=G}a=i.geodeticSurfaceNormal(R,a),Kc[0]=m.clone(g,Kc[0]),Kc[1]=m.clone(R,Kc[1]),I=vi.generateArc({positions:Kc,granularity:t,ellipsoid:i}),C=LH(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z));let M;return r===Pi.ROUNDED&&(M=rve(C)),{positions:C,corners:v,lefts:V,normals:L,endPositions:M}};var ki=RH;var Ioe=new m,Xoe=new m,w5=new m,F5=new m,cve=new m,Woe=new m,ag=new m,RC=new m;function Poe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Dm(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=m.normalize(m.cross(n,t,ag),ag);r.normal&&ki.addAttribute(s,t,i,o),r.tangent&&ki.addAttribute(a,d,i,o),r.bitangent&&ki.addAttribute(c,n,i,o)}function voe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new mn,d,u=0,h=0,p,g=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,g+=f*2,h+=i[p+1].length-3;for(u+=3,h+=3,p=0;p<o.length;p++){d=o[p];let ee=o[p].leftPositions;l(ee)?(f=ee.length,u+=f,g+=f):(f=o[p].rightPositions.length,h+=f,g+=f)}let x=l(r),_;x&&(_=r[0].length-3,u+=_,h+=_,_/=3,g+=_*6);let C=u+h,V=new Float64Array(C),L=t.normal?new Float32Array(C):void 0,R=t.tangent?new Float32Array(C):void 0,G=t.bitangent?new Float32Array(C):void 0,I={normals:L,tangents:R,bitangents:G},v=0,P=C-1,w,M,b,Z,E=Ioe,X=Xoe,F,N,O=_/2,U=Ae.createTypedArray(C/3,g),Y=0;if(x){N=w5,F=F5;let ee=r[0];for(E=m.fromArray(a,0,E),X=m.fromArray(s,0,X),p=0;p<O;p++)N=m.fromArray(ee,(O-1-p)*3,N),F=m.fromArray(ee,(O+p)*3,F),ki.addAttribute(V,F,v),ki.addAttribute(V,N,void 0,P),Dm(I,E,X,v,P,t),M=v/3,Z=M+1,w=(P-2)/3,b=w-1,U[Y++]=w,U[Y++]=M,U[Y++]=b,U[Y++]=b,U[Y++]=M,U[Y++]=Z,v+=3,P-=3}let k=0,H=0,K=i[k++],te=i[k++];V.set(K,v),V.set(te,P-te.length+1),X=m.fromArray(s,H,X);let z,j;for(f=te.length-3,p=0;p<f;p+=3)z=n.geodeticSurfaceNormal(m.fromArray(K,p,ag),ag),j=n.geodeticSurfaceNormal(m.fromArray(te,f-p,RC),RC),E=m.normalize(m.add(z,j,E),E),Dm(I,E,X,v,P,t),M=v/3,Z=M+1,w=(P-2)/3,b=w-1,U[Y++]=w,U[Y++]=M,U[Y++]=b,U[Y++]=b,U[Y++]=M,U[Y++]=Z,v+=3,P-=3;for(z=n.geodeticSurfaceNormal(m.fromArray(K,f,ag),ag),j=n.geodeticSurfaceNormal(m.fromArray(te,f,RC),RC),E=m.normalize(m.add(z,j,E),E),H+=3,p=0;p<o.length;p++){let ee;d=o[p];let fe=d.leftPositions,Te=d.rightPositions,de,xe,Ce=Woe,Ie=w5,Le=F5;if(E=m.fromArray(a,H,E),l(fe)){for(Dm(I,E,X,void 0,P,t),P-=3,de=Z,xe=b,ee=0;ee<fe.length/3;ee++)Ce=m.fromArray(fe,ee*3,Ce),U[Y++]=de,U[Y++]=xe-ee-1,U[Y++]=xe-ee,ki.addAttribute(V,Ce,void 0,P),Ie=m.fromArray(V,(xe-ee-1)*3,Ie),Le=m.fromArray(V,de*3,Le),X=m.normalize(m.subtract(Ie,Le,X),X),Dm(I,E,X,void 0,P,t),P-=3;Ce=m.fromArray(V,de*3,Ce),Ie=m.subtract(m.fromArray(V,xe*3,Ie),Ce,Ie),Le=m.subtract(m.fromArray(V,(xe-ee)*3,Le),Ce,Le),X=m.normalize(m.add(Ie,Le,X),X),Dm(I,E,X,v,void 0,t),v+=3}else{for(Dm(I,E,X,v,void 0,t),v+=3,de=b,xe=Z,ee=0;ee<Te.length/3;ee++)Ce=m.fromArray(Te,ee*3,Ce),U[Y++]=de,U[Y++]=xe+ee,U[Y++]=xe+ee+1,ki.addAttribute(V,Ce,v),Ie=m.fromArray(V,de*3,Ie),Le=m.fromArray(V,(xe+ee)*3,Le),X=m.normalize(m.subtract(Ie,Le,X),X),Dm(I,E,X,v,void 0,t),v+=3;Ce=m.fromArray(V,de*3,Ce),Ie=m.subtract(m.fromArray(V,(xe+ee)*3,Ie),Ce,Ie),Le=m.subtract(m.fromArray(V,xe*3,Le),Ce,Le),X=m.normalize(m.negate(m.add(Le,Ie,X),X),X),Dm(I,E,X,void 0,P,t),P-=3}for(K=i[k++],te=i[k++],K.splice(0,3),te.splice(te.length-3,3),V.set(K,v),V.set(te,P-te.length+1),f=te.length-3,H+=3,X=m.fromArray(s,H,X),ee=0;ee<te.length;ee+=3)z=n.geodeticSurfaceNormal(m.fromArray(K,ee,ag),ag),j=n.geodeticSurfaceNormal(m.fromArray(te,f-ee,RC),RC),E=m.normalize(m.add(z,j,E),E),Dm(I,E,X,v,P,t),Z=v/3,M=Z-1,b=(P-2)/3,w=b+1,U[Y++]=w,U[Y++]=M,U[Y++]=b,U[Y++]=b,U[Y++]=M,U[Y++]=Z,v+=3,P-=3;v-=3,P+=3}if(E=m.fromArray(a,a.length-3,E),Dm(I,E,X,v,P,t),x){v+=3,P-=3,N=w5,F=F5;let ee=r[1];for(p=0;p<O;p++)N=m.fromArray(ee,(_-p-1)*3,N),F=m.fromArray(ee,p*3,F),ki.addAttribute(V,N,void 0,P),ki.addAttribute(V,F,v),Dm(I,E,X,v,P,t),Z=v/3,M=Z-1,b=(P-2)/3,w=b+1,U[Y++]=w,U[Y++]=M,U[Y++]=b,U[Y++]=b,U[Y++]=M,U[Y++]=Z,v+=3,P-=3}if(c.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let ee=new Float32Array(C/3*2),fe,Te,de=0;if(x){u/=3,h/=3;let xe=Math.PI/(_+1);Te=1/(u-_+1),fe=1/(h-_+1);let Ce,Ie=_/2;for(p=Ie+1;p<_+1;p++)Ce=W.PI_OVER_TWO+xe*p,ee[de++]=fe*(1+Math.cos(Ce)),ee[de++]=.5*(1+Math.sin(Ce));for(p=1;p<h-_+1;p++)ee[de++]=p*fe,ee[de++]=0;for(p=_;p>Ie;p--)Ce=W.PI_OVER_TWO-p*xe,ee[de++]=1-fe*(1+Math.cos(Ce)),ee[de++]=.5*(1+Math.sin(Ce));for(p=Ie;p>0;p--)Ce=W.PI_OVER_TWO-xe*p,ee[de++]=1-Te*(1+Math.cos(Ce)),ee[de++]=.5*(1+Math.sin(Ce));for(p=u-_;p>0;p--)ee[de++]=p*Te,ee[de++]=1;for(p=1;p<Ie+1;p++)Ce=W.PI_OVER_TWO+xe*p,ee[de++]=Te*(1+Math.cos(Ce)),ee[de++]=.5*(1+Math.sin(Ce))}else{for(u/=3,h/=3,Te=1/(u-1),fe=1/(h-1),p=0;p<h;p++)ee[de++]=p*fe,ee[de++]=0;for(p=u;p>0;p--)ee[de++]=(p-1)*Te,ee[de++]=1}c.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function lve(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Ioe,f=Xoe,x=w5,_=F5,C=cve,V=Woe,L=c;for(d=0;d<s;d+=3){let R=L+c;g=m.fromArray(n,d,g),f=m.fromArray(n,d+s,f),x=m.fromArray(n,(d+3)%s,x),f=m.subtract(f,g,f),x=m.subtract(x,g,x),_=m.normalize(m.cross(f,x,_),_),t.normal&&(ki.addAttribute(u,_,R),ki.addAttribute(u,_,R+3),ki.addAttribute(u,_,L),ki.addAttribute(u,_,L+3)),(t.tangent||t.bitangent)&&(V=m.fromArray(i,d,V),t.bitangent&&(ki.addAttribute(p,V,R),ki.addAttribute(p,V,R+3),ki.addAttribute(p,V,L),ki.addAttribute(p,V,L+3)),t.tangent&&(C=m.normalize(m.cross(V,_,C),C),ki.addAttribute(h,C,R),ki.addAttribute(h,C,R+3),ki.addAttribute(h,C,L),ki.addAttribute(h,C,L+3))),L+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let R=e.tangent.values;h.set(R),h.set(R,s),e.tangent.values=h}}if(t.st){let u=e.st.values,h=new Float32Array(a*6);h.set(u),h.set(u,a);let p=a*2;for(let g=0;g<2;g++){for(h[p++]=u[0],h[p++]=u[1],d=2;d<a;d+=2){let f=u[d],x=u[d+1];h[p++]=f,h[p++]=x,h[p++]=f,h[p++]=x}h[p++]=u[0],h[p++]=u[1]}e.st.values=h}return e}function ZH(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function dve(e,t){let n=new Xe({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=ki.computePositions(e),r=voe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,h=u.length,p=new Float64Array(h*6),g=new Float64Array(h);g.set(u);let f=new Float64Array(h*4);u=ii.scaleToGeodeticHeight(u,s,i),f=ZH(u,0,f),g=ii.scaleToGeodeticHeight(g,a,i),f=ZH(g,h*2,f),p.set(u),p.set(g,h),p.set(f,h*2),c.position.values=p,c=lve(c,t);let x,_=h/3;if(e.shadowVolume){let w=c.normal.values;h=w.length;let M=new Float32Array(h*6);for(x=0;x<h;x++)w[x]=-w[x];M.set(w,h),M=ZH(w,h*4,M),c.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:M}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let w=new Uint8Array(_*6);if(e.offsetAttribute===rn.TOP)w=w.fill(1,0,_).fill(1,_*2,_*4);else{let M=e.offsetAttribute===rn.NONE?0:1;w=w.fill(M)}c.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}let C=d.length,V=_+_,L=Ae.createTypedArray(p.length/3,C*2+V*3);L.set(d);let R=C;for(x=0;x<C;x+=3){let w=d[x],M=d[x+1],b=d[x+2];L[R++]=b+_,L[R++]=M+_,L[R++]=w+_}let G,I,v,P;for(x=0;x<V;x+=2)G=x+V,I=G+V,v=G+1,P=I+1,L[R++]=G,L[R++]=I,L[R++]=v,L[R++]=v,L[R++]=I,L[R++]=P;return{attributes:c,indices:L}}var Goe=new m,PE=new m,Xu=new he;function Eoe(e,t,n,i,o,r){let s=m.subtract(t,e,Goe);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,PE),c=m.cross(s,a,Goe);m.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,h=r.latitude,p=r.longitude;m.add(e,c,PE),n.cartesianToCartographic(PE,Xu);let g=Xu.latitude,f=Xu.longitude;d=Math.min(d,g),u=Math.min(u,f),h=Math.max(h,g),p=Math.max(p,f),m.subtract(e,c,PE),n.cartesianToCartographic(PE,Xu),g=Xu.latitude,f=Xu.longitude,d=Math.min(d,g),u=Math.min(u,f),h=Math.max(h,g),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=h,r.longitude=p}var Iu=new m,vE=new m,wl=new he,Fl=new he;function woe(e,t,n,i,o){e=Poe(e,t);let r=To(e,m.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ce;let a=n*.5;wl.latitude=Number.POSITIVE_INFINITY,wl.longitude=Number.POSITIVE_INFINITY,Fl.latitude=Number.NEGATIVE_INFINITY,Fl.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===Pi.ROUNDED){let p=r[0];m.subtract(p,r[1],Iu),m.normalize(Iu,Iu),m.multiplyByScalar(Iu,a,Iu),m.add(p,Iu,vE),t.cartesianToCartographic(vE,Xu),c=Xu.latitude,d=Xu.longitude,wl.latitude=Math.min(wl.latitude,c),wl.longitude=Math.min(wl.longitude,d),Fl.latitude=Math.max(Fl.latitude,c),Fl.longitude=Math.max(Fl.longitude,d)}for(let p=0;p<s-1;++p)Eoe(r[p],r[p+1],t,a,wl,Fl);let u=r[s-1];m.subtract(u,r[s-2],Iu),m.normalize(Iu,Iu),m.multiplyByScalar(Iu,a,Iu),m.add(u,Iu,vE),Eoe(u,vE,t,a,wl,Fl),i===Pi.ROUNDED&&(t.cartesianToCartographic(vE,Xu),c=Xu.latitude,d=Xu.longitude,wl.latitude=Math.min(wl.latitude,c),wl.longitude=Math.min(wl.longitude,d),Fl.latitude=Math.max(Fl.latitude,c),Fl.longitude=Math.max(Fl.longitude,d));let h=l(o)?o:new ce;return h.north=Fl.latitude,h.south=wl.latitude,h.east=Fl.longitude,h.west=wl.longitude,h}function Op(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._vertexFormat=Xe.clone(y(e.vertexFormat,Xe.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Pi.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+ne.packedLength+Xe.packedLength+7}Op.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Foe=ne.clone(ne.UNIT_SPHERE),Aoe=new Xe,Bp={positions:void 0,ellipsoid:Foe,vertexFormat:Aoe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Op.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=m.packedLength)o[f]=m.unpack(e,t);let r=ne.unpack(e,t,Foe);t+=ne.packedLength;let s=Xe.unpack(e,t,Aoe);t+=Xe.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._vertexFormat=Xe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Bp.positions=o,Bp.width=a,Bp.height=c,Bp.extrudedHeight=d,Bp.cornerType=u,Bp.granularity=h,Bp.shadowVolume=p,Bp.offsetAttribute=g===-1?void 0:g,new Op(Bp))};Op.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ne.default),r=y(e.cornerType,Pi.ROUNDED);return woe(n,o,i,r,t)};Op.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Poe(t,i);let o=To(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=dve(d,c);else{let g=ki.computePositions(d);if(u=voe(g,c,i),u.attributes.position.values=ii.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===rn.NONE?0:1,x=u.attributes.position.values.length,_=new Uint8Array(x/3).fill(f);u.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let h=u.attributes,p=le.fromVertices(h.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new lt({attributes:h,indices:u.indices,primitiveType:we.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Op.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Op({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Op.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=woe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Nx=Op;var E6t=T(S(),1);var Moe=new m,Noe=new m,uve=new m;function mve(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function koe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new mn,a,c=0,d=0,u,h=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,h+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){a=o[u];let F=o[u].leftPositions;l(F)?(p=F.length,c+=p,h+=p/3*2):(p=o[u].rightPositions.length,d+=p,h+=p/3*2)}let g=l(r),f;g&&(f=r[0].length-3,c+=f,d+=f,f/=3,h+=f*4);let x=c+d,_=new Float64Array(x),C=0,V=x-1,L,R,G,I,v,P,w=f/2,M=Ae.createTypedArray(x/3,h+4),b=0;if(M[b++]=C/3,M[b++]=(V-2)/3,g){n.push(C/3),P=Moe,v=Noe;let F=r[0];for(u=0;u<w;u++)P=m.fromArray(F,(w-1-u)*3,P),v=m.fromArray(F,(w+u)*3,v),ki.addAttribute(_,v,C),ki.addAttribute(_,P,void 0,V),R=C/3,I=R+1,L=(V-2)/3,G=L-1,M[b++]=L,M[b++]=G,M[b++]=R,M[b++]=I,C+=3,V-=3}let Z=0,E=i[Z++],X=i[Z++];for(_.set(E,C),_.set(X,V-X.length+1),p=X.length-3,n.push(C/3,(V-2)/3),u=0;u<p;u+=3)R=C/3,I=R+1,L=(V-2)/3,G=L-1,M[b++]=L,M[b++]=G,M[b++]=R,M[b++]=I,C+=3,V-=3;for(u=0;u<o.length;u++){let F;a=o[u];let N=a.leftPositions,O=a.rightPositions,U,Y=uve;if(l(N)){for(V-=3,U=G,n.push(I),F=0;F<N.length/3;F++)Y=m.fromArray(N,F*3,Y),M[b++]=U-F-1,M[b++]=U-F,ki.addAttribute(_,Y,void 0,V),V-=3;n.push(U-Math.floor(N.length/6)),t===Pi.BEVELED&&n.push((V-2)/3+1),C+=3}else{for(C+=3,U=I,n.push(G),F=0;F<O.length/3;F++)Y=m.fromArray(O,F*3,Y),M[b++]=U+F,M[b++]=U+F+1,ki.addAttribute(_,Y,C),C+=3;n.push(U+Math.floor(O.length/6)),t===Pi.BEVELED&&n.push(C/3-1),V-=3}for(E=i[Z++],X=i[Z++],E.splice(0,3),X.splice(X.length-3,3),_.set(E,C),_.set(X,V-X.length+1),p=X.length-3,F=0;F<X.length;F+=3)I=C/3,R=I-1,G=(V-2)/3,L=G+1,M[b++]=L,M[b++]=G,M[b++]=R,M[b++]=I,C+=3,V-=3;C-=3,V+=3,n.push(C/3,(V-2)/3)}if(g){C+=3,V-=3,P=Moe,v=Noe;let F=r[1];for(u=0;u<w;u++)P=m.fromArray(F,(f-u-1)*3,P),v=m.fromArray(F,u*3,v),ki.addAttribute(_,P,void 0,V),ki.addAttribute(_,v,C),I=C/3,R=I-1,G=(V-2)/3,L=G+1,M[b++]=L,M[b++]=G,M[b++]=R,M[b++]=I,C+=3,V-=3;n.push(C/3)}else n.push(C/3,(V-2)/3);return M[b++]=C/3,M[b++]=(V-2)/3,s.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:s,indices:M,wallIndices:n}}function hve(e){let t=e.ellipsoid,n=ki.computePositions(e),i=koe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,d=a.position.values,u=d.length,h=new Float64Array(u);h.set(d);let p=new Float64Array(u*2);if(d=ii.scaleToGeodeticHeight(d,r,t),h=ii.scaleToGeodeticHeight(h,s,t),p.set(d),p.set(h,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let L=new Uint8Array(u*2);if(e.offsetAttribute===rn.TOP)L=L.fill(1,0,u);else{let R=e.offsetAttribute===rn.NONE?0:1;L=L.fill(R)}a.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let g,f=c.length,x=Ae.createTypedArray(p.length/3,(f+o.length)*2);x.set(c);let _=f;for(g=0;g<f;g+=2){let L=c[g],R=c[g+1];x[_++]=L+u,x[_++]=R+u}let C,V;for(g=0;g<o.length;g++)C=o[g],V=C+u,x[_++]=C,x[_++]=V;return{attributes:a,indices:x}}function wE(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Pi.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+ne.packedLength+6}wE.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var Uoe=ne.clone(ne.UNIT_SPHERE),cg={positions:void 0,ellipsoid:Uoe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};wE.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)o[p]=m.unpack(e,t);let r=ne.unpack(e,t,Uoe);t+=ne.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=d,n._granularity=u,n._offsetAttribute=h===-1?void 0:h,n):(cg.positions=o,cg.width=s,cg.height=a,cg.extrudedHeight=c,cg.cornerType=d,cg.granularity=u,cg.offsetAttribute=h===-1?void 0:h,new wE(cg))};wE.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=mve(t,i);let o=To(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,d=hve(c);else{let p=ki.computePositions(c);if(d=koe(p,c.cornerType),d.attributes.position.values=ii.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let g=d.attributes.position.values.length,f=e._offsetAttribute===rn.NONE?0:1,x=new Uint8Array(g/3).fill(f);d.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let u=d.attributes,h=le.fromVertices(u.position.values,void 0,3);return new lt({attributes:u,indices:d.indices,primitiveType:we.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var FE=wE;var N6t=T(S(),1);function ZC(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Hi({ellipsoid:y(e.ellipsoid,ne.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this._credit=n}Object.defineProperties(ZC.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});ZC.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Xa({buffer:c,width:r,height:s})})};ZC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ZC.prototype.getTileDataAvailable=function(e,t,n){};ZC.prototype.loadTileDataAvailability=function(e,t,n){};var GH=ZC;var rqt=T(S(),1);var D6t=T(S(),1);var Doe={};Doe.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,h=0,p=0,g=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let x=u/i*W.TWO_PI,_=Math.cos(x),C=Math.sin(x),V=_*n,L=C*n,R=_*t,G=C*t;d[p+g]=V,d[p+g+1]=L,d[p+g+2]=s,d[p+f]=R,d[p+f+1]=G,d[p+f+2]=r,p+=3,o&&(d[h++]=V,d[h++]=L,d[h++]=s,d[h++]=R,d[h++]=G,d[h++]=r)}return d};var kx=Doe;var EH=new D,fve=new m,pve=new m,bve=new m,gve=new m;function Yp(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Xe.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Xe.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Yp.packedLength=Xe.packedLength+5;Yp.pack=function(e,t,n){return n=y(n,0),Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var Boe=new Xe,GC={vertexFormat:Boe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Yp.unpack=function(e,t,n){t=y(t,0);let i=Xe.unpack(e,t,Boe);t+=Xe.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Xe.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(GC.length=o,GC.topRadius=r,GC.bottomRadius=s,GC.slices=a,GC.offsetAttribute=c===-1?void 0:c,new Yp(GC))};Yp.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,d=kx.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,f,x=o.normal||o.tangent||o.bitangent;if(x){let v=o.tangent||o.bitangent,P=0,w=0,M=0,b=Math.atan2(i-n,t),Z=fve;Z.z=Math.sin(b);let E=Math.cos(b),X=bve,F=pve;for(f=0;f<r;f++){let N=f/r*W.TWO_PI,O=E*Math.cos(N),U=E*Math.sin(N);x&&(Z.x=O,Z.y=U,v&&(X=m.normalize(m.cross(m.UNIT_Z,Z,X),X)),o.normal&&(h[P++]=Z.x,h[P++]=Z.y,h[P++]=Z.z,h[P++]=Z.x,h[P++]=Z.y,h[P++]=Z.z),o.tangent&&(p[w++]=X.x,p[w++]=X.y,p[w++]=X.z,p[w++]=X.x,p[w++]=X.y,p[w++]=X.z),o.bitangent&&(F=m.normalize(m.cross(Z,X,F),F),g[M++]=F.x,g[M++]=F.y,g[M++]=F.z,g[M++]=F.x,g[M++]=F.y,g[M++]=F.z))}for(f=0;f<r;f++)o.normal&&(h[P++]=0,h[P++]=0,h[P++]=-1),o.tangent&&(p[w++]=1,p[w++]=0,p[w++]=0),o.bitangent&&(g[M++]=0,g[M++]=-1,g[M++]=0);for(f=0;f<r;f++)o.normal&&(h[P++]=0,h[P++]=0,h[P++]=1),o.tangent&&(p[w++]=1,p[w++]=0,p[w++]=0),o.bitangent&&(g[M++]=0,g[M++]=1,g[M++]=0)}let _=12*r-12,C=Ae.createTypedArray(c,_),V=0,L=0;for(f=0;f<r-1;f++)C[V++]=L,C[V++]=L+2,C[V++]=L+3,C[V++]=L,C[V++]=L+3,C[V++]=L+1,L+=2;for(C[V++]=s-2,C[V++]=0,C[V++]=1,C[V++]=s-2,C[V++]=1,C[V++]=s-1,f=1;f<r-1;f++)C[V++]=s+f+1,C[V++]=s+f,C[V++]=s;for(f=1;f<r-1;f++)C[V++]=a,C[V++]=a+f,C[V++]=a+f+1;let R=0;if(o.st){let v=Math.max(n,i);for(f=0;f<c;f++){let P=m.fromArray(d,f*3,gve);u[R++]=(P.x+v)/(2*v),u[R++]=(P.y+v)/(2*v)}}let G=new mn;o.position&&(G.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(G.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(G.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(G.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(G.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),EH.x=t*.5,EH.y=Math.max(i,n);let I=new le(m.ZERO,D.magnitude(EH));if(l(e._offsetAttribute)){t=d.length;let v=e._offsetAttribute===rn.NONE?0:1,P=new Uint8Array(t/3).fill(v);G.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new lt({attributes:G,indices:C,primitiveType:we.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var IH;Yp.getUnitCylinder=function(){return l(IH)||(IH=Yp.createGeometry(new Yp({topRadius:1,bottomRadius:1,length:1,vertexFormat:Xe.POSITION_ONLY}))),IH};var AE=Yp;var _qt=T(S(),1);var XH=new D;function EC(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}EC.packedLength=6;EC.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Ux={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};EC.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Ux.length=i,Ux.topRadius=o,Ux.bottomRadius=r,Ux.slices=s,Ux.numberOfVerticalLines=a,Ux.offsetAttribute=c===-1?void 0:c,new EC(Ux))};EC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=kx.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let x=Math.min(r,o);d=Math.round(o/x),c+=x}let u=Ae.createTypedArray(s,c*2),h=0,p;for(p=0;p<o-1;p++)u[h++]=p,u[h++]=p+1,u[h++]=p+o,u[h++]=p+1+o;if(u[h++]=o-1,u[h++]=0,u[h++]=o+o-1,u[h++]=o,r>0)for(p=0;p<o;p+=d)u[h++]=p,u[h++]=p+o;let g=new mn;g.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:a}),XH.x=t*.5,XH.y=Math.max(i,n);let f=new le(m.ZERO,D.magnitude(XH));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===rn.NONE?0:1,_=new Uint8Array(t/3).fill(x);g.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new lt({attributes:g,indices:u,primitiveType:we.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var ME=EC;var Sqt=T(S(),1);function Ooe(e){this.proxy=e}Ooe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var WH=Ooe;var Rqt=T(S(),1);function yd(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(yd.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});yd.packedLength=2;yd.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};yd.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new yd),n.near=e[t++],n.far=e[t],n};yd.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};yd.clone=function(e,t){if(l(e))return l(t)||(t=new yd),t.near=e.near,t.far=e.far,t};yd.prototype.clone=function(e){return yd.clone(this,e)};yd.prototype.equals=function(e){return yd.equals(this,e)};var wt=yd;var Xqt=T(S(),1);function NE(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(NE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});NE.fromDistanceDisplayCondition=function(e){return new NE(e.near,e.far)};NE.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Un=NE;var wqt=T(S(),1);function Bm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Bm.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Bm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Bm({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Bm.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Bm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Yoe(this,t)};Bm.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Yoe(this,i),t};Bm.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],Hoe(this,0)),this._array[e-1]=void 0,t};Bm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=PH(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Hoe(this,n)}return this._array[e-1]=void 0,t};Bm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Bm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[PH(this,1,2)?1:2]};function A5(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function kE(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function PH(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Yoe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=kE(e,t,i);for(o!==n&&(A5(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(kE(e,t,r)!==o)break;A5(e,t,r),t=r}}function Hoe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){kE(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;kE(e,u,r)===i&&(r=u)}}if(kE(e,r,t)===i&&(A5(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);PH(e,r,a)===i&&A5(e,r,a)}t=r}}var Dx=Bm;var Mqt=T(S(),1);function UE(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(UE.prototype,{length:{get:function(){return this._length}}});function yve(e,t,n){this.item=e,this.previous=t,this.next=n}UE.prototype.add=function(e){let t=new yve(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function zoe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}UE.prototype.remove=function(e){l(e)&&(zoe(this,e),--this._length)};UE.prototype.splice=function(e,t){if(e===t)return;zoe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var DE=UE;var Jqt=T(S(),1);var Hqt=T(S(),1),wi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-wi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?wi.Bounce.In(e*2)*.5:wi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),BE=function(){return performance.now()},xve=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=BE()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),IC={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=IC.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=IC.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=IC.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=IC.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},Koe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),vH=new xve,Joe=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=wi.Linear.None,this._interpolationFunction=IC.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Koe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=vH,vH.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=BE()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,f=h.length;g<f;g+=1){var x=this._handleRelativeValue(a,h[g]);if(isNaN(x)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var C in _)n[s][C]=_[C];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var V={};for(var C in h)V[C]=h[C];i[s]=h=V}this._setupProperties(_,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=BE()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=BE()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=wi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=IC.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=BE()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),_=s-x*a,C=Math.min(_/i._duration,1);return C===0&&s===i._duration?1:C},u=d(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;g<f;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Nqt=Koe.nextId,_f=vH,kqt=_f.getAll.bind(_f),Uqt=_f.removeAll.bind(_f),Dqt=_f.add.bind(_f),Bqt=_f.remove.bind(_f),Oqt=_f.update.bind(_f);var _ve={LINEAR_NONE:wi.Linear.None,QUADRATIC_IN:wi.Quadratic.In,QUADRATIC_OUT:wi.Quadratic.Out,QUADRATIC_IN_OUT:wi.Quadratic.InOut,CUBIC_IN:wi.Cubic.In,CUBIC_OUT:wi.Cubic.Out,CUBIC_IN_OUT:wi.Cubic.InOut,QUARTIC_IN:wi.Quartic.In,QUARTIC_OUT:wi.Quartic.Out,QUARTIC_IN_OUT:wi.Quartic.InOut,QUINTIC_IN:wi.Quintic.In,QUINTIC_OUT:wi.Quintic.Out,QUINTIC_IN_OUT:wi.Quintic.InOut,SINUSOIDAL_IN:wi.Sinusoidal.In,SINUSOIDAL_OUT:wi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:wi.Sinusoidal.InOut,EXPONENTIAL_IN:wi.Exponential.In,EXPONENTIAL_OUT:wi.Exponential.Out,EXPONENTIAL_IN_OUT:wi.Exponential.InOut,CIRCULAR_IN:wi.Circular.In,CIRCULAR_OUT:wi.Circular.Out,CIRCULAR_IN_OUT:wi.Circular.InOut,ELASTIC_IN:wi.Elastic.In,ELASTIC_OUT:wi.Elastic.Out,ELASTIC_IN_OUT:wi.Elastic.InOut,BACK_IN:wi.Back.In,BACK_OUT:wi.Back.Out,BACK_IN_OUT:wi.Back.InOut,BOUNCE_IN:wi.Bounce.In,BOUNCE_OUT:wi.Bounce.Out,BOUNCE_IN_OUT:wi.Bounce.InOut},Fr=Object.freeze(_ve);var m$t=T(S(),1);var Tve=new m,Sve=new m,Cve=new m,Vve=new m,Lve=new m,Rve=new m(1,1,1),Qoe=Math.cos,joe=Math.sin;function Hp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,Rve),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,W.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,W.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),d=y(e.vertexFormat,Xe.DEFAULT);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Xe.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Hp.packedLength=2*m.packedLength+Xe.packedLength+7;Hp.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var qoe=new m,$oe=new m,ere=new Xe,lg={radii:qoe,innerRadii:$oe,vertexFormat:ere,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Hp.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,qoe);t+=m.packedLength;let o=m.unpack(e,t,$oe);t+=m.packedLength;let r=Xe.unpack(e,t,ere);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(lg.minimumClock=s,lg.maximumClock=a,lg.minimumCone=c,lg.maximumCone=d,lg.stackPartitions=u,lg.slicePartitions=h,lg.offsetAttribute=p===-1?void 0:p,new Hp(lg))};Hp.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/W.TWO_PI),d=Math.round(d*Math.abs(s-r)/W.PI),c<2&&(c=2),d<2&&(d=2);let u,h,p=0,g=[r],f=[i];for(u=0;u<d;u++)g.push(r+u*(s-r)/(d-1));for(g.push(s),h=0;h<c;h++)f.push(i+h*(o-i)/(c-1));f.push(o);let x=g.length,_=f.length,C=0,V=1,L=n.x!==t.x||n.y!==t.y||n.z!==t.z,R=!1,G=!1,I=!1;L&&(V=2,r>0&&(R=!0,C+=c-1),s<Math.PI&&(G=!0,C+=c-1),(o-i)%W.TWO_PI?(I=!0,C+=(d-1)*2+1):C+=1);let v=_*x*V,P=new Float64Array(v*3),w=new Array(v).fill(!1),M=new Array(v).fill(!1),b=c*d*V,Z=6*(b+C+1-(c+d)*V),E=Ae.createTypedArray(b,Z),X=a.normal?new Float32Array(v*3):void 0,F=a.tangent?new Float32Array(v*3):void 0,N=a.bitangent?new Float32Array(v*3):void 0,O=a.st?new Float32Array(v*2):void 0,U=new Array(x),Y=new Array(x);for(u=0;u<x;u++)U[u]=joe(g[u]),Y[u]=Qoe(g[u]);let k=new Array(_),H=new Array(_);for(h=0;h<_;h++)H[h]=Qoe(f[h]),k[h]=joe(f[h]);for(u=0;u<x;u++)for(h=0;h<_;h++)P[p++]=t.x*U[u]*H[h],P[p++]=t.y*U[u]*k[h],P[p++]=t.z*Y[u];let K=v/2;if(L)for(u=0;u<x;u++)for(h=0;h<_;h++)P[p++]=n.x*U[u]*H[h],P[p++]=n.y*U[u]*k[h],P[p++]=n.z*Y[u],w[K]=!0,u>0&&u!==x-1&&h!==0&&h!==_-1&&(M[K]=!0),K++;p=0;let te,z;for(u=1;u<x-2;u++)for(te=u*_,z=(u+1)*_,h=1;h<_-2;h++)E[p++]=z+h,E[p++]=z+h+1,E[p++]=te+h+1,E[p++]=z+h,E[p++]=te+h+1,E[p++]=te+h;if(L){let qe=x*_;for(u=1;u<x-2;u++)for(te=qe+u*_,z=qe+(u+1)*_,h=1;h<_-2;h++)E[p++]=z+h,E[p++]=te+h,E[p++]=te+h+1,E[p++]=z+h,E[p++]=te+h+1,E[p++]=z+h+1}let j,ee;if(L){if(R)for(ee=x*_,u=1;u<_-2;u++)E[p++]=u,E[p++]=u+1,E[p++]=ee+u+1,E[p++]=u,E[p++]=ee+u+1,E[p++]=ee+u;if(G)for(j=x*_-_,ee=x*_*V-_,u=1;u<_-2;u++)E[p++]=j+u+1,E[p++]=j+u,E[p++]=ee+u,E[p++]=j+u+1,E[p++]=ee+u,E[p++]=ee+u+1}if(I){for(u=1;u<x-2;u++)ee=_*x+_*u,j=_*u,E[p++]=ee,E[p++]=j+_,E[p++]=j,E[p++]=ee,E[p++]=ee+_,E[p++]=j+_;for(u=1;u<x-2;u++)ee=_*x+_*(u+1)-1,j=_*(u+1)-1,E[p++]=j+_,E[p++]=ee,E[p++]=j,E[p++]=j+_,E[p++]=ee+_,E[p++]=ee}let fe=new mn;a.position&&(fe.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:P}));let Te=0,de=0,xe=0,Ce=0,Ie=v/2,Le,Ne=ne.fromCartesian3(t),Oe=ne.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<v;u++){Le=w[u]?Oe:Ne;let qe=m.fromArray(P,u*3,Tve),Rt=Le.geodeticSurfaceNormal(qe,Sve);if(M[u]&&m.negate(Rt,Rt),a.st){let Lt=D.negate(Rt,Lve);O[Te++]=Math.atan2(Lt.y,Lt.x)/W.TWO_PI+.5,O[Te++]=Math.asin(Rt.z)/Math.PI+.5}if(a.normal&&(X[de++]=Rt.x,X[de++]=Rt.y,X[de++]=Rt.z),a.tangent||a.bitangent){let Lt=Cve,ke=0,zt;if(w[u]&&(ke=Ie),!R&&u>=ke&&u<ke+_*2?zt=m.UNIT_X:zt=m.UNIT_Z,m.cross(zt,Rt,Lt),m.normalize(Lt,Lt),a.tangent&&(F[xe++]=Lt.x,F[xe++]=Lt.y,F[xe++]=Lt.z),a.bitangent){let ut=m.cross(Rt,Lt,Vve);m.normalize(ut,ut),N[Ce++]=ut.x,N[Ce++]=ut.y,N[Ce++]=ut.z}}}a.st&&(fe.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:O})),a.normal&&(fe.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X})),a.tangent&&(fe.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:F})),a.bitangent&&(fe.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:N}))}if(l(e._offsetAttribute)){let qe=P.length,Rt=e._offsetAttribute===rn.NONE?0:1,Lt=new Uint8Array(qe/3).fill(Rt);fe.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Lt})}return new lt({attributes:fe,indices:E,primitiveType:we.TRIANGLES,boundingSphere:le.fromEllipsoid(Ne),offsetAttribute:e._offsetAttribute})};var wH;Hp.getUnitEllipsoid=function(){return l(wH)||(wH=Hp.createGeometry(new Hp({radii:new m(1,1,1),vertexFormat:Xe.POSITION_ONLY}))),wH};var Us=Hp;var Z$t=T(S(),1);var Zve=new m(1,1,1),M5=Math.cos,N5=Math.sin;function XC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,Zve),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,W.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,W.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),d=Math.round(y(e.subdivisions,128));this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}XC.packedLength=2*m.packedLength+8;XC.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var tre=new m,nre=new m,zp={radii:tre,innerRadii:nre,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};XC.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,tre);t+=m.packedLength;let o=m.unpack(e,t,nre);t+=m.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(zp.minimumClock=r,zp.maximumClock=s,zp.minimumCone=a,zp.maximumCone=c,zp.stackPartitions=d,zp.slicePartitions=u,zp.subdivisions=h,zp.offsetAttribute=p===-1?void 0:p,new XC(zp))};XC.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ne.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/W.TWO_PI),u=Math.round(u*Math.abs(s-r)/W.PI),d<2&&(d=2),u<2&&(u=2);let h=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,x=!1;g&&(p=2,r>0&&(f=!0,h+=d),s<Math.PI&&(x=!0,h+=d));let _=a*p*(u+d),C=new Float64Array(_*3),V=2*(_+h-(d+u)*p),L=Ae.createTypedArray(_,V),R,G,I,v,P=0,w=new Array(u),M=new Array(u);for(R=0;R<u;R++)v=r+R*(s-r)/(u-1),w[R]=N5(v),M[R]=M5(v);let b=new Array(a),Z=new Array(a);for(R=0;R<a;R++)I=i+R*(o-i)/(a-1),b[R]=N5(I),Z[R]=M5(I);for(R=0;R<u;R++)for(G=0;G<a;G++)C[P++]=t.x*w[R]*Z[G],C[P++]=t.y*w[R]*b[G],C[P++]=t.z*M[R];if(g)for(R=0;R<u;R++)for(G=0;G<a;G++)C[P++]=n.x*w[R]*Z[G],C[P++]=n.y*w[R]*b[G],C[P++]=n.z*M[R];for(w.length=a,M.length=a,R=0;R<a;R++)v=r+R*(s-r)/(a-1),w[R]=N5(v),M[R]=M5(v);for(b.length=d,Z.length=d,R=0;R<d;R++)I=i+R*(o-i)/(d-1),b[R]=N5(I),Z[R]=M5(I);for(R=0;R<a;R++)for(G=0;G<d;G++)C[P++]=t.x*w[R]*Z[G],C[P++]=t.y*w[R]*b[G],C[P++]=t.z*M[R];if(g)for(R=0;R<a;R++)for(G=0;G<d;G++)C[P++]=n.x*w[R]*Z[G],C[P++]=n.y*w[R]*b[G],C[P++]=n.z*M[R];for(P=0,R=0;R<u*p;R++){let F=R*a;for(G=0;G<a-1;G++)L[P++]=F+G,L[P++]=F+G+1}let E=u*a*p;for(R=0;R<d;R++)for(G=0;G<a-1;G++)L[P++]=E+R+G*d,L[P++]=E+R+(G+1)*d;if(g)for(E=u*a*p+d*a,R=0;R<d;R++)for(G=0;G<a-1;G++)L[P++]=E+R+G*d,L[P++]=E+R+(G+1)*d;if(g){let F=u*a*p,N=F+a*d;if(f)for(R=0;R<d;R++)L[P++]=F+R,L[P++]=N+R;if(x)for(F+=a*d-d,N+=a*d-d,R=0;R<d;R++)L[P++]=F+R,L[P++]=N+R}let X=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let F=C.length,N=e._offsetAttribute===rn.NONE?0:1,O=new Uint8Array(F/3).fill(N);X.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new lt({attributes:X,indices:L,primitiveType:we.LINES,boundingSphere:le.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var xd=XC;var F$t=T(S(),1);function WC(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Hi({ellipsoid:y(e.ellipsoid,ne.default)})),this._levelZeroMaximumGeometricError=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(WC.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});WC.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Xa({buffer:new Uint8Array(16*16),width:16,height:16}))};WC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};WC.prototype.getTileDataAvailable=function(e,t,n){};WC.prototype.loadTileDataAvailability=function(e,t,n){};var Tf=WC;var M$t=T(S(),1);function FH(){this._removalFunctions=[]}FH.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};FH.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var ar=FH;var k$t=T(S(),1),Gve={NONE:0,HOLD:1,EXTRAPOLATE:2},_d=Object.freeze(Gve);var xen=T(S(),1);var ten=T(S(),1);var J$t=T(S(),1);function Sf(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new hs,this._perspectiveMatrix=new A,this._infinitePerspective=new A}function AH(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=A.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=A.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Sf.prototype,{projectionMatrix:{get:function(){return AH(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return AH(this),this._infinitePerspective}}});var Eve=new m,Ive=new m,Xve=new m,Wve=new m;Sf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,Eve),h=Ive;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=Xve;m.multiplyByScalar(t,d,p),m.add(e,p,p);let g=Wve;m.multiplyByScalar(u,a,g),m.add(h,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(u,s,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),f=i[1],l(f)||(f=i[1]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(u,g,g),m.normalize(g,g),f=i[2],l(f)||(f=i[2]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(g,u,g),m.normalize(g,g),f=i[3],l(f)||(f=i[3]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),f=i[4],l(f)||(f=i[4]=new se),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-m.dot(t,h),m.negate(t,g),f=i[5],l(f)||(f=i[5]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,p),this._cullingVolume};Sf.prototype.getPixelDimensions=function(e,t,n,i,o){AH(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Sf.prototype.clone=function(e){return l(e)||(e=new Sf),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Sf.prototype.equals=function(e){return l(e)&&e instanceof Sf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Sf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Sf&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var Jc=Sf;function Al(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Jc,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Al.packedLength=6;Al.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Al.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Al),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Om(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Al.prototype,{projectionMatrix:{get:function(){return Om(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Om(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Om(this),this._fovy}},sseDenominator:{get:function(){return Om(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Om(this),this._offCenterFrustum}}});Al.prototype.computeCullingVolume=function(e,t,n){return Om(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Al.prototype.getPixelDimensions=function(e,t,n,i,o){return Om(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Al.prototype.clone=function(e){return l(e)||(e=new Al),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Al.prototype.equals=function(e){return!l(e)||!(e instanceof Al)?!1:(Om(this),Om(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Al.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Al)?!1:(Om(this),Om(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Vi=Al;var k5=0,Pve=1;function Bx(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Xe.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Vi?(s=k5,a=Vi.packedLength):t instanceof an&&(s=Pve,a=an.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=ve.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+ve.packedLength+Xe.packedLength}Bx.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===k5?(Vi.pack(o,t,n),n+=Vi.packedLength):(an.pack(o,t,n),n+=an.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,ve.pack(e._orientation,t,n),n+=ve.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n]=e._drawNearPlane?1:0,t};var vve=new Vi,wve=new an,Fve=new ve,Ave=new m,Mve=new Xe;Bx.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===k5?(o=Vi.unpack(e,t,vve),t+=Vi.packedLength):(o=an.unpack(e,t,wve),t+=an.packedLength);let r=m.unpack(e,t,Ave);t+=m.packedLength;let s=ve.unpack(e,t,Fve);t+=ve.packedLength;let a=Xe.unpack(e,t,Mve);t+=Xe.packedLength;let c=e[t]===1;if(!l(n))return new Bx({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=ve.clone(s,n._orientation),n._vertexFormat=Xe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function PC(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Nve=new $,kve=new A,MH=new A,ire=new m,ore=new m,rre=new m,Uve=new m,Dve=new m,Bve=new m,dg=new Array(3),OE=new Array(4);OE[0]=new se(-1,-1,1,1);OE[1]=new se(1,-1,1,1);OE[2]=new se(1,1,1,1);OE[3]=new se(-1,1,1,1);var sre=new Array(4);for(let e=0;e<4;++e)sre[e]=new se;Bx._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,Nve),d=y(r,ire),u=y(s,ore),h=y(a,rre);d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),h=$.getColumn(c,2,h),m.normalize(d,d),m.normalize(u,u),m.normalize(h,h),m.negate(d,d);let p=A.computeView(e,h,u,d,kve),g,f,x=i.projectionMatrix;if(n===k5){let _=A.multiply(x,p,MH);f=A.inverse(_,MH)}else g=A.inverseTransformation(p,MH);l(f)?(dg[0]=i.near,dg[1]=i.far):(dg[0]=0,dg[1]=i.near,dg[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(OE[C],sre[C]);if(l(f)){V=A.multiplyByVector(f,V,V);let L=1/V.w;m.multiplyByScalar(V,L,V),m.subtract(V,e,V),m.normalize(V,V);let R=m.dot(h,V);m.multiplyByScalar(V,dg[_]/R,V),m.add(V,e,V)}else{let L=i.offCenterFrustum;l(L)&&(i=L);let R=dg[_],G=dg[_+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(R-G)-R-G)*.5,V.w=1,A.multiplyByVector(g,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};Bx.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);Bx._computeNearFarPlanes(i,o,t,n,c);let d=3*4*2;c[d]=c[3*4],c[d+1]=c[3*4+1],c[d+2]=c[3*4+2],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[3*3],c[d+7]=c[3*3+1],c[d+8]=c[3*3+2],c[d+9]=c[3*7],c[d+10]=c[3*7+1],c[d+11]=c[3*7+2],d+=3*4,c[d]=c[3*5],c[d+1]=c[3*5+1],c[d+2]=c[3*5+2],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[3*4],c[d+10]=c[3*4+1],c[d+11]=c[3*4+2],d+=3*4,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[3*5],c[d+4]=c[3*5+1],c[d+5]=c[3*5+2],c[d+6]=c[3*6],c[d+7]=c[3*6+1],c[d+8]=c[3*6+2],c[d+9]=c[3*2],c[d+10]=c[3*2+1],c[d+11]=c[3*2+2],d+=3*4,c[d]=c[3*2],c[d+1]=c[3*2+1],c[d+2]=c[3*2+2],c[d+3]=c[3*6],c[d+4]=c[3*6+1],c[d+5]=c[3*6+2],c[d+6]=c[3*7],c[d+7]=c[3*7+1],c[d+8]=c[3*7+2],c[d+9]=c[3*3],c[d+10]=c[3*3+1],c[d+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,f=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,_=ire,C=ore,V=rre,L=m.negate(_,Uve),R=m.negate(C,Dve),G=m.negate(V,Bve);d=0,r&&(PC(d,p,g,f,x,G,_,C),d+=3*4),PC(d,p,g,f,x,V,L,C),d+=3*4,PC(d,p,g,f,x,L,G,C),d+=3*4,PC(d,p,g,f,x,R,G,L),d+=3*4,PC(d,p,g,f,x,_,V,C),d+=3*4,PC(d,p,g,f,x,C,V,L),l(p)&&(u.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),l(f)&&(u.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),l(x)&&(u.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:x}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,f=p*4;h[g]=f,h[g+1]=f+1,h[g+2]=f+2,h[g+3]=f,h[g+4]=f+2,h[g+5]=f+3}return new lt({attributes:u,indices:h,primitiveType:we.TRIANGLES,boundingSphere:le.fromVertices(c)})};var Ox=Bx;var ven=T(S(),1);var NH=0,Ove=1;function YE(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Vi?(r=NH,s=Vi.packedLength):t instanceof an&&(r=Ove,s=an.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=ve.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+ve.packedLength}YE.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===NH?(Vi.pack(o,t,n),n+=Vi.packedLength):(an.pack(o,t,n),n+=an.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,ve.pack(e._orientation,t,n),n+=ve.packedLength,t[n]=e._drawNearPlane?1:0,t};var Yve=new Vi,Hve=new an,zve=new ve,Kve=new m;YE.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===NH?(o=Vi.unpack(e,t,Yve),t+=Vi.packedLength):(o=an.unpack(e,t,Hve),t+=an.packedLength);let r=m.unpack(e,t,Kve);t+=m.packedLength;let s=ve.unpack(e,t,zve);t+=ve.packedLength;let a=e[t]===1;if(!l(n))return new YE({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=ve.clone(s,n._orientation),n._drawNearPlane=a,n};YE.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);Ox._computeNearFarPlanes(i,o,t,n,s);let a=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,h=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,h[c]=d,h[c+1]=d+1,h[c+2]=d+1,h[c+3]=d+2,h[c+4]=d+2,h[c+5]=d+3,h[c+6]=d+3,h[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,h[c]=d,h[c+1]=d+4,h[c+2]=d+1,h[c+3]=d+5,h[c+4]=d+2,h[c+5]=d+6,h[c+6]=d+3,h[c+7]=d+7;return new lt({attributes:a,indices:h,primitiveType:we.LINES,boundingSphere:le.fromVertices(s)})};var HE=YE;var Fen=T(S(),1),Jve={SEARCH:0,AUTOCOMPLETE:1},ug=Object.freeze(Jve);var Uen=T(S(),1);function U5(){pe.throwInstantiationError()}Object.defineProperties(U5.prototype,{credit:{get:pe.throwInstantiationError}});U5.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Ct.getIonCredit)};U5.prototype.geocode=pe.throwInstantiationError;var vC=U5;var Oen=T(S(),1);function are(){pe.throwInstantiationError()}are.createGeometry=function(e){pe.throwInstantiationError()};var kH=are;var zen=T(S(),1);function Qve(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var cc=Qve;var ftn=T(S(),1),nwe=T(UH(),1);var etn=T(S(),1);var Qen=T(S(),1);function jve(e,t){return(e&t)!==0}var lc=jve;var qve=[1,2,4,8],cre=15,$ve=16,ewe=64,twe=128;function Cf(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}Cf.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Cf(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Cf.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Cf.prototype.hasSubtree=function(){return lc(this._bits,$ve)};Cf.prototype.hasImagery=function(){return lc(this._bits,ewe)};Cf.prototype.hasTerrain=function(){return lc(this._bits,twe)};Cf.prototype.hasChildren=function(){return lc(this._bits,cre)};Cf.prototype.hasChild=function(e){return lc(this._bits,qve[e])};Cf.prototype.getChildBitmask=function(){return this._bits&cre};var zE=Cf;function iwe(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o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F|\x8A["`);function Td(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Td.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Td.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ze)&&(t=e.url);let n=Ze.createIfNeeded(t);n.appendForwardSlash();let i=new Td;i._resource=n;try{await rwe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${dre(i,"",1).url}: ${o}`;throw new ae(r)}return i};Td.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;lc(t,r)?lc(e,r)&&(s|=1):(s|=2,lc(e,r)||(s|=1)),i+=s}return i};Td.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];lc(s,2)?lc(s,1)||(t|=r):(n|=r,lc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Td.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var lre=new yi("decodeGoogleEarthEnterprisePacket");Td.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=dre(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return lre.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,h=-1;if(e!==""){h=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,x){return f.length-x.length});let g=p.length;for(let f=0;f<g;++f){let x=p[f];if(d[x]!==null){let C=zE.clone(d[x]),V=x.length;if(V===h)C.setParent(u);else if(V>1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};Td.prototype.populateSubtree=function(e,t,n,i){let o=Td.tileXYToQuadKey(e,t,n);return OH(this,o,i)};function OH(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ho({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),OH(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ho({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),OH(e,t,s)}).finally(function(){delete a[o]})}Td.prototype.getTileInformation=function(e,t,n){let i=Td.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Td.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function dre(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var DH,BH;function rwe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(BH)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;BH=rx(n).then(function(){DH=window.cesiumGoogleEarthDbRootParser(nwe),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return BH.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=DH.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return lre.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=DH.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Ct(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=owe})}var Kp=Td;var Xtn=T(S(),1);function Yx(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(Yx.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var hre="createVerticesFromGoogleEarthEnterpriseBuffer",swe=new yi(hre),awe=new yi(hre,wm.maximumAsynchronousTasks),ure=new ce,YH=new ce;Yx.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,ure),t.tileXYToRectangle(n,i,o,YH);let d=c.cartographicToCartesian(ce.center(YH)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?awe:swe).scheduleTask({buffer:this._buffer,nativeRectangle:ure,rectangle:YH,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(x){return f._mesh=new Gu(d,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,le.clone(x.boundingSphere3D),m.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Gn.clone(x.orientedBoundingBox),sc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),f._minimumHeight=x.minimumHeight,f._maximumHeight=x.maximumHeight,f._buffer=void 0,f._mesh})};Yx.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?mwe(this,i,o):pwe(this,i,o,e)};var cwe=new yi("upsampleQuantizedTerrainMesh",wm.maximumAsynchronousTasks);Yx.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=cwe.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ae.createTypedArray(x.length/3,f.indices),C=g._skirtHeight;return new Ix({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:le.clone(f.boundingSphere),orientedBoundingBox:Gn.clone(f.orientedBoundingBox),horizonOcclusionPoint:m.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};Yx.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Yx.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var lwe=new D,dwe=new D,uwe=new D,fre=new m;function mwe(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,lwe),g=r.decodeTextureCoordinates(o,u,dwe),f=r.decodeTextureCoordinates(o,h,uwe),x=wp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,fre);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,h);return x.x*_+x.y*C+x.z*V}}}var hwe=Uint16Array.BYTES_PER_ELEMENT,mre=Uint32Array.BYTES_PER_ELEMENT,HH=Int32Array.BYTES_PER_ELEMENT,fwe=Float32Array.BYTES_PER_ELEMENT,zH=Float64Array.BYTES_PER_ELEMENT;function pwe(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let G=0;G<r;++G)d+=c.getUint32(d,!0),d+=mre;d+=mre,d+=2*zH;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=zH;let h=W.toRadians(c.getFloat64(d,!0)*180);d+=zH;let p=i.width/u/2,g=i.height/h/2,f=c.getInt32(d,!0);d+=HH;let x=c.getInt32(d,!0)*3;d+=HH,d+=HH;let _=new Array(f),C=new Array(f),V=new Array(f),L;for(L=0;L<f;++L)_[L]=s+c.getUint8(d++)*p,C[L]=a+c.getUint8(d++)*g,V[L]=c.getFloat32(d,!0)*6371010,d+=fwe;let R=new Array(x);for(L=0;L<x;++L)R[L]=c.getUint16(d,!0),d+=hwe;for(L=0;L<x;L+=3){let G=R[L],I=R[L+1],v=R[L+2],P=_[G],w=_[I],M=_[v],b=C[G],Z=C[I],E=C[v],X=wp.computeBarycentricCoordinates(t,n,P,b,w,Z,M,E,fre);if(X.x>=-1e-15&&X.y>=-1e-15&&X.z>=-1e-15)return X.x*V[G]+X.y*V[I]+X.z*V[v]}}var wC=Yx;var Jtn=T(S(),1);var Wu={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},D5=new q;function B5(){this._terrainCache={},this._lastTidy=q.now()}B5.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:q.now()}};B5.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};B5.prototype.tidy=function(){if(q.now(D5),q.secondsDifference(D5,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];q.secondsDifference(D5,r.timestamp)>10&&delete e[o]}q.clone(D5,this._lastTidy)}};function mg(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new B5,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(mg.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});mg.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new mg(t);return n._metadata=e,n};var bwe=new yi("decodeGoogleEarthEnterprisePacket");function pre(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Wu.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}mg.prototype.requestTileGeometry=function(e,t,n,i){let o=Kp.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Wu.UNKNOWN);let d=r.get(o);if(l(d)){let C=s.providers[a.terrainProvider];return Promise.resolve(new wC({buffer:d,childTileMask:pre(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Wu.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new Xa({buffer:new Uint8Array(16*16),width:16,height:16}));let u,h=o,p=-1;switch(c){case Wu.SELF:p=a.terrainVersion;break;case Wu.PARENT:h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),p=u.terrainVersion;break;case Wu.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,x,_;if(l(g[h]))x=g[h],_=f[h];else{_=i;let C=gwe(this,h,p,_).fetchArrayBuffer();if(!l(C))return;x=C.then(function(V){return l(V)?bwe.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let R=s.getTileInformationFromQuadKey(h);R.terrainState=Wu.SELF,r.add(h,L[0]);let G=R.terrainProvider,I=L.length-1;for(let v=0;v<I;++v){let P=h+v.toString(),w=s.getTileInformationFromQuadKey(P);l(w)&&(r.add(P,L[v+1]),w.terrainState=Wu.PARENT,w.terrainProvider===0&&(w.terrainProvider=G))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=x,f[h]=_,x=x.finally(function(){delete g[h],delete f[h]})}return x.then(function(){let C=r.get(o);if(l(C)){let V=s.providers[a.terrainProvider];return new wC({buffer:C,childTileMask:pre(o,a,s),credits:l(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(C){return _.state===jn.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=Wu.NONE,Promise.reject(C))})};mg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};mg.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=Kp.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Wu.NONE)return!1;if((!l(s)||s===Wu.UNKNOWN)&&(r.terrainState=Wu.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ho({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};mg.prototype.loadTileDataAvailability=function(e,t,n){};function gwe(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var KH=mg;var nnn=T(S(),1);var ywe="https://maps.googleapis.com/maps/api/geocode/json",bre='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function JH(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Ze({url:ywe,queryParameters:{key:t}}),this._credit=new Ct(bre,!0)}Object.defineProperties(JH.prototype,{credit:{get:function(){return this._credit}}});JH.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:bre,collapsible:!1}}})};var QH=JH;var snn=T(S(),1);var O5={};O5.defaultApiKey=void 0;O5.mapTilesApiEndpoint=new Ze({url:"https://tile.googleapis.com/v1/"});O5.getDefaultCredit=function(){return new Ct('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var Hx=O5;var Xnn=T(S(),1);var oz=[Ei,Wi],xwe=oz.length,Fre=Math.cos(W.toRadians(30)),gre=Math.cos(W.toRadians(150)),Are=0,Mre=1e3;function fg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,en.GEODESIC),this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(fg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});fg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<xwe;i++)if(t instanceof oz[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var _we=new m,yre=new m,xre=new m;function iz(e,t,n,i,o){let r=Qc(i,e,0,_we),s=Qc(i,e,n,yre),a=Qc(i,t,0,xre),c=Jp(s,r,yre),d=Jp(a,r,xre);return m.cross(d,c,o),m.normalize(o,o)}var Twe=new he,Swe=new m,Cwe=new m,Vwe=new m;function jH(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let h;r===en.GEODESIC?h=new Up(e,t,s):r===en.RHUMB&&(h=new Pa(e,t,s));let p=h.surfaceDistance;if(p<o)return;let g=iz(e,t,i,s,Vwe),f=Math.ceil(p/o),x=p/f,_=x,C=f-1,V=a.length;for(let L=0;L<C;L++){let R=h.interpolateUsingSurfaceDistance(_,Twe),G=Qc(s,R,n,Swe),I=Qc(s,R,i,Cwe);m.pack(g,a,V),m.pack(G,c,V),m.pack(I,d,V),u.push(R.latitude),u.push(R.longitude),V+=3,_+=x}}var qH=new he;function Qc(e,t,n,i){return he.clone(t,qH),qH.height=n,he.toCartesian(qH,e,i)}fg.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ne.pack(e._ellipsoid,t,i),i+=ne.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};fg.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],d=ne.unpack(e,i);i+=ne.packedLength;let u=e[i++],h=e[i++]===1;return l(n)||(n=new fg({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=h,n};function Jp(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function _re(e,t,n,i){return i=Jp(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var Lwe=new m,Rwe=new m,Zwe=new m,Nre=new m,Gwe=0,Ewe=-1;function $H(e,t,n,i,o){let r=Jp(n,t,Nre),s=_re(e,t,r,Lwe),a=_re(i,t,r,Rwe);if(W.equalsEpsilon(m.dot(s,a),Ewe,W.EPSILON5))return o=m.cross(r,s,o),o=m.normalize(o,o),o;o=m.add(a,s,o),o=m.normalize(o,o);let c=m.cross(r,o,Zwe);return m.dot(a,c)<Gwe&&(o=m.negate(o,o)),o}var K5=sn.fromPointNormal(m.ZERO,m.UNIT_Y),Iwe=new m,Xwe=new m,Wwe=new m,Pwe=new m,vwe=new m,Y5=new m,H5=new he,Tre=new he,Sre=new he;fg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new oz[e._projectionIndex](i),a=Are,c=Mre,d,u,h=e._positions,p=h.length;p===2&&(n=!1);let g,f,x,_,C=new Pa(void 0,void 0,i),V,L,R,G=[h[0]];for(u=0;u<p-1;u++)g=h[u],f=h[u+1],V=qn.lineSegmentPlane(g,f,K5,Y5),l(V)&&!m.equalsEpsilon(V,g,W.EPSILON7)&&!m.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===en.GEODESIC?G.push(m.clone(V)):e.arcType===en.RHUMB&&(R=i.cartesianToCartographic(V,H5).longitude,x=i.cartesianToCartographic(g,H5),_=i.cartesianToCartographic(f,Tre),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(R,Sre),V=i.cartographicToCartesian(L,Y5),l(V)&&!m.equalsEpsilon(V,g,W.EPSILON7)&&!m.equalsEpsilon(V,f,W.EPSILON7)&&G.push(m.clone(V)))),G.push(f);n&&(g=h[p-1],f=h[0],V=qn.lineSegmentPlane(g,f,K5,Y5),l(V)&&!m.equalsEpsilon(V,g,W.EPSILON7)&&!m.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===en.GEODESIC?G.push(m.clone(V)):e.arcType===en.RHUMB&&(R=i.cartesianToCartographic(V,H5).longitude,x=i.cartesianToCartographic(g,H5),_=i.cartesianToCartographic(f,Tre),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(R,Sre),V=i.cartographicToCartesian(L,Y5),l(V)&&!m.equalsEpsilon(V,g,W.EPSILON7)&&!m.equalsEpsilon(V,f,W.EPSILON7)&&G.push(m.clone(V)))));let I=G.length,v=new Array(I);for(u=0;u<I;u++){let K=he.fromCartesian(G[u],i);K.height=0,v[u]=K}if(v=To(v,he.equalsEpsilon),I=v.length,I<2)return;let P=[],w=[],M=[],b=[],Z=Iwe,E=Xwe,X=Wwe,F=Pwe,N=vwe,O=v[0],U=v[1],Y=v[I-1];for(Z=Qc(i,Y,a,Z),F=Qc(i,U,a,F),E=Qc(i,O,a,E),X=Qc(i,O,c,X),n?N=$H(Z,E,X,F,N):N=iz(O,U,c,i,N),m.pack(N,w,0),m.pack(E,M,0),m.pack(X,b,0),P.push(O.latitude),P.push(O.longitude),jH(O,U,a,c,o,r,i,w,M,b,P),u=1;u<I-1;++u){Z=m.clone(E,Z),E=m.clone(F,E);let K=v[u];Qc(i,K,c,X),Qc(i,v[u+1],a,F),$H(Z,E,X,F,N),d=w.length,m.pack(N,w,d),m.pack(E,M,d),m.pack(X,b,d),P.push(K.latitude),P.push(K.longitude),jH(v[u],v[u+1],a,c,o,r,i,w,M,b,P)}let k=v[I-1],H=v[I-2];if(E=Qc(i,k,a,E),X=Qc(i,k,c,X),n){let K=v[0];Z=Qc(i,H,a,Z),F=Qc(i,K,a,F),N=$H(Z,E,X,F,N)}else N=iz(H,k,c,i,N);if(d=w.length,m.pack(N,w,d),m.pack(E,M,d),m.pack(X,b,d),P.push(k.latitude),P.push(k.longitude),n){for(jH(k,O,a,c,o,r,i,w,M,b,P),d=w.length,u=0;u<3;++u)w[d+u]=w[u],M[d+u]=M[u],b[d+u]=b[u];P.push(O.latitude),P.push(O.longitude)}return sFe(n,s,M,b,w,P,t)};var wwe=new m,Fwe=new $,Awe=new ve;function Cre(e,t,n,i){let o=Jp(n,t,wwe),r=m.dot(o,e);if(r>Fre||r<gre){let s=Jp(i,n,Nre),a=r<gre?W.PI_OVER_TWO:-W.PI_OVER_TWO,c=ve.fromAxisAngle(s,a,Awe),d=$.fromQuaternion(c,Fwe);return $.multiplyByVector(d,e,e),!0}return!1}var Vre=new he,Mwe=new m,Lre=new m;function KE(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,Mwe),s=m.add(r,n,Lre),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,Vre);Math.abs(t.longitude-d.longitude)>W.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,Lre),d=c.cartesianToCartographic(s,Vre)),d.height=0;let u=e.project(d,o);return o=m.subtract(u,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var Nwe=new m,Rre=new m;function Zre(e,t,n,i,o,r){let s=m.subtract(t,e,Nwe);m.normalize(s,s);let a=n-Are,c=m.multiplyByScalar(s,a,Rre);m.add(e,c,o);let d=i-Mre;c=m.multiplyByScalar(s,d,Rre),m.add(t,c,r)}var kwe=new m;function z5(e,t){let n=sn.getPointDistance(K5,e),i=sn.getPointDistance(K5,t),o=kwe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=Jp(t,e,o),m.multiplyByScalar(o,W.EPSILON2,o),m.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=Jp(e,t,o),m.multiplyByScalar(o,W.EPSILON2,o),m.add(t,o,t))}function Uwe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var kre=new he,Ure=new he,Gre=new m,ez=new m,Ere=new m,Ire=new m,Dwe=new m,Xre=new m,Bwe=[kre,Ure],Owe=new ce,Ywe=new m,Hwe=new m,zwe=new m,Kwe=new m,Jwe=new m,Qwe=new m,tz=new m,nz=new m,jwe=new m,qwe=new m,$we=new m,Wre=new m,eFe=new m,tFe=new m,nFe=new On,iFe=new On,Pre=new m,oFe=new m,vre=new m,rFe=[new le,new le],Dre=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],wre=Dre.length;function sFe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,h=u*8,p=h*4,g=u*36,f=h>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(h*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),R=new Float32Array(p),G,I,v,P;s&&(G=new Float32Array(p),I=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(h*2));let w=r.length/2,M=0,b=kre;b.height=0;let Z=Ure;Z.height=0;let E=Gre,X=ez;if(s)for(c=0,a=1;a<w;a++)b.latitude=r[c],b.longitude=r[c+1],Z.latitude=r[c+2],Z.longitude=r[c+3],E=t.project(b,E),X=t.project(Z,X),M+=m.distance(E,X),c+=2;let F=i.length/3;X=m.unpack(i,0,X);let N=0;for(c=3,a=1;a<F;a++)E=m.clone(X,E),X=m.unpack(i,c,X),N+=m.distance(E,X),c+=3;let O;c=3;let U=0,Y=0,k=0,H=0,K=!1,te=m.unpack(n,0,Ire),z=m.unpack(i,0,ez),j=m.unpack(o,0,Xre);if(e){let Le=m.unpack(n,n.length-6,Ere);Cre(j,Le,te,z)&&(j=m.negate(j,j))}let ee=0,fe=0,Te=0;for(a=0;a<u;a++){let Le=m.clone(te,Ere),Ne=m.clone(z,Gre),Oe=m.clone(j,Dwe);K&&(Oe=m.negate(Oe,Oe)),te=m.unpack(n,c,Ire),z=m.unpack(i,c,ez),j=m.unpack(o,c,Xre),K=Cre(j,Le,te,z),b.latitude=r[U],b.longitude=r[U+1],Z.latitude=r[U+2],Z.longitude=r[U+3];let qe,Rt,Lt,ke;if(s){let bi=Uwe(b,Z);qe=t.project(b,Jwe),Rt=t.project(Z,Qwe);let ra=Jp(Rt,qe,Pre);ra.y=Math.abs(ra.y),Lt=tz,ke=nz,bi===0||m.dot(ra,m.UNIT_Y)>Fre?(Lt=KE(t,b,Oe,qe,tz),ke=KE(t,Z,j,Rt,nz)):bi===1?(ke=KE(t,Z,j,Rt,nz),Lt.x=0,Lt.y=W.sign(b.longitude-Math.abs(Z.longitude)),Lt.z=0):(Lt=KE(t,b,Oe,qe,tz),ke.x=0,ke.y=W.sign(b.longitude-Z.longitude),ke.z=0)}let zt=m.distance(Ne,z),ut=On.fromCartesian(Le,nFe),mt=m.subtract(te,Le,jwe),Pn=m.normalize(mt,Wre),cn=m.subtract(Ne,Le,qwe);cn=m.normalize(cn,cn);let ge=m.cross(Pn,cn,Wre);ge=m.normalize(ge,ge);let Ve=m.cross(cn,Oe,eFe);Ve=m.normalize(Ve,Ve);let bn=m.subtract(z,te,$we);bn=m.normalize(bn,bn);let pt=m.cross(j,bn,tFe);pt=m.normalize(pt,pt);let so=zt/N,Eo=ee/N,oa=0,Gr,_s,Fe,rt=0,ze=0;if(s){oa=m.distance(qe,Rt),Gr=On.fromCartesian(qe,iFe),_s=m.subtract(Rt,qe,Pre),Fe=m.normalize(_s,oFe);let bi=Fe.x;Fe.x=Fe.y,Fe.y=-bi,rt=oa/M,ze=fe/M}for(O=0;O<8;O++){let bi=H+O*4,ra=Y+O*2,zr=bi+3,Tl=O<4?1:-1,yo=O===2||O===3||O===6||O===7?1:-1;m.pack(ut.high,_,bi),_[zr]=mt.x,m.pack(ut.low,C,bi),C[zr]=mt.y,m.pack(Ve,V,bi),V[zr]=mt.z,m.pack(pt,L,bi),L[zr]=so*Tl,m.pack(ge,R,bi);let Er=Eo*yo;Er===0&&yo<0&&(Er=9),R[zr]=Er,s&&(G[bi]=Gr.high.x,G[bi+1]=Gr.high.y,G[bi+2]=Gr.low.x,G[bi+3]=Gr.low.y,v[bi]=-Lt.y,v[bi+1]=Lt.x,v[bi+2]=ke.y,v[bi+3]=-ke.x,I[bi]=_s.x,I[bi+1]=_s.y,I[bi+2]=Fe.x,I[bi+3]=Fe.y,P[ra]=rt*Tl,Er=ze*yo,Er===0&&yo<0&&(Er=9),P[ra+1]=Er)}let Qe=zwe,bt=Kwe,Ot=Ywe,Cn=Hwe,Io=ce.fromCartographicArray(Bwe,Owe),So=di.getMinimumMaximumHeights(Io,d),Ka=So.minimumTerrainHeight,Ja=So.maximumTerrainHeight;Te+=Math.abs(Ka),Te+=Math.abs(Ja),Zre(Le,Ne,Ka,Ja,Qe,Ot),Zre(te,z,Ka,Ja,bt,Cn);let Ci=m.multiplyByScalar(ge,W.EPSILON5,vre);m.add(Qe,Ci,Qe),m.add(bt,Ci,bt),m.add(Ot,Ci,Ot),m.add(Cn,Ci,Cn),z5(Qe,bt),z5(Ot,Cn),m.pack(Qe,x,k),m.pack(bt,x,k+3),m.pack(Cn,x,k+6),m.pack(Ot,x,k+9),Ci=m.multiplyByScalar(ge,-2*W.EPSILON5,vre),m.add(Qe,Ci,Qe),m.add(bt,Ci,bt),m.add(Ot,Ci,Ot),m.add(Cn,Ci,Cn),z5(Qe,bt),z5(Ot,Cn),m.pack(Qe,x,k+12),m.pack(bt,x,k+15),m.pack(Cn,x,k+18),m.pack(Ot,x,k+21),U+=2,c+=3,Y+=16,k+=24,H+=32,ee+=zt,fe+=oa}c=0;let de=0;for(a=0;a<u;a++){for(O=0;O<wre;O++)f[c+O]=Dre[O]+de;de+=8,c+=wre}let xe=rFe;le.fromVertices(n,m.ZERO,3,xe[0]),le.fromVertices(i,m.ZERO,3,xe[1]);let Ce=le.fromBoundingSpheres(xe);Ce.radius+=Te/(u*2);let Ie={position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:hg(_),startLoAndForwardOffsetY:hg(C),startNormalAndForwardOffsetZ:hg(V),endNormalAndTextureCoordinateNormalizationX:hg(L),rightNormalAndTextureCoordinateNormalizationY:hg(R)};return s&&(Ie.startHiLo2D=hg(G),Ie.offsetAndRight2D=hg(I),Ie.startEndNormals2D=hg(v),Ie.texcoordNormalization2D=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new lt({attributes:Ie,indices:f,boundingSphere:Ce})}function hg(e){return new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}fg._projectNormal=KE;var zx=fg;var wnn=T(S(),1);function rz(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}rz.clone=function(e,t){if(l(e))return l(t)||(t=new rz),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Pu=rz;var knn=T(S(),1);var aFe=W.factorial;function sz(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=sz(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var J5={type:"Hermite"};J5.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};J5.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,d,u,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let _=new Array(h);for(p[r]=_,s=0;s<h;s++)_[s]=[]}let g=h,f=new Array(g);for(r=0;r<g;r++)f[r]=r;let x=h-1;for(c=0;c<i;c++){for(s=0;s<g;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<g;r++){let _=!1;for(s=0;s<g-r;s++){let C=t[f[s]],V=t[f[s+r]],L;V-C<=0?(u=f[s]*i+i*r+c,L=n[u],p[c][r].push(L/aFe(r))):(L=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(L/(V-C))),_=_||L!==0}_||(x=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=x;r++){let _=sz(e,f,t,a,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+a*i]+=C*_}}return o};var cFe=[];J5.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,d=new Array(c*(o+1)),u;for(u=0;u<c;u++)for(let C=0;C<o+1;C++)d[u*(o+1)+C]=u;let h=d.length,p=cFe,g=lFe(p,d,t,n,i,o),f=[],x=h*(h+1)/2,_=Math.min(g,r);for(let C=0;C<=_;C++)for(u=C;u<=g;u++){f.length=0;let V=sz(e,d,t,C,u,f),L=Math.floor(u*(1-u)/2)+h*u;for(let R=0;R<i;R++){let G=Math.floor(R*x),I=p[G+L];s[R+C*i]+=I*V}}return s};function lFe(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let g=1;g<d;g++){let f=0,x=Math.floor(g*(1-g)/2)+d*g,_=!1;for(s=0;s<d-g;s++){let C=n[t[s]],V=n[t[s+g]],L,R;if(V-C<=0)a=t[s]*o*(r+1)+o*g+h,L=i[a],R=L/W.factorial(g),e[p+x+f]=R,f++;else{let G=Math.floor((g-1)*(2-g)/2)+d*(g-1);L=e[p+G+s+1]-e[p+G+s],R=L/(V-C),e[p+x+f]=R,f++}_=_||L!==0}_&&(c=Math.max(c,g))}}return c}var JE=J5;var Dnn=T(S(),1);var az={};az.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),Bre(i,o,r,s);return c};az.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),Bre(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function Bre(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var FC=az;var Hnn=T(S(),1);var dc={};dc.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});dc.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});dc.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});dc.defaultAccessToken=void 0;dc.apiEndpoint=new Ze({url:"https://api.bentley.com"});dc.getExports=async function(e){let t=new Ze({url:`${dc.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${dc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:dc.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden")):n.statusCode===422?new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${n.statusCode}`)}};dc.getRealityDataMetadata=async function(e,t){let n=new Ze({url:`${dc.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${dc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden")):i.statusCode===404?new ae(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${i.statusCode}`)}};dc.getRealityDataURL=async function(e,t,n){let i=new Ze({url:`${dc.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${dc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden")):o.statusCode===404?new ae(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${o.statusCode}`)}};var Vs=dc;var tin=T(S(),1);var Knn=T(S(),1);function dFe(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var QE=dFe;var ise={},uFe=32.184,mFe=2451545,Ore=-.0529921,Yre=-.1059842,Hre=13.0120009,zre=13.3407154,Kre=.9856003,Jre=26.4057084,Qre=13.064993,jre=.3287146,qre=1.7484877,$re=-.1589763,ese=.0036096,tse=.1643573,nse=12.9590088,cz=new q;ise.ComputeMoon=function(e,t){l(e)||(e=q.now()),cz=q.addSeconds(e,uFe,cz);let n=q.totalDays(cz)-mFe,i=n/Kn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Ore*n)*W.RADIANS_PER_DEGREE,r=(250.089+Yre*n)*W.RADIANS_PER_DEGREE,s=(260.008+Hre*n)*W.RADIANS_PER_DEGREE,a=(176.625+zre*n)*W.RADIANS_PER_DEGREE,c=(357.529+Kre*n)*W.RADIANS_PER_DEGREE,d=(311.589+Jre*n)*W.RADIANS_PER_DEGREE,u=(134.963+Qre*n)*W.RADIANS_PER_DEGREE,h=(276.617+jre*n)*W.RADIANS_PER_DEGREE,p=(34.226+qre*n)*W.RADIANS_PER_DEGREE,g=(15.134+$re*n)*W.RADIANS_PER_DEGREE,f=(119.743+ese*n)*W.RADIANS_PER_DEGREE,x=(239.961+tse*n)*W.RADIANS_PER_DEGREE,_=(25.053+nse*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),R=Math.sin(a),G=Math.sin(c),I=Math.sin(d),v=Math.sin(u),P=Math.sin(h),w=Math.sin(p),M=Math.sin(g),b=Math.sin(f),Z=Math.sin(x),E=Math.sin(_),X=Math.cos(o),F=Math.cos(r),N=Math.cos(s),O=Math.cos(a),U=Math.cos(c),Y=Math.cos(d),k=Math.cos(u),H=Math.cos(h),K=Math.cos(p),te=Math.cos(g),z=Math.cos(f),j=Math.cos(x),ee=Math.cos(_),fe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*R+.0072*I-.0052*M+.0043*E)*W.RADIANS_PER_DEGREE,Te=(66.5392+.013*i+1.5419*X+.0239*F-.0278*N+.0068*O-.0029*Y+9e-4*k+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*R+.0252*G-.0066*I-.0047*v-.0046*P+.0028*w+.0052*M+.004*b+.0019*Z-.0044*E)*W.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*X*Ore+.1208*F*Yre-.0642*N*Hre+.0158*O*zre+.0252*U*Kre-.0066*Y*Jre-.0047*k*Qre-.0046*H*jre+.0028*K*qre+.0052*te*$re+.004*z*ese+.0019*j*tse-.0044*ee*nse)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new QE),t.rightAscension=fe,t.declination=Te,t.rotation=de,t.rotationRate=xe,t};var jE=ise;var din=T(S(),1);function ose(e){(!l(e)||typeof e!="function")&&(e=jE.ComputeMoon),this._computeFunction=e}var hFe=new m,fFe=new m,pFe=new m;function bFe(e,t,n){let i=hFe;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=pFe;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,fFe);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var gFe=new $,yFe=new ve;ose.prototype.evaluate=function(e,t){l(e)||(e=q.now());let n=this._computeFunction(e),i=bFe(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=ve.fromAxisAngle(m.UNIT_Z,o,yFe),s=$.fromQuaternion(ve.conjugate(r,r),gFe);return $.multiply(s,i,i)};var qE=ose;var hin=T(S(),1);var $E={};$E.type=void 0;$E.getRequiredDataPoints=pe.throwInstantiationError;$E.interpolateOrderZero=pe.throwInstantiationError;$E.interpolate=pe.throwInstantiationError;var lz=$E;var pin=T(S(),1),xFe={STEP:0,LINEAR:1,CUBICSPLINE:2},Ym=Object.freeze(xFe);var gin=T(S(),1),_Fe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Qp=Object.freeze(_Fe);var vin=T(S(),1);var Vin=T(S(),1);function dz(e){this._url=Ze.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(dz.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});dz.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===ug.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var eI=dz;function TFe(e){if(!Object.values(Qp).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var rse=Object.freeze({[Qp.GOOGLE]:"google",[Qp.BING]:"bing",[Qp.DEFAULT]:void 0});function SFe(e){return rse[e]}function CFe(e){return Object.entries(rse).find(t=>t[1]===e)[0]}function uz(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,Qp.DEFAULT),n=y(e.accessToken,Mm.defaultAccessToken),i=Ze.createIfNeeded(y(e.server,Mm.defaultServer));i.appendForwardSlash();let o=Mm.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Ct.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new eI(r),this.geocodeProviderType=t}Object.defineProperties(uz.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return CFe(this._pelias.url.queryParameters.geocoder)},set:function(e){TFe(e);let t={...this._pelias.url.queryParameters,geocoder:SFe(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});uz.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var Kx=uz;var Oin=T(S(),1);var kin=T(S(),1);function jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?q.clone(e.start):new q,this.stop=l(e.stop)?q.clone(e.stop):new q,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var AC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(AC.start=i,AC.stop=o,AC.isStartIncluded=r,AC.isStopIncluded=s,AC.data=a,new jo(AC))};jo.toIso8601=function(e,t){return`${q.toIso8601(e.start,t)}/${q.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new jo(e)};jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equals(e.start,t.start)&&q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equalsEpsilon(e.start,t.start,n)&&q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(!l(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=q.greaterThanOrEquals(s,o)&&q.greaterThanOrEquals(r,s),d=!c&&q.lessThanOrEquals(s,o)&&q.lessThanOrEquals(o,a);if(!c&&!d)return jo.clone(jo.EMPTY,n);let u=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=q.lessThan(r,a);return l(n)||(n=new jo),n.start=c?s:o,n.isStartIncluded=u&&p||!q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?h:h&&g||!q.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(e.isEmpty)return!1;let n=q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};jo.prototype.clone=function(e){return jo.clone(this,e)};jo.prototype.equals=function(e,t){return jo.equals(this,e,t)};jo.prototype.equalsEpsilon=function(e,t,n){return jo.equalsEpsilon(this,e,t,n)};jo.prototype.toString=function(){return jo.toIso8601(this)};jo.EMPTY=Object.freeze(new jo({start:new q,stop:new q,isStartIncluded:!1,isStopIncluded:!1}));var Ln=jo;var sse=Object.freeze(q.fromIso8601("0000-01-01T00:00:00Z")),ase=Object.freeze(q.fromIso8601("9999-12-31T24:00:00Z")),VFe=Object.freeze(new Ln({start:sse,stop:ase})),LFe={MINIMUM_VALUE:sse,MAXIMUM_VALUE:ase,MAXIMUM_INTERVAL:VFe},Be=LFe;var Hin=T(S(),1),RFe={SHIFT:0,CTRL:1,ALT:2},Ds=Object.freeze(RFe);var Jin=T(S(),1);var mz={type:"Lagrange"};mz.getRequiredDataPoints=function(e){return Math.max(e+1,2)};mz.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];c*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var tI=mz;var qin=T(S(),1);var hz={type:"Linear"};hz.getRequiredDataPoints=function(e){return 2};hz.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],d=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-c*a)/(d-c);return o};var Jx=hz;var ton=T(S(),1);function Vf(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Vf.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Vf.prototype.get=function(e){return this._array[e]};Vf.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Vf.prototype.peek=function(){return this._array[this._length-1]};Vf.prototype.push=function(e){let t=this.length++;this._array[t]=e};Vf.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Vf.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Vf.prototype.resize=function(e){this.length=e};Vf.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var jc=Vf;var oon=T(S(),1);function Q5(){pe.throwInstantiationError()}Object.defineProperties(Q5.prototype,{ellipsoid:{get:pe.throwInstantiationError}});Q5.prototype.project=pe.throwInstantiationError;Q5.prototype.unproject=pe.throwInstantiationError;var fz=Q5;var lon=T(S(),1);function MC(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(MC.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});MC.prototype.findTimeInterval=no.prototype.findTimeInterval;MC.prototype.wrapTime=no.prototype.wrapTime;MC.prototype.clampTime=no.prototype.clampTime;MC.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var pz=MC;var mon=T(S(),1);var nI={};function cse(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function bz(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function lse(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function gz(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}nI.encode2D=function(e,t){return(cse(e)|cse(t)<<1)>>>0};nI.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=lse(e),t[1]=lse(e>>1),t};nI.encode3D=function(e,t,n){return bz(e)|bz(t)<<1|bz(n)<<2};nI.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=gz(e),t[1]=gz(e>>1),t[2]=gz(e>>2),t};var pg=nI;var bon=T(S(),1);function vu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}vu.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new vu(e.near,e.nearValue,e.far,e.farValue)};vu.packedLength=4;vu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};vu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new vu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};vu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};vu.prototype.clone=function(e){return vu.clone(this,e)};vu.prototype.equals=function(e){return vu.equals(this,e)};var kt=vu;var Gon=T(S(),1);var yon=T(S(),1),ZFe={NONE:-1,PARTIAL:0,FULL:1},cr=Object.freeze(ZFe);function uc(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var j5=new m;Object.defineProperties(uc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,j5),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,j5);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,j5),j5)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});uc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new uc(e,t)};var use=new m;uc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,use),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var GFe=new m;uc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,GFe),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,use),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var EFe=new m;uc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return cr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,EFe),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?cr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?cr.FULL:cr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?cr.PARTIAL:cr.FULL))}}return cr.NONE};var q5=new m;uc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,q5),q5),c=-m.dot(a,o),d=uc._anyRotationVector(o,a,c),u=uc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let h;for(let g=1;g<s;++g){if(h=uc._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!h)return;h<u&&(u=h)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,q5),q5)};var IFe=[];uc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ne.default);let n=ce.subsample(e,t,0,IFe),i=le.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return uc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var XFe=new m;uc._anyRotationVector=function(e,t,n){let i=m.abs(t,XFe),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var WFe=new m;uc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,WFe);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>W.EPSILON13)return m.normalize(s,new m)}return o};var yz=new m,PFe=new m,$5=new m,dse=new m;uc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,yz),s=m.clone(e.center,PFe),a=e.radius,c=m.subtract(s,r,$5),d=m.magnitudeSquared(c),u=a*a;if(d<u)return!1;let h=d-u,p=Math.sqrt(h),f=1/Math.sqrt(d),_=p*f*p;c=m.normalize(c,c);let C=m.add(r,m.multiplyByScalar(c,_,dse),dse),V=Math.sqrt(h-_*_),L=this._rotationVector(s,t,n,r,i),R=m.fromElements(L.x*L.x*c.x+(L.x*L.y-L.z)*c.y+(L.x*L.z+L.y)*c.z,(L.x*L.y+L.z)*c.x+L.y*L.y*c.y+(L.y*L.z-L.x)*c.z,(L.x*L.z-L.y)*c.x+(L.y*L.z+L.x)*c.y+L.z*L.z*c.z,yz);R=m.normalize(R,R);let G=m.multiplyByScalar(R,V,yz);L=m.normalize(m.subtract(m.add(C,G,$5),s,$5),$5);let I=m.dot(t,L);L=m.normalize(m.subtract(m.subtract(C,G,L),s,L),L);let v=m.dot(t,L);return I<v?I:v};var iI=uc;var Pon=T(S(),1);function oI(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(oI.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});oI.fromCartesian3=function(e){return new oI(e.x,e.y,e.z)};oI.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var $i=oI;var Don=T(S(),1);function xz(e,t,n){e=Ze.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Ct('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(xz.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});xz.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:St(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var _z=xz;var Yon=T(S(),1);var vFe={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},Tz=vFe;var Kon=T(S(),1);var wFe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},Sz=wFe;var srn=T(S(),1);var $on=T(S(),1);function FFe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),d=100,u=r.width+d|0,h=3*a,p=h/2;c.width=u,c.height=h;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,d/2,p)),o&&(g.fillStyle="black",g.fillText(t,d/2,p));let f=g.getImageData(0,0,u,h).data,x=f.length,_=u*4,C,V,L,R;for(C=0;C<x;++C)if(f[C]!==255){L=C/_|0;break}for(C=x-1;C>=0;--C)if(f[C]!==255){R=C/_|0;break}let G=-1;for(C=0;C<u&&G===-1;++C)for(V=0;V<h;++V){let I=C*4+V*_;if(f[I]!==255||f[I+1]!==255||f[I+2]!==255||f[I+3]!==255){G=C;break}}return{width:r.width,height:R-L,ascent:p-L,descent:R-p,minx:G-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Qx;function AFe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,B.TRANSPARENT),a=y(t.padding,0),c=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});l(Qx)||(l(u.imageSmoothingEnabled)?Qx="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?Qx="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?Qx="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(Qx="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[Qx]=!1,d.style.visibility="hidden",document.body.appendChild(d);let h=FFe(u,e,n,i,o);d.dimensions=h,document.body.removeChild(d),d.style.visibility="";let p=-h.minx,g=Math.ceil(h.width)+p+c,f=h.height+c,x=f-h.ascent+a,_=f-x+c;if(d.width=g,d.height=f,u.font=n,u.lineJoin="round",u.lineWidth=r,u[Qx]=!1,s!==B.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let C=y(t.strokeColor,B.BLACK);u.strokeStyle=C.toCssColorString(),u.strokeText(e,p+a,_)}if(o){let C=y(t.fillColor,B.WHITE);u.fillStyle=C.toCssColorString(),u.fillText(e,p+a,_)}return d}var jx=AFe;function sI(){this._cache={}}sI.prototype.fromColor=function(e,t){return ek(void 0,void 0,e,t,this._cache)};sI.prototype.fromUrl=function(e,t,n){return ek(e,void 0,t,n,this._cache)};sI.prototype.fromMakiIconId=function(e,t,n){return ek(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};sI.prototype.fromText=function(e,t,n){return ek(void 0,e,t,n,this._cache)};var MFe=new B;function NFe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,MFe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function mse(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=B.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=B.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var rI=new Array(4);function ek(e,t,n,i,o){rI[0]=e,rI[1]=t,rI[2]=n,rI[3]=i;let r=JSON.stringify(rI),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(NFe(c,n,i),l(e)){let u=Ze.createIfNeeded(e).fetchImage().then(function(h){return mse(c,h,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=jx(t,{font:`bold ${i}px sans-serif`});mse(c,d,i)}return o[r]=a,a}var jp=sI;var yrn=T(S(),1);function NC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Xe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}NC.packedLength=Xe.packedLength;NC.pack=function(e,t,n){return n=y(n,0),Xe.pack(e._vertexFormat,t,n),t};var hse=new Xe,kFe={vertexFormat:hse};NC.unpack=function(e,t,n){t=y(t,0);let i=Xe.unpack(e,t,hse);return l(n)?(n._vertexFormat=Xe.clone(i,n._vertexFormat),n):new NC(kFe)};var tk=new m(-.5,-.5,0),nk=new m(.5,.5,0);NC.createGeometry=function(e){let t=e._vertexFormat,n=new mn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=tk.x,o[1]=tk.y,o[2]=0,o[3]=nk.x,o[4]=tk.y,o[5]=0,o[6]=nk.x,o[7]=nk.y,o[8]=0,o[9]=tk.x,o[10]=nk.y,o[11]=0,n.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new lt({attributes:n,indices:i,primitiveType:we.TRIANGLES,boundingSphere:new le(m.ZERO,Math.sqrt(2))})};var aI=NC;var Grn=T(S(),1);function kC(){this._workerName="createPlaneOutlineGeometry"}kC.packedLength=0;kC.pack=function(e,t){return t};kC.unpack=function(e,t,n){return l(n)?n:new kC};var bg=new m(-.5,-.5,0),ik=new m(.5,.5,0);kC.createGeometry=function(){let e=new mn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=bg.x,n[1]=bg.y,n[2]=bg.z,n[3]=ik.x,n[4]=bg.y,n[5]=bg.z,n[6]=ik.x,n[7]=ik.y,n[8]=bg.z,n[9]=bg.x,n[10]=ik.y,n[11]=bg.z,e.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new lt({attributes:e,indices:t,primitiveType:we.LINES,boundingSphere:new le(m.ZERO,Math.sqrt(2))})};var cI=kC;var hsn=T(S(),1);var Nrn=T(S(),1);function Ar(e,t){this.position=e,l(this.position)||(this.position=new D),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ar.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ar.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=D.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(W.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=W.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=W.TWO_PI),e}}});var UC=new he,UFe=new m;Ar.prototype.getLatitude=function(e){l(e)||(e=ne.default),UC.latitude=this.conformalLatitude,UC.longitude=this.longitude,UC.height=0;let t=this.ellipsoid.cartographicToCartesian(UC,UFe);return e.cartesianToCartographic(t,UC),UC.latitude};var DFe=new pn,BFe=new m,OFe=new m;Ar.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ar.NORTH_POLE_TANGENT_PLANE,o=Ar.SOUTH_POLE;n<0&&(i=Ar.SOUTH_POLE_TANGENT_PLANE,o=Ar.NORTH_POLE);let r=DFe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,BFe),m.normalize(r.direction,r.direction);let s=qn.rayPlane(r,i.plane,OFe),a=m.subtract(s,o,s),c=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return l(t)?(t.position=new D(c,d),t.tangentPlane=i,t):new Ar(new D(c,d),i)};Ar.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Ar.fromCartesian(e[i],t[i]);return t};Ar.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ar(e.position,e.tangentPlane)};Ar.HALF_UNIT_SPHERE=Object.freeze(new ne(.5,.5,.5));Ar.NORTH_POLE=Object.freeze(new m(0,0,.5));Ar.SOUTH_POLE=Object.freeze(new m(0,0,-.5));Ar.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Qr(Ar.NORTH_POLE,Ar.HALF_UNIT_SPHERE));Ar.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Qr(Ar.SOUTH_POLE,Ar.HALF_UNIT_SPHERE));var mc=Ar;var YFe=new he,fse=new he;function HFe(e,t,n,i){let r=i.cartesianToCartographic(e,YFe).height,s=i.cartesianToCartographic(t,fse);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,fse);a.height=r-100,i.cartographicToCartesian(a,n)}var pse=new Ke,zFe=new m,KFe=new m,JFe=new m,QFe=new m,jFe=new m,qFe=new m,ok=new m,Lf=new m,DC=new m,$Fe=new D,eAe=new D,tAe=new m,bse=new ve,nAe=new $,iAe=new $;function Cz(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,d=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,f=e.stRotation,x=e.perPositionHeight,_=$Fe;_.x=u.x,_.y=u.y;let C=t.st?new Float32Array(2*(s/3)):void 0,V;t.normal&&(x&&c&&!a?V=n.attributes.normal.values:V=new Float32Array(s));let L=t.tangent?new Float32Array(s):void 0,R=t.bitangent?new Float32Array(s):void 0,G=i?new Float32Array(s):void 0,I=0,v=0,P=KFe,w=JFe,M=QFe,b=!0,Z=nAe,E=iAe;if(f!==0){let N=ve.fromAxisAngle(h,f,bse);Z=$.fromQuaternion(N,Z),N=ve.fromAxisAngle(h,-f,bse),E=$.fromQuaternion(N,E)}else Z=$.clone($.IDENTITY,Z),E=$.clone($.IDENTITY,E);let X=0,F=0;c&&d&&(X=s/2,F=s/3,s/=2);for(let N=0;N<s;N+=3){let O=m.fromArray(o,N,tAe);if(t.st&&!l(r)){let U=$.multiplyByVector(Z,O,zFe);U=g.scaleToGeodeticSurface(U,U);let Y=p([U],eAe)[0];D.subtract(Y,_,Y);let k=W.clamp(Y.x/u.width,0,1),H=W.clamp(Y.y/u.height,0,1);d&&(C[I+F]=k,C[I+1+F]=H),c&&(C[I]=k,C[I+1]=H),I+=2}if(t.normal||t.tangent||t.bitangent||i){let U=v+1,Y=v+2;if(a){if(N+3<s){let k=m.fromArray(o,N+3,jFe);if(b){let H=m.fromArray(o,N+s,qFe);x&&HFe(O,k,H,g),m.subtract(k,O,k),m.subtract(H,O,H),P=m.normalize(m.cross(H,k,P),P),b=!1}m.equalsEpsilon(k,O,W.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(M=g.geodeticSurfaceNormal(O,M),t.tangent&&(w=m.normalize(m.cross(M,P,w),w)))}else P=g.geodeticSurfaceNormal(O,P),(t.tangent||t.bitangent)&&(x&&(ok=m.fromArray(V,v,ok),Lf=m.cross(m.UNIT_Z,ok,Lf),Lf=m.normalize($.multiplyByVector(E,Lf,Lf),Lf),t.bitangent&&(DC=m.normalize(m.cross(ok,Lf,DC),DC))),w=m.cross(m.UNIT_Z,P,w),w=m.normalize($.multiplyByVector(E,w,w),w),t.bitangent&&(M=m.normalize(m.cross(P,w,M),M)));t.normal&&(e.wall?(V[v+X]=P.x,V[U+X]=P.y,V[Y+X]=P.z):d&&(V[v+X]=-P.x,V[U+X]=-P.y,V[Y+X]=-P.z),(c&&!x||a)&&(V[v]=P.x,V[U]=P.y,V[Y]=P.z)),i&&(a&&(P=g.geodeticSurfaceNormal(O,P)),G[v+X]=-P.x,G[U+X]=-P.y,G[Y+X]=-P.z),t.tangent&&(e.wall?(L[v+X]=w.x,L[U+X]=w.y,L[Y+X]=w.z):d&&(L[v+X]=-w.x,L[U+X]=-w.y,L[Y+X]=-w.z),c&&(x?(L[v]=Lf.x,L[U]=Lf.y,L[Y]=Lf.z):(L[v]=w.x,L[U]=w.y,L[Y]=w.z))),t.bitangent&&(d&&(R[v+X]=M.x,R[U+X]=M.y,R[Y+X]=M.z),c&&(x?(R[v]=DC.x,R[U]=DC.y,R[Y]=DC.z):(R[v]=M.x,R[U]=M.y,R[Y]=M.z))),v+=3}}t.st&&!l(r)&&(n.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.tangent&&(n.attributes.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.bitangent&&(n.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:R})),i&&(n.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:G}))}if(e.extrude&&l(e.offsetAttribute)){let u=o.length/3,h=new Uint8Array(u);if(e.offsetAttribute===rn.TOP)c&&d||a?h=h.fill(1,0,u/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===rn.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var gse=[];function oAe(e,t,n,i,o,r,s,a,c,d){let u={walls:[]},h;if(s||a){let V=kn.createGeometryFromPositions(e,t,n,i,r,c,d),L=V.attributes.position.values,R=V.indices,G,I;if(s&&a){let v=L.concat(L);G=v.length/3,I=Ae.createTypedArray(G,R.length*2),I.set(R);let P=R.length,w=G/2;for(h=0;h<P;h+=3){let M=I[h]+w,b=I[h+1]+w,Z=I[h+2]+w;I[h+P]=Z,I[h+1+P]=b,I[h+2+P]=M}if(V.attributes.position.values=v,r&&c.normal){let M=V.attributes.normal.values;V.attributes.normal.values=new Float32Array(v.length),V.attributes.normal.values.set(M)}if(c.st&&l(n)){let M=V.attributes.st.values;V.attributes.st.values=new Float32Array(G*2),V.attributes.st.values=M.concat(M)}V.indices=I}else if(a){for(G=L.length/3,I=Ae.createTypedArray(G,R.length),h=0;h<R.length;h+=3)I[h]=R[h+2],I[h+1]=R[h+1],I[h+2]=R[h];V.indices=I}u.topAndBottom=new Et({geometry:V})}let p=o.outerRing,g=Qr.fromPoints(p,e),f=g.projectPointsOntoPlane(p,gse),x=ii.computeWindingOrder2D(f);x===us.CLOCKWISE&&(p=p.slice().reverse());let _=kn.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new Et({geometry:_}));let C=o.holes;for(h=0;h<C.length;h++){let V=C[h];f=g.projectPointsOntoPlane(V,gse),x=ii.computeWindingOrder2D(f),x===us.COUNTER_CLOCKWISE&&(V=V.slice().reverse()),_=kn.computeWallGeometry(V,n,e,i,r,d),u.walls.push(new Et({geometry:_}))}return u}function Fu(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Xe.DEFAULT),i=y(e.ellipsoid,ne.default),o=y(e.granularity,W.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),d=y(e.height,0),u=y(e.extrudedHeight,d);if(!c){let h=Math.max(d,u);u=Math.min(d,u),d=h}this._vertexFormat=Xe.clone(n),this._ellipsoid=ne.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,en.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=kn.computeHierarchyPackedLength(t,m)+ne.packedLength+Xe.packedLength+(s?kn.computeHierarchyPackedLength(s,D):1)+12}Fu.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Fu(t)};Fu.pack=function(e,t,n){return n=y(n,0),n=kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=kn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var rAe=ne.clone(ne.UNIT_SPHERE),sAe=new Xe,aAe={polygonHierarchy:{}};Fu.unpack=function(e,t,n){t=y(t,0);let i=kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,rAe);t+=ne.packedLength;let r=Xe.unpack(e,t,sAe);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++]===1,h=e[t++]===1,p=e[t++]===1,g=e[t++]===1,f=e[t++]===1,x=e[t++],_=e[t++],C=e[t]===-1?void 0:kn.unpackPolygonHierarchy(e,t,D);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let V=e[t++];return l(n)||(n=new Fu(aAe)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=d,n._perPositionHeightExtrude=u,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=g,n._shadowVolume=f,n._offsetAttribute=x===-1?void 0:x,n._arcType=_,n._textureCoordinates=C,n.packedLength=V,n};var cAe=new D,lAe=new D,dAe=new mc;function yse(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==en.RHUMB){let p=D.subtract(t.position,e.position,cAe),g=D.dot(t.position,p)/D.dot(p,p);if(g>0&&g<1){let f=D.add(t.position,D.multiplyByScalar(p,-g,p),lAe),x=mc.clone(t,dAe);x.position=f;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,h=Math.sign(u);h!==0&&(h*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=h),d<=0&&(o.southAngle+=h)}var xse=new mc,uAe=new mc,wu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Fu.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ce),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,wu.northAngle=0,wu.southAngle=0,wu.westOverIdl=Number.POSITIVE_INFINITY,wu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=mc.fromCartesian(e[0],uAe);for(let s=1;s<o;s++){let a=mc.fromCartesian(e[s],xse);yse(a,r,t,n,wu,i),r=mc.clone(a,r)}return yse(mc.fromCartesian(e[0],xse),r,t,n,wu,i),i.east-i.west>wu.eastOverIdl-wu.westOverIdl&&(i.west=wu.westOverIdl,i.east=wu.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(wu.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(wu.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var mAe=new mc;function hAe(e,t,n){return e.height>=W.PI||e.width>=W.PI?mc.fromCartesian(t[0],mAe).tangentPlane:Qr.fromPoints(t,n)}var _se=new he;function fAe(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],_se);o[s]=new D(a.longitude/W.PI,a.latitude/W.PI_OVER_TWO)}return o.length=i.length,o}return mc.fromCartesianArray(i,o)}return Qr.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function pAe(e,t,n){if(e.height>=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,_se);return l(r)||(r=new D),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return mc.fromCartesian(o,r)};let i=Qr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function bAe(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?kn.splitPolygonsOnEquator(o,t,n,r):o}function gAe(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return Ke.fromRectangle(t,void 0,pse);let o=e,r=Qr.fromPoints(o,n);return kn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,pse)}Fu.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,h=l(u),p=r.positions;if(p.length<3)return;let g=e.rectangle,f=kn.polygonsFromHierarchy(r,h,fAe(g,p,n),!s,n,bAe(g,n,d,s)),x=f.hierarchy,_=f.polygons,C=function(X){return X},V=h?kn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,R=gAe(L,g,n,o),G=[],I=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!W.equalsEpsilon(I,v,0,W.EPSILON2),w={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:hAe(g,L,n).plane.normal,projectTo2d:pAe(g,L,n),boundingRectangle:R,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},M;if(P)for(w.extrude=!0,w.top=a,w.bottom=c,w.shadowVolume=e._shadowVolume,w.offsetAttribute=e._offsetAttribute,M=0;M<_.length;M++){let X=oAe(n,_[M],h?V[M]:void 0,i,x[M],s,a,c,t,d),F;a&&c?(F=X.topAndBottom,w.geometry=kn.scaleToGeodeticHeightExtruded(F.geometry,I,v,n,s)):a?(F=X.topAndBottom,F.geometry.attributes.position.values=ii.scaleToGeodeticHeight(F.geometry.attributes.position.values,I,n,!s),w.geometry=F.geometry):c&&(F=X.topAndBottom,F.geometry.attributes.position.values=ii.scaleToGeodeticHeight(F.geometry.attributes.position.values,v,n,!0),w.geometry=F.geometry),(a||c)&&(w.wall=!1,F.geometry=Cz(w),G.push(F));let N=X.walls;w.wall=!0;for(let O=0;O<N.length;O++){let U=N[O];w.geometry=kn.scaleToGeodeticHeightExtruded(U.geometry,I,v,n,s),U.geometry=Cz(w),G.push(U)}}else for(M=0;M<_.length;M++){let X=new Et({geometry:kn.createGeometryFromPositions(n,_[M],h?V[M]:void 0,i,s,t,d)});if(X.geometry.attributes.position.values=ii.scaleToGeodeticHeight(X.geometry.attributes.position.values,I,n,!s),w.geometry=X.geometry,X.geometry=Cz(w),l(e._offsetAttribute)){let F=X.geometry.attributes.position.values.length,N=e._offsetAttribute===rn.NONE?0:1,O=new Uint8Array(F/3).fill(N);X.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}G.push(X)}let b=Fn.combineInstances(G)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Ae.createTypedArray(b.attributes.position.values.length/3,b.indices);let Z=b.attributes,E=le.fromVertices(Z.position.values);return t.position||delete Z.position,new lt({attributes:Z,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};Fu.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Fu({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function yAe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return lt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Fu.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Fu.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=yAe(this)),this._textureCoordinateRotationPoints}}});var qp=Fu;var wsn=T(S(),1);var Tse=[],rk=[];function xAe(e,t,n,i,o){let s=Qr.fromPoints(t,e).projectPointsOntoPlane(t,Tse);ii.computeWindingOrder2D(s)===us.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,h=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],x=t[(d+1)%u];c[h++]=f.x,c[h++]=f.y,c[h++]=f.z,c[h++]=x.x,c[h++]=x.y,c[h++]=x.z}else{let f=0;if(o===en.GEODESIC)for(d=0;d<u;d++)f+=kn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===en.RHUMB)for(d=0;d<u;d++)f+=kn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let x;o===en.GEODESIC?x=kn.subdivideLine(t[d],t[(d+1)%u],n,rk):o===en.RHUMB&&(x=kn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,rk));let _=x.length;for(let C=0;C<_;++C)c[h++]=x[C]}}u=c.length/3;let p=u*2,g=Ae.createTypedArray(u,p);for(h=0,d=0;d<u-1;d++)g[h++]=d,g[h++]=d+1;return g[h++]=u-1,g[h++]=0,new Et({geometry:new lt({attributes:new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:we.LINES})})}function _Ae(e,t,n,i,o){let s=Qr.fromPoints(t,e).projectPointsOntoPlane(t,Tse);ii.computeWindingOrder2D(s)===us.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,h=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){h[d]=p/3;let _=t[d],C=t[(d+1)%u];c[p++]=_.x,c[p++]=_.y,c[p++]=_.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let _=0;if(o===en.GEODESIC)for(d=0;d<u;d++)_+=kn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===en.RHUMB)for(d=0;d<u;d++)_+=kn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(_*3*2),d=0;d<u;++d){h[d]=p/3;let C;o===en.GEODESIC?C=kn.subdivideLine(t[d],t[(d+1)%u],n,rk):o===en.RHUMB&&(C=kn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,rk));let V=C.length;for(let L=0;L<V;++L)c[p++]=C[L]}}u=c.length/(3*2);let g=h.length,f=(u*2+g)*2,x=Ae.createTypedArray(u+g,f);for(p=0,d=0;d<u;++d)x[p++]=d,x[p++]=(d+1)%u,x[p++]=d+u,x[p++]=(d+1)%u+u;for(d=0;d<g;d++){let _=h[d];x[p++]=_,x[p++]=_+u}return new Et({geometry:new lt({attributes:new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:we.LINES})})}function qx(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ne.default),i=y(e.granularity,W.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,en.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=ne.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=kn.computeHierarchyPackedLength(t,m)+ne.packedLength+8}qx.pack=function(e,t,n){return n=y(n,0),n=kn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var TAe=ne.clone(ne.UNIT_SPHERE),SAe={polygonHierarchy:{}};qx.unpack=function(e,t,n){t=y(t,0);let i=kn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,TAe);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],h=e[t++],p=e[t];return l(n)||(n=new qx(SAe)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};qx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new qx(t)};qx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=kn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=W.chordLength(n,t.maximumRadius),u=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!W.equalsEpsilon(u,h,0,W.EPSILON2),g,f;if(p)for(f=0;f<s.length;f++){if(a=_Ae(t,s[f],d,o,r),a.geometry=kn.scaleToGeodeticHeightExtruded(a.geometry,u,h,t,o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,V=new Uint8Array(C);e._offsetAttribute===rn.TOP?V=V.fill(1,0,C/2):(g=e._offsetAttribute===rn.NONE?0:1,V=V.fill(g)),a.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}else for(f=0;f<s.length;f++){if(a=xAe(t,s[f],d,o,r),a.geometry.attributes.position.values=ii.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===rn.NONE?0:1;let V=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}let x=Fn.combineInstances(c)[0],_=le.fromVertices(x.attributes.position.values);return new lt({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var lI=qx;var tan=T(S(),1);var Rse=[];function CAe(e,t,n,i,o){let r=Rse;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,h=i.red,p=i.green,g=i.blue,f=i.alpha;if(B.equals(n,i)){for(s=0;s<o;s++)r[s]=B.clone(n);return r}let x=(h-a)/o,_=(p-c)/o,C=(g-d)/o,V=(f-u)/o;for(s=0;s<o;s++)r[s]=new B(a+s*x,c+s*_,d+s*C,u+s*V);return r}function dI(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Xe.clone(y(e.vertexFormat,Xe.DEFAULT)),this._arcType=y(e.arcType,en.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._workerName="createPolylineGeometry";let r=1+t.length*m.packedLength;r+=l(n)?1+n.length*B.packedLength:1,this.packedLength=r+ne.packedLength+Xe.packedLength+4}dI.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Zse=ne.clone(ne.UNIT_SPHERE),Gse=new Xe,$x={positions:void 0,colors:void 0,ellipsoid:Zse,vertexFormat:Gse,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};dI.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=ne.unpack(e,t,Zse);t+=ne.packedLength;let c=Xe.unpack(e,t,Gse);t+=Xe.packedLength;let d=e[t++],u=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Xe.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=h,n._granularity=p,n):($x.positions=r,$x.colors=s,$x.width=d,$x.colorsPerVertex=u,$x.arcType=h,$x.granularity=p,new dI($x))};var Sse=new m,Cse=new m,Vse=new m,Lse=new m;dI.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,h=[],p=To(e._positions,m.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let F=0,N=h[0];i=i.filter(function(O,U){let Y=!1;return o?Y=U===N||U===0&&N===1:Y=U+1===N,Y?(F++,N=h[F],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===en.GEODESIC||r===en.RHUMB){let F,N;r===en.GEODESIC?(F=W.chordLength(s,a.maximumRadius),N=vi.numberOfPoints):(F=s,N=vi.numberOfPointsRhumbLine);let O=vi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c<g-1;++c)U+=N(p[c],p[c+1],F);let Y=new Array(U),k=0;for(c=0;c<g-1;++c){let H=p[c],K=p[c+1],te=i[c],z=N(H,K,F);if(o&&c<U){let j=i[c+1],ee=CAe(H,K,te,j,z),fe=ee.length;for(d=0;d<fe;++d)Y[k++]=ee[d]}else for(d=0;d<z;++d)Y[k++]=B.clone(te)}Y[k]=B.clone(i[i.length-1]),i=Y,Rse.length=0}r===en.GEODESIC?p=vi.generateCartesianArc({positions:p,minDistance:F,ellipsoid:a,height:O}):p=vi.generateCartesianRhumbArc({positions:p,granularity:F,ellipsoid:a,height:O})}g=p.length;let f=g*4-4,x=new Float64Array(f*3),_=new Float64Array(f*3),C=new Float64Array(f*3),V=new Float32Array(f*2),L=n.st?new Float32Array(f*2):void 0,R=l(i)?new Uint8Array(f*4):void 0,G=0,I=0,v=0,P=0,w;for(d=0;d<g;++d){d===0?(w=Sse,m.subtract(p[0],p[1],w),m.add(p[0],w,w)):w=p[d-1],m.clone(w,Vse),m.clone(p[d],Cse),d===g-1?(w=Sse,m.subtract(p[g-1],p[g-2],w),m.add(p[g-1],w,w)):w=p[d+1],m.clone(w,Lse);let F,N;l(R)&&(d!==0&&!o?F=i[d-1]:F=i[d],d!==g-1&&(N=i[d]));let O=d===0?2:0,U=d===g-1?2:4;for(u=O;u<U;++u){m.pack(Cse,x,G),m.pack(Vse,_,G),m.pack(Lse,C,G),G+=3;let Y=u-2<0?-1:1;if(V[I++]=2*(u%2)-1,V[I++]=Y*t,n.st&&(L[v++]=d/(g-1),L[v++]=Math.max(V[I-2],0)),l(R)){let k=u<2?F:N;R[P++]=B.floatToByte(k.red),R[P++]=B.floatToByte(k.green),R[P++]=B.floatToByte(k.blue),R[P++]=B.floatToByte(k.alpha)}}}let M=new mn;M.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x}),M.prevPosition=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),M.nextPosition=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C}),M.expandAndWidth=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:V}),n.st&&(M.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:L})),l(R)&&(M.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));let b=Ae.createTypedArray(f,g*6-6),Z=0,E=0,X=g-1;for(d=0;d<X;++d)b[E++]=Z,b[E++]=Z+2,b[E++]=Z+1,b[E++]=Z+1,b[E++]=Z+2,b[E++]=Z+3,Z+=4;return new lt({attributes:M,indices:b,primitiveType:we.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:xu.POLYLINES})};var $p=dI;var Lan=T(S(),1);function VAe(e,t,n,i){let o=new mn;i.position&&(o.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=ii.triangulate(t),d=(a-1)*r*6+c.length*2,u=Ae.createTypedArray(s,d),h,p,g,f,x,_,C=r*2,V=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)g=p*2+h*r*2,_=g+C,f=g+1,x=f+C,u[V++]=f,u[V++]=g,u[V++]=x,u[V++]=x,u[V++]=g,u[V++]=_;g=r*2-2+h*r*2,f=g+1,x=f+C,_=g+C,u[V++]=f,u[V++]=g,u[V++]=x,u[V++]=x,u[V++]=g,u[V++]=_}if(i.st||i.tangent||i.bitangent){let G=new Float32Array(s*2),I=1/(a-1),v=1/n.height,P=n.height/2,w,M,b=0;for(h=0;h<a;h++){for(w=h*I,M=v*(t[0].y+P),G[b++]=w,G[b++]=M,p=1;p<r;p++)M=v*(t[p].y+P),G[b++]=w,G[b++]=M,G[b++]=w,G[b++]=M;M=v*(t[0].y+P),G[b++]=w,G[b++]=M}for(p=0;p<r;p++)w=0,M=v*(t[p].y+P),G[b++]=w,G[b++]=M;for(p=0;p<r;p++)w=(a-1)*I,M=v*(t[p].y+P),G[b++]=w,G[b++]=M;o.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:new Float32Array(G)})}let L=s-r*2;for(h=0;h<c.length;h+=3){let G=c[h]+L,I=c[h+1]+L,v=c[h+2]+L;u[V++]=G,u[V++]=I,u[V++]=v,u[V++]=v+r,u[V++]=I+r,u[V++]=G+r}let R=new lt({attributes:o,indices:u,boundingSphere:le.fromVertices(e),primitiveType:we.TRIANGLES});if(i.normal&&(R=Fn.computeNormal(R)),i.tangent||i.bitangent){try{R=Fn.computeTangentAndBitangent(R)}catch{_t("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(R.attributes.tangent=void 0),i.bitangent||(R.attributes.bitangent=void 0),i.st||(R.attributes.st=void 0)}return R}function mI(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._cornerType=y(e.cornerType,Pi.ROUNDED),this._vertexFormat=Xe.clone(y(e.vertexFormat,Xe.DEFAULT)),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+ne.packedLength+Xe.packedLength+2}mI.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Ese=ne.clone(ne.UNIT_SPHERE),Ise=new Xe,uI={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Ese,vertexFormat:Ise,cornerType:void 0,granularity:void 0};mI.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,Ese);t+=ne.packedLength;let c=Xe.unpack(e,t,Ise);t+=Xe.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Xe.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(uI.polylinePositions=r,uI.shapePositions=s,uI.cornerType=d,uI.granularity=u,new mI(uI))};var LAe=new Ke;mI.createGeometry=function(e){let t=e._positions,n=To(t,m.equalsEpsilon),i=e._shape;if(i=Um.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ii.computeWindingOrder2D(i)===us.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,LAe),r=Um.computePositions(n,i,o,e,!0);return VAe(r,i,o,e._vertexFormat)};var hI=mI;var Han=T(S(),1);function RAe(e,t){let n=new mn;n.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ae.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let h=c*i;for(d=0;d<i-1;d++)a[u++]=d+h,a[u++]=d+h+1;for(a[u++]=i-1+h,a[u++]=h,c=s-1,h=c*i,d=0;d<i-1;d++)a[u++]=d+h,a[u++]=d+h+1;for(a[u++]=i-1+h,a[u++]=h,c=0;c<s-1;c++){let g=i*c,f=g+i;for(d=0;d<i;d++)a[u++]=d+g,a[u++]=d+f}return new lt({attributes:n,indices:Ae.createTypedArray(o,a),boundingSphere:le.fromVertices(e),primitiveType:we.LINES})}function pI(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._cornerType=y(e.cornerType,Pi.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+ne.packedLength+2}pI.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Xse=ne.clone(ne.UNIT_SPHERE),fI={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Xse,height:void 0,cornerType:void 0,granularity:void 0};pI.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,Xse);t+=ne.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(fI.polylinePositions=r,fI.shapePositions=s,fI.cornerType=c,fI.granularity=d,new pI(fI))};var ZAe=new Ke;pI.createGeometry=function(e){let t=e._positions,n=To(t,m.equalsEpsilon),i=e._shape;if(i=Um.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ii.computeWindingOrder2D(i)===us.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,ZAe),r=Um.computePositions(n,i,o,e,!1);return RAe(r,i)};var bI=pI;var Jan=T(S(),1);function Wse(){pe.throwInstantiationError()}Wse.prototype.getURL=pe.throwInstantiationError;var Vz=Wse;var tcn=T(S(),1);function GAe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new ve);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return ve.fastSlerp(a,c,s,o)}}function BC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=GAe(this),this._lastTimeIndex=0}Object.defineProperties(BC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});BC.prototype.findTimeInterval=no.prototype.findTimeInterval;BC.prototype.wrapTime=no.prototype.wrapTime;BC.prototype.clampTime=no.prototype.clampTime;BC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var gI=BC;var ocn=T(S(),1),vse=T(Pse(),1);function sk(){this._tree=new vse.default}function e_(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}e_.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};sk.prototype.insert=function(e,t){let n=e_.fromRectangleAndId(e,t,new e_);this._tree.insert(n)};function EAe(e,t){return e.id===t.id}var IAe=new e_;sk.prototype.remove=function(e,t){let n=e_.fromRectangleAndId(e,t,IAe);this._tree.remove(n,EAe)};var XAe=new e_;sk.prototype.collides=function(e){let t=e_.fromRectangleAndId("",e,XAe);return this._tree.collides(t)};var t_=sk;var kcn=T(S(),1);var fcn=T(S(),1);var wse=Math.cos,Fse=Math.sin,WAe=Math.sqrt,Zz={};Zz.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,d=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,h=wse(u),p=Fse(u),g=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,x=h*wse(f),_=h*Fse(f),C=a.x*x,V=a.y*_,L=WAe(C*x+V*_+g*p);if(r.x=C/L,r.y=V/L,r.z=g/L,n){let R=e.stNwCorner;l(R)?(u=R.latitude-e.stGranYCos*i+o*e.stGranXSin,f=R.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var PAe=new Ii,Au=new m,vAe=new he,ak=new m,yI=new Ei;function Ase(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),h=i*u,p=n*u;yI._ellipsoid=ne.default,Au=yI.project(e,Au),Au=m.subtract(Au,ak,Au);let g=Ii.fromRotation(t,PAe);Au=Ii.multiplyByVector(g,Au,Au),Au=m.add(Au,ak,Au),e=yI.unproject(Au,e),r-=1,s-=1;let f=e.latitude,x=f+r*p,_=f-c*s,C=f-c*s+r*p,V=Math.max(f,x,_,C),L=Math.min(f,x,_,C),R=e.longitude,G=R+r*d,I=R+s*h,v=R+s*h+r*d,P=Math.max(R,G,I,v),w=Math.min(R,G,I,v);return{north:V,south:L,east:P,west:w,granYCos:c,granYSin:h,granXCos:d,granXSin:p,nwCorner:e}}Zz.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,h=!1,p=!1;d===W.PI_OVER_TWO&&(h=!0),u===-W.PI_OVER_TWO&&(p=!0);let g,f=d-u;c>a?g=W.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,_=Math.ceil(f/t)+1,C=g/(x-1),V=f/(_-1),L=ce.northwest(e,r),R=ce.center(e,vAe);(n!==0||i!==0)&&(R.longitude<L.longitude&&(R.longitude+=W.TWO_PI),yI._ellipsoid=ne.default,ak=yI.project(R,ak));let G=V,I=C,v=0,P=0,w=ce.clone(e,o),M={granYCos:G,granYSin:v,granXCos:I,granXSin:P,nwCorner:L,boundingRectangle:w,width:x,height:_,northCap:h,southCap:p};if(n!==0){let b=Ase(L,n,C,V,R,x,_);d=b.north,u=b.south,a=b.east,c=b.west,M.granYCos=b.granYCos,M.granYSin=b.granYSin,M.granXCos=b.granXCos,M.granXSin=b.granXSin,w.north=d,w.south=u,w.east=a,w.west=c}if(i!==0){n=n-i;let b=ce.northwest(w,s),Z=Ase(b,n,C,V,R,x,_);M.stGranYCos=Z.granYCos,M.stGranXCos=Z.granXCos,M.stGranYSin=Z.granYSin,M.stGranXSin=Z.granXSin,M.stNwCorner=b,M.stWest=Z.west,M.stSouth=Z.south}return M};var Ls=Zz;var Gz=new m,kse=new m,Use=new m,Dse=new m,Bse=new ce,wAe=new D,FAe=new le,AAe=new le;function Ose(e,t){let n=new lt({attributes:new mn,primitiveType:we.TRIANGLES});return n.attributes.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function MAe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,d=Dse,u=Use,h=kse;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=m.fromArray(e,p,Gz),f=c+1,x=c+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,h,u),$.multiplyByVector(i,u,u),m.normalize(u,u),t.bitangent&&m.normalize(m.cross(h,u,d),d)),t.normal&&(r[c]=h.x,r[f]=h.y,r[x]=h.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[x]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[x]=d.z),c+=3}return Ose(t,{positions:e,normals:r,tangents:s,bitangents:a})}var Ez=new m,Yse=new m;function NAe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,d=0,u=!0,h=Dse,p=Use,g=kse;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let x=m.fromArray(e,f,Gz),_=m.fromArray(e,(f+6)%i,Ez);if(u){let C=m.fromArray(e,(f+3)%i,Yse);m.subtract(_,x,_),m.subtract(C,x,C),g=m.normalize(m.cross(C,_,g),g),u=!1}m.equalsEpsilon(_,x,W.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(x,h),t.tangent&&(p=m.normalize(m.cross(h,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[d++]=h.x,s[d++]=h.y,s[d++]=h.z,s[d++]=h.x,s[d++]=h.y,s[d++]=h.z)}return Ose(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Hse(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,d=o,u=o,h=0;s&&(c=1,u-=1,h+=1),a&&(d-=1,u-=1,h+=1),h+=r*u;let p=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,f=0,x=0,_=Gz,C=wAe,V=Number.MAX_VALUE,L=Number.MAX_VALUE,R=-Number.MAX_VALUE,G=-Number.MAX_VALUE;for(let Z=c;Z<d;++Z)for(let E=0;E<r;++E)Ls.computePosition(t,i,n.st,Z,E,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(g[x++]=C.x,g[x++]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),R=Math.max(R,C.x),G=Math.max(G,C.y));if(s&&(Ls.computePosition(t,i,n.st,0,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(g[x++]=C.x,g[x++]=C.y,V=C.x,L=C.y,R=C.x,G=C.y)),a&&(Ls.computePosition(t,i,n.st,o-1,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(g[x++]=C.x,g[x]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),R=Math.max(R,C.x),G=Math.max(G,C.y))),n.st&&(V<0||L<0||R>1||G>1))for(let Z=0;Z<g.length;Z+=2)g[Z]=(g[Z]-V)/(R-V),g[Z+1]=(g[Z+1]-L)/(G-L);let I=MAe(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(u-1);s&&(v+=3*(r-1)),a&&(v+=3*(r-1));let P=Ae.createTypedArray(h,v),w=0,M=0,b;for(b=0;b<u-1;++b){for(let Z=0;Z<r-1;++Z){let E=w,X=E+r,F=X+1,N=E+1;P[M++]=E,P[M++]=X,P[M++]=N,P[M++]=N,P[M++]=X,P[M++]=F,++w}++w}if(s||a){let Z=h-1,E=h-1;s&&a&&(Z=h-2);let X,F;if(w=0,s)for(b=0;b<r-1;b++)X=w,F=X+1,P[M++]=Z,P[M++]=X,P[M++]=F,++w;if(a)for(w=(u-1)*r,b=0;b<r-1;b++)X=w,F=X+1,P[M++]=X,P[M++]=E,P[M++]=F,++w}return I.indices=P,n.st&&(I.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),I}function OC(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function YC(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var Iz=new Xe;function kAe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,d=t.width,u;if(n){let ke=Xe.clone(o,Iz);ke.normal=!0,e._vertexFormat=ke}let h=Hse(e,t);n&&(e._vertexFormat=o);let p=ii.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,f=g*2,x=new Float64Array(f);x.set(p);let _=ii.scaleToGeodeticHeight(h.attributes.position.values,r,a);x.set(_,g),h.attributes.position.values=x;let C=o.normal?new Float32Array(f):void 0,V=o.tangent?new Float32Array(f):void 0,L=o.bitangent?new Float32Array(f):void 0,R=o.st?new Float32Array(f/3*2):void 0,G,I;if(o.normal){for(I=h.attributes.normal.values,C.set(I),u=0;u<g;u++)I[u]=-I[u];C.set(I,g),h.attributes.normal.values=C}if(n){I=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let ke=new Float32Array(f);for(u=0;u<g;u++)I[u]=-I[u];ke.set(I,g),h.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:ke})}let v,P=l(i);if(P){let ke=g/3*2,zt=new Uint8Array(ke);i===rn.TOP?zt=zt.fill(1,0,ke/2):(v=i===rn.NONE?0:1,zt=zt.fill(v)),h.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:zt})}if(o.tangent){let ke=h.attributes.tangent.values;for(V.set(ke),u=0;u<g;u++)ke[u]=-ke[u];V.set(ke,g),h.attributes.tangent.values=V}if(o.bitangent){let ke=h.attributes.bitangent.values;L.set(ke),L.set(ke,g),h.attributes.bitangent.values=L}o.st&&(G=h.attributes.st.values,R.set(G),R.set(G,g/3*2),h.attributes.st.values=R);let w=h.indices,M=w.length,b=g/3,Z=Ae.createTypedArray(f/3,M*2);for(Z.set(w),u=0;u<M;u+=3)Z[u+M]=w[u+2]+b,Z[u+1+M]=w[u+1]+b,Z[u+2+M]=w[u]+b;h.indices=Z;let E=t.northCap,X=t.southCap,F=c,N=2,O=0,U=4,Y=4;E&&(N-=1,F-=1,O+=1,U-=2,Y-=1),X&&(N-=1,F-=1,O+=1,U-=2,Y-=1),O+=N*d+2*F-U;let k=(O+Y)*2,H=new Float64Array(k*3),K=n?new Float32Array(k*3):void 0,te=P?new Uint8Array(k):void 0,z=o.st?new Float32Array(k*2):void 0,j=i===rn.TOP;P&&!j&&(v=i===rn.ALL?1:0,te=te.fill(v));let ee=0,fe=0,Te=0,de=0,xe=d*F,Ce;for(u=0;u<xe;u+=d)Ce=u*3,H=OC(H,ee,Ce,p,_),ee+=6,o.st&&(z=YC(z,fe,u*2,G),fe+=4),n&&(Te+=3,K[Te++]=I[Ce],K[Te++]=I[Ce+1],K[Te++]=I[Ce+2]),j&&(te[de++]=1,de+=1);if(X){let ke=E?xe+1:xe;for(Ce=ke*3,u=0;u<2;u++)H=OC(H,ee,Ce,p,_),ee+=6,o.st&&(z=YC(z,fe,ke*2,G),fe+=4),n&&(Te+=3,K[Te++]=I[Ce],K[Te++]=I[Ce+1],K[Te++]=I[Ce+2]),j&&(te[de++]=1,de+=1)}else for(u=xe-d;u<xe;u++)Ce=u*3,H=OC(H,ee,Ce,p,_),ee+=6,o.st&&(z=YC(z,fe,u*2,G),fe+=4),n&&(Te+=3,K[Te++]=I[Ce],K[Te++]=I[Ce+1],K[Te++]=I[Ce+2]),j&&(te[de++]=1,de+=1);for(u=xe-1;u>0;u-=d)Ce=u*3,H=OC(H,ee,Ce,p,_),ee+=6,o.st&&(z=YC(z,fe,u*2,G),fe+=4),n&&(Te+=3,K[Te++]=I[Ce],K[Te++]=I[Ce+1],K[Te++]=I[Ce+2]),j&&(te[de++]=1,de+=1);if(E){let ke=xe;for(Ce=ke*3,u=0;u<2;u++)H=OC(H,ee,Ce,p,_),ee+=6,o.st&&(z=YC(z,fe,ke*2,G),fe+=4),n&&(Te+=3,K[Te++]=I[Ce],K[Te++]=I[Ce+1],K[Te++]=I[Ce+2]),j&&(te[de++]=1,de+=1)}else for(u=d-1;u>=0;u--)Ce=u*3,H=OC(H,ee,Ce,p,_),ee+=6,o.st&&(z=YC(z,fe,u*2,G),fe+=4),n&&(Te+=3,K[Te++]=I[Ce],K[Te++]=I[Ce+1],K[Te++]=I[Ce+2]),j&&(te[de++]=1,de+=1);let Ie=NAe(H,o,a);o.st&&(Ie.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:z})),n&&(Ie.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:K})),P&&(Ie.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Le=Ae.createTypedArray(k,O*6),Ne,Oe,qe,Rt;g=H.length/3;let Lt=0;for(u=0;u<g-1;u+=2){Ne=u,Rt=(Ne+2)%g;let ke=m.fromArray(H,Ne*3,Ez),zt=m.fromArray(H,Rt*3,Yse);m.equalsEpsilon(ke,zt,W.EPSILON10)||(Oe=(Ne+1)%g,qe=(Oe+2)%g,Le[Lt++]=Ne,Le[Lt++]=Oe,Le[Lt++]=Rt,Le[Lt++]=Rt,Le[Lt++]=Oe,Le[Lt++]=qe)}return Ie.indices=Le,Ie=Fn.combineInstances([new Et({geometry:h}),new Et({geometry:Ie})]),Ie[0]}var UAe=[new m,new m,new m,new m],zse=new he,DAe=new he;function Xz(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=Ls.computeOptions(e,t,n,0,Bse,zse),s=r.height,a=r.width,c=UAe;return Ls.computePosition(r,i,!1,0,0,c[0]),Ls.computePosition(r,i,!1,0,a-1,c[1]),Ls.computePosition(r,i,!1,s-1,0,c[2]),Ls.computePosition(r,i,!1,s-1,a-1,c[3]),ce.fromCartesianArray(c,i,o)}function Rf(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ce.clone(t),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Xe.clone(y(e.vertexFormat,Xe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Rf.packedLength=ce.packedLength+ne.packedLength+Xe.packedLength+7;Rf.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Kse=new ce,Jse=ne.clone(ne.UNIT_SPHERE),gg={rectangle:Kse,ellipsoid:Jse,vertexFormat:Iz,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Rf.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,Kse);t+=ce.packedLength;let o=ne.unpack(e,t,Jse);t+=ne.packedLength;let r=Xe.unpack(e,t,Iz);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(gg.granularity=s,gg.height=a,gg.rotation=c,gg.stRotation=d,gg.extrudedHeight=u,gg.shadowVolume=h,gg.offsetAttribute=p===-1?void 0:p,new Rf(gg))};Rf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,W.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ne.default),r=y(e.rotation,0);return Xz(n,i,r,o,t)};var BAe=new $,Mse=new ve,OAe=new he;Rf.createGeometry=function(e){if(W.equalsEpsilon(e._rectangle.north,e._rectangle.south,W.EPSILON10)||W.equalsEpsilon(e._rectangle.east,e._rectangle.west,W.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Ls.computeOptions(t,e._granularity,i,o,Bse,zse,DAe),a=BAe;if(o!==0||i!==0){let g=ce.center(t,OAe),f=n.geodeticSurfaceNormalCartographic(g,Ez);ve.fromAxisAngle(f,-o,Mse),$.fromQuaternion(Mse,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,d=e._extrudedHeight,u=!W.equalsEpsilon(c,d,0,W.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,u){h=kAe(e,s);let g=le.fromRectangle3D(t,n,c,AAe),f=le.fromRectangle3D(t,n,d,FAe);p=le.union(g,f)}else{if(h=Hse(e,s),h.attributes.position.values=ii.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=h.attributes.position.values.length,f=e._offsetAttribute===rn.NONE?0:1,x=new Uint8Array(g/3).fill(f);h.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=le.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new lt({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Rf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Rf({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};var Nse=new ce,YAe=[new D,new D,new D],HAe=new Ii,zAe=new he;function KAe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,Nse),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=Xz(t,n,o,i,Nse),s=YAe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Ii.fromRotation(e._stRotation,HAe),d=ce.center(a,zAe);for(let f=0;f<3;++f){let x=s[f];x.x-=d.longitude,x.y-=d.latitude,Ii.multiplyByVector(c,x,x),x.x+=d.longitude,x.y+=d.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let u=s[0],h=s[1],p=s[2],g=new Array(6);return D.pack(u,g),D.pack(h,g,2),D.pack(p,g,4),g}Object.defineProperties(Rf.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=Xz(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=KAe(this)),this._textureCoordinateRotationPoints}}});var n_=Rf;var rln=T(S(),1);var JAe=new le,QAe=new le,jAe=new m,qAe=new ce;function Qse(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,d=0,u=4;r&&(c-=1,a-=1,d+=1,u-=2),s&&(c-=1,a-=1,d+=1,u-=2),d+=c*o+2*a-u;let h=new Float64Array(d*3),p=0,g=0,f,x=jAe;if(r)Ls.computePosition(t,n,!1,g,0,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;else for(f=0;f<o;f++)Ls.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(f=o-1,g=1;g<i;g++)Ls.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;if(g=i-1,!s)for(f=o-2;f>=0;f--)Ls.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(f=0,g=i-2;g>0;g--)Ls.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;let _=h.length/3*2,C=Ae.createTypedArray(h.length/3,_),V=0;for(let R=0;R<h.length/3-1;R++)C[V++]=R,C[V++]=R+1;C[V++]=h.length/3-1,C[V++]=0;let L=new lt({attributes:new mn,primitiveType:we.LINES});return L.attributes.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h}),L.indices=C,L}function $Ae(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Qse(e,t),s=t.height,a=t.width,c=ii.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let h=ii.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(h,d),r.attributes.position.values=u;let p=t.northCap,g=t.southCap,f=4;p&&(f-=1),g&&(f-=1);let x=(u.length/3+f)*2,_=Ae.createTypedArray(u.length/3,x);d=u.length/6;let C=0;for(let L=0;L<d-1;L++)_[C++]=L,_[C++]=L+1,_[C++]=L+d,_[C++]=L+d+1;_[C++]=d-1,_[C++]=0,_[C++]=d+d-1,_[C++]=d,_[C++]=0,_[C++]=d;let V;if(p)V=s-1;else{let L=a-1;_[C++]=L,_[C++]=L+d,V=a+s-2}if(_[C++]=V,_[C++]=V+d,!g){let L=a+V-1;_[C++]=L,_[C]=L+d}return r.indices=_,r}function zC(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,W.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ne.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}zC.packedLength=ce.packedLength+ne.packedLength+5;zC.pack=function(e,t,n){return n=y(n,0),ce.pack(e._rectangle,t,n),n+=ce.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var jse=new ce,qse=ne.clone(ne.UNIT_SPHERE),HC={rectangle:jse,ellipsoid:qse,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};zC.unpack=function(e,t,n){t=y(t,0);let i=ce.unpack(e,t,jse);t+=ce.packedLength;let o=ne.unpack(e,t,qse);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):(HC.granularity=r,HC.height=s,HC.rotation=a,HC.extrudedHeight=c,HC.offsetAttribute=d===-1?void 0:d,new zC(HC))};var e9e=new he;zC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ls.computeOptions(t,e._granularity,e._rotation,0,qAe,e9e),o,r;if(W.equalsEpsilon(t.north,t.south,W.EPSILON10)||W.equalsEpsilon(t.east,t.west,W.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!W.equalsEpsilon(s,a,0,W.EPSILON2),d;if(c){if(o=$Ae(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===rn.TOP?g=g.fill(1,0,p/2):(d=e._offsetAttribute===rn.NONE?0:1,g=g.fill(d)),o.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let u=le.fromRectangle3D(t,n,s,QAe),h=le.fromRectangle3D(t,n,a,JAe);r=le.union(u,h)}else{if(o=Qse(e,i),o.attributes.position.values=ii.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===rn.NONE?0:1;let h=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,s)}return new lt({attributes:o.attributes,indices:o.indices,primitiveType:we.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var i_=zC;var aln=T(S(),1),t9e={FIXED:0,INERTIAL:1},Ui=Object.freeze(t9e);var pln=T(S(),1);var o_=30,n9e=1<<o_,i9e=1<<o_+1>>>0,Wz=2*o_+1,yg=4,tae=[],nae=[],o9e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],xg=1,KC=2,ck=[xg,0,0,xg|KC];function $r(e){if(!Bt.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=$r.getLevel(e)}$r.fromToken=function(e){return new $r($r.getIdFromToken(e))};$r.isValidId=function(e){return!(e<=0||e>>BigInt(Wz)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};$r.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?$r.isValidId($r.getIdFromToken(e)):!1};$r.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};$r.getTokenFromId=function(e){let t=Math.floor(f9e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};$r.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return o_-(t>>1)};$r.prototype.getChild=function(e){let t=rae(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new $r(n)};$r.prototype.getParent=function(){let e=rae(this._cellId)<<BigInt(2);return new $r(this._cellId&~e+BigInt(1)|e)};$r.prototype.getParentAtLevel=function(e){let t=m9e(e);return new $r(this._cellId&-t|t)};$r.prototype.getCenter=function(e){e=y(e,ne.WGS84);let t=r9e(this._cellId,this._level);t=m.normalize(t,t);let n=new he.fromCartesian(t,ne.UNIT_SPHERE);return he.toCartesian(n,e,new m)};$r.prototype.getVertex=function(e,t){t=y(t,ne.WGS84);let n=s9e(this._cellId,this._level,e);n=m.normalize(n,n);let i=new he.fromCartesian(n,ne.UNIT_SPHERE);return he.toCartesian(i,t,new m)};$r.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(Wz-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new $r(a)};function r9e(e,t){let n=a9e(e,t);return c9e(n[0],n[1],n[2])}function s9e(e,t,n){let i=iae(e,t),o=l9e([i[1],i[2]],t),r=n>>1&1;return oae(i[0],o[0][r^n&1],o[1][r])}function a9e(e,t){let n=iae(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function iae(e){tae.length===0&&u9e();let t=Number(e>>BigInt(Wz)),n=t&xg,i=(1<<yg)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?o_-7*yg:yg))-1;n+=Number(e>>BigInt(s*2*yg+1)&BigInt(c))<<2,n=nae[n];let d=s*yg;o+=n>>yg+2<<d,r+=(n>>2&i)<<d,n&=xg|KC}return[t,o,r]}function c9e(e,t,n){let i=$se(t),o=$se(n),r=lk(i),s=lk(o);return oae(e,r,s)}function oae(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function lk(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function $se(e){return 1/i9e*e}function l9e(e,t){let n=[[],[]],i=d9e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=lk(eae(r)),n[o][1]=lk(eae(s))}return n}function d9e(e){return 1<<o_-e>>>0}function eae(e){return 1/n9e*e}function _g(e,t,n,i,o,r){if(e===yg){let s=(t<<yg)+n;tae[(s<<2)+i]=(o<<2)+r,nae[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=o9e[r];_g(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^ck[0]),_g(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^ck[1]),_g(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^ck[2]),_g(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^ck[3])}}function u9e(){_g(0,0,0,0,0,0),_g(0,0,0,xg,0,xg),_g(0,0,0,KC,0,KC),_g(0,0,0,xg|KC,0,xg|KC)}function rae(e){return e&~e+BigInt(1)}function m9e(e){return BigInt(1)<<BigInt(2*(o_-e))}var h9e=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function f9e(e){return h9e[(-e&e)%BigInt(67)]}var eb=$r;var Gln=T(S(),1);var gln=T(S(),1),p9e={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},xn=Object.freeze(p9e);function Tg(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function Mz(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function r_(e){if(e.shiftKey)return Ds.SHIFT;if(e.ctrlKey)return Ds.CTRL;if(e.altKey)return Ds.ALT}var Rs={LEFT:0,MIDDLE:1,RIGHT:2};function Sd(e,t,n,i){function o(r){i(e,r)}Bt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function b9e(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Bt.supportsPointerEvents()?(Sd(e,"pointerdown",t,S9e),Sd(e,"pointerup",t,pae),Sd(e,"pointermove",t,C9e),Sd(e,"pointercancel",t,pae)):(Sd(e,"mousedown",t,bae),Sd(e,"mouseup",n,gae),Sd(e,"mousemove",n,yae),Sd(e,"touchstart",t,_9e),Sd(e,"touchend",n,dae),Sd(e,"touchmove",n,T9e),Sd(e,"touchcancel",n,dae)),Sd(e,"dblclick",t,y9e);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Sd(e,i,t,x9e)}function g9e(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var sae={position:new D};function Nz(e){e._lastSeenTouchEvent=xi()}function kz(e){return xi()-e._lastSeenTouchEvent>Hm.mouseEmulationIgnoreMilliseconds}function Az(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function bae(e,t){if(!kz(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Rs.LEFT)i=xn.LEFT_DOWN;else if(n===Rs.MIDDLE)i=xn.MIDDLE_DOWN;else if(n===Rs.RIGHT)i=xn.RIGHT_DOWN;else return;let o=Tg(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=r_(t),s=e.getInputAction(i,r);l(s)&&(D.clone(o,sae.position),s(sae),t.preventDefault())}var aae={position:new D},cae={position:new D};function Pz(e,t,n,i){let o=r_(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Tg(e,i,e._primaryPosition);if(l(r)&&(D.clone(a,aae.position),r(aae)),l(s)){let c=e._primaryStartPosition;Az(c,a,e._clickPixelTolerance)&&(D.clone(a,cae.position),s(cae))}}}function gae(e,t){if(!kz(e))return;let n=t.button;n!==Rs.LEFT&&n!==Rs.MIDDLE&&n!==Rs.RIGHT||(e._buttonDown[Rs.LEFT]&&(Pz(e,xn.LEFT_UP,xn.LEFT_CLICK,t),e._buttonDown[Rs.LEFT]=!1),e._buttonDown[Rs.MIDDLE]&&(Pz(e,xn.MIDDLE_UP,xn.MIDDLE_CLICK,t),e._buttonDown[Rs.MIDDLE]=!1),e._buttonDown[Rs.RIGHT]&&(Pz(e,xn.RIGHT_UP,xn.RIGHT_CLICK,t),e._buttonDown[Rs.RIGHT]=!1))}var vz={startPosition:new D,endPosition:new D};function yae(e,t){if(!kz(e))return;let n=r_(t),i=Tg(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(xn.MOUSE_MOVE,n);l(r)&&(D.clone(o,vz.startPosition),D.clone(i,vz.endPosition),r(vz)),D.clone(i,o),(e._buttonDown[Rs.LEFT]||e._buttonDown[Rs.MIDDLE]||e._buttonDown[Rs.RIGHT])&&t.preventDefault()}var lae={position:new D};function y9e(e,t){let n=t.button,i;if(n===Rs.LEFT)i=xn.LEFT_DOUBLE_CLICK;else return;let o=r_(t),r=e.getInputAction(i,o);l(r)&&(Tg(e,t,lae.position),r(lae))}function x9e(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=r_(t),o=e.getInputAction(xn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function _9e(e,t){Nz(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,Tg(e,r,new D));dk(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,D.clone(a.get(s)))}function dae(e,t){Nz(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);dk(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var uae={position:new D},wz={position1:new D,position2:new D},mae={position:new D},hae={position:new D},fae={position:new D};function dk(e,t){let n=r_(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Rs.LEFT]){if(e._buttonDown[Rs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(xn.LEFT_UP,n),l(r)&&(D.clone(e._primaryPosition,mae.position),r(mae)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(xn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Az(c,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,hae.position),s(hae))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(xn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];D.clone(c,e._primaryPosition),D.clone(c,e._primaryStartPosition),D.clone(c,e._primaryPreviousPosition),e._buttonDown[Rs.LEFT]=!0,r=e.getInputAction(xn.LEFT_DOWN,n),l(r)&&(D.clone(c,uae.position),r(uae)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(xn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];Az(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,fae.position),s(fae))}},Hm.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(xn.PINCH_START,n),l(r)&&(D.clone(i.values[0],wz.position1),D.clone(i.values[1],wz.position2),r(wz),t.preventDefault()))}function T9e(e,t){Nz(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&Tg(e,r,d)}xae(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),c.get(s))}var Fz={startPosition:new D,endPosition:new D},xI={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function xae(e,t){let n=r_(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Rs.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(xn.MOUSE_MOVE,n),l(s)&&(D.clone(c,Fz.startPosition),D.clone(a,Fz.endPosition),s(Fz)),D.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(xn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],h=c.x-a.x,p=c.y-a.y,g=Math.sqrt(h*h+p*p)*.25,f=u.x-d.x,x=u.y-d.y,_=Math.sqrt(f*f+x*x)*.25,C=(c.y+a.y)*.125,V=(u.y+d.y)*.125,L=Math.atan2(p,h),R=Math.atan2(x,f);D.fromElements(0,_,xI.distance.startPosition),D.fromElements(0,g,xI.distance.endPosition),D.fromElements(R,V,xI.angleAndHeight.startPosition),D.fromElements(L,C,xI.angleAndHeight.endPosition),s(xI)}}function S9e(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Tg(e,t,new D)),dk(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else bae(e,t)}function pae(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),dk(e,t),e._previousPositions.remove(i)}else gae(e,t)}function C9e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Tg(e,t,o),xae(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else yae(e,t)}function Hm(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Hm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Gt,this._previousPositions=new Gt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),b9e(this)}Hm.prototype.setInputAction=function(e,t,n){let i=Mz(t,n);this._inputEvents[i]=e};Hm.prototype.getInputAction=function(e,t){let n=Mz(e,t);return this._inputEvents[n]};Hm.prototype.removeInputAction=function(e,t){let n=Mz(e,t);delete this._inputEvents[n]};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){return g9e(this),me(this)};Hm.mouseEmulationIgnoreMilliseconds=800;Hm.touchHoldDelayMilliseconds=1500;var Cd=Hm;var Pln=T(S(),1);function uk(e){e=y(e,!0),this.value=uk.toValue(e)}Object.defineProperties(uk.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});uk.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var _n=uk;var Qln=T(S(),1);function V9e(e,t,n,i,o,r,s){let a=vi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,h=n.blue,p=n.alpha,g=i.red,f=i.green,x=i.blue,_=i.alpha;if(B.equals(n,i)){for(c=0;c<a;c++)r[s++]=B.floatToByte(d),r[s++]=B.floatToByte(u),r[s++]=B.floatToByte(h),r[s++]=B.floatToByte(p);return s}let C=(g-d)/a,V=(f-u)/a,L=(x-h)/a,R=(_-p)/a,G=s;for(c=0;c<a;c++)r[G++]=B.floatToByte(d+c*C),r[G++]=B.floatToByte(u+c*V),r[G++]=B.floatToByte(h+c*L),r[G++]=B.floatToByte(p+c*R);return G}function _I(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,en.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ne.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*B.packedLength:1,this.packedLength=o+ne.packedLength+3}_I.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};_I.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new _I({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var mk=new Array(2),hk=new Array(2),L9e={positions:mk,height:hk,ellipsoid:void 0,minDistance:void 0,granularity:void 0};_I.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,h,p,g,f,x=0;if(o===en.GEODESIC||o===en.RHUMB){let R,G,I;o===en.GEODESIC?(R=W.chordLength(r,s.maximumRadius),G=vi.numberOfPoints,I=vi.generateArc):(R=r,G=vi.numberOfPointsRhumbLine,I=vi.generateRhumbArc);let v=vi.extractHeights(t,s),P=L9e;if(o===en.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let w=0;for(d=0;d<u-1;d++)w+=G(t[d],t[d+1],R)+1;h=new Float64Array(w*3),g=new Uint8Array(w*4),P.positions=mk,P.height=hk;let M=0;for(d=0;d<u-1;++d){mk[0]=t[d],mk[1]=t[d+1],hk[0]=v[d],hk[1]=v[d+1];let b=I(P);if(l(n)){let Z=b.length/3;f=n[d];for(let E=0;E<Z;++E)g[M++]=B.floatToByte(f.red),g[M++]=B.floatToByte(f.green),g[M++]=B.floatToByte(f.blue),g[M++]=B.floatToByte(f.alpha)}h.set(b,x),x+=b.length}}else if(P.positions=t,P.height=v,h=new Float64Array(I(P)),l(n)){for(g=new Uint8Array(h.length/3*4),d=0;d<u-1;++d){let M=t[d],b=t[d+1],Z=n[d],E=n[d+1];x=V9e(M,b,Z,E,a,g,x)}let w=n[u-1];g[x++]=B.floatToByte(w.red),g[x++]=B.floatToByte(w.green),g[x++]=B.floatToByte(w.blue),g[x++]=B.floatToByte(w.alpha)}}else{p=c?u*2-2:u,h=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let R=0,G=0;for(d=0;d<u;++d){let I=t[d];if(c&&d>0&&(m.pack(I,h,R),R+=3,f=n[d-1],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha)),c&&d===u-1)break;m.pack(I,h,R),R+=3,l(n)&&(f=n[d],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha))}}let _=new mn;_.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(_.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let C=(p-1)*2,V=Ae.createTypedArray(p,C),L=0;for(d=0;d<p-1;++d)V[L++]=d,V[L++]=d+1;return new lt({attributes:_,indices:V,primitiveType:we.LINES,boundingSphere:le.fromPoints(t)})};var Uz=_I;var idn=T(S(),1);function JC(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Us(i),this._workerName="createSphereGeometry"}JC.packedLength=Us.packedLength;JC.pack=function(e,t,n){return Us.pack(e._ellipsoidGeometry,t,n)};var R9e=new Us,Sg={radius:void 0,radii:new m,vertexFormat:new Xe,stackPartitions:void 0,slicePartitions:void 0};JC.unpack=function(e,t,n){let i=Us.unpack(e,t,R9e);return Sg.vertexFormat=Xe.clone(i._vertexFormat,Sg.vertexFormat),Sg.stackPartitions=i._stackPartitions,Sg.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,Sg.radii),n._ellipsoidGeometry=new Us(Sg),n):(Sg.radius=i._radii.x,new JC(Sg))};JC.createGeometry=function(e){return Us.createGeometry(e._ellipsoidGeometry)};var Dz=JC;var ldn=T(S(),1);function QC(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new xd(i),this._workerName="createSphereOutlineGeometry"}QC.packedLength=xd.packedLength;QC.pack=function(e,t,n){return xd.pack(e._ellipsoidGeometry,t,n)};var Z9e=new xd,s_={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};QC.unpack=function(e,t,n){let i=xd.unpack(e,t,Z9e);return s_.stackPartitions=i._stackPartitions,s_.slicePartitions=i._slicePartitions,s_.subdivisions=i._subdivisions,l(n)?(m.clone(i._radii,s_.radii),n._ellipsoidGeometry=new xd(s_),n):(s_.radius=i._radii.x,new QC(s_))};QC.createGeometry=function(e){return xd.createGeometry(e._ellipsoidGeometry)};var tb=QC;var hdn=T(S(),1);function hc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}hc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new hc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};hc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new hc(e.clock,e.cone,e.magnitude)};hc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new hc(e.clock,e.cone,1)};hc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};hc.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};hc.prototype.equals=function(e){return hc.equals(this,e)};hc.prototype.clone=function(e){return hc.clone(this,e)};hc.prototype.equalsEpsilon=function(e,t){return hc.equalsEpsilon(this,e,t)};hc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var TI=hc;var ydn=T(S(),1);function jC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=no.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(jC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});jC.prototype.findTimeInterval=no.prototype.findTimeInterval;jC.prototype.wrapTime=no.prototype.wrapTime;jC.prototype.clampTime=no.prototype.clampTime;jC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var SI=jC;var _dn=T(S(),1),G9e={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=G9e;var Cdn=T(S(),1);function Cg(e){}Object.defineProperties(Cg.prototype,{ellipsoid:{get:pe.throwInstantiationError},rectangle:{get:pe.throwInstantiationError},projection:{get:pe.throwInstantiationError}});Cg.prototype.getNumberOfXTilesAtLevel=pe.throwInstantiationError;Cg.prototype.getNumberOfYTilesAtLevel=pe.throwInstantiationError;Cg.prototype.rectangleToNativeRectangle=pe.throwInstantiationError;Cg.prototype.tileXYToNativeRectangle=pe.throwInstantiationError;Cg.prototype.tileXYToRectangle=pe.throwInstantiationError;Cg.prototype.positionToTileXY=pe.throwInstantiationError;var Bz=Cg;var vdn=T(S(),1);function Hz(e,t){return q.compare(e.start,t.start)}function Mr(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Mr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Mr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Mr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Ln.equals(n[r],i[r],t))return!1;return!0};Mr.prototype.get=function(e){return this._intervals[e]};Mr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Mr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Mr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Mr.prototype.contains=function(e){return this.indexOf(e)>=0};var Oz=new Ln;Mr.prototype.indexOf=function(e){let t=this._intervals;Oz.start=e,Oz.stop=e;let n=Xo(t,Oz,Hz);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Ln.contains(t[n-1],e)?n-1:~n)};Mr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Mr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Xo(n,e,Hz);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(q.greaterThan(e.stop,n[i-1].stop)?e=new Ln({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Ln({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Ln({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Ln({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=q.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Ln({start:e.start,stop:q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Ln({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Mr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Xo(t,e,Hz);n<0&&(n=~n);let i=!1;for(n>0&&(q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Ln({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Ln({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Ln({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&q.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Ln({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Ln({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(q.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Ln({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Mr.prototype.intersect=function(e,t,n){let i=new Mr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(q.lessThan(c.stop,d.start))++o;else if(q.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Ln.intersect(c,d,new Ln,n);u.isEmpty||i.addInterval(u,t)}q.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Mr.fromJulianDateArray=function(e,t){l(t)||(t=new Mr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),d,u=0;a&&(++u,d=new Ln({start:Be.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let h=0;h<i-1;++h){let p=n[h],g=n[h+1];d=new Ln({start:p,stop:g,isStartIncluded:t.length===u?r:!0,isStopIncluded:h===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d),p=g}return c&&(d=new Ln({start:n[i-1],stop:Be.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var fc=new Sp,CI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Yz(e,t,n){l(n)||(n=new q),q.toGregorianDate(e,fc);let i=fc.millisecond+t.millisecond,o=fc.second+t.second,r=fc.minute+t.minute,s=fc.hour+t.hour,a=fc.day+t.day,c=fc.month+t.month,d=fc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),CI[2]=Lm(d)?29:28;a>CI[c]||c>=13;)a>CI[c]&&(a-=CI[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),CI[2]=Lm(d)?29:28;return fc.millisecond=i,fc.second=o,fc.minute=r,fc.hour=s,fc.day=a,fc.month=c,fc.year=d,q.fromGregorianDate(fc,n)}var E9e=new q,I9e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function _ae(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(I9e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),q.toGregorianDate(q.fromIso8601(e,E9e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var VI=new Sp;Mr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=[];if(!_ae(n[2],VI))r.push(i,o);else{let s=q.clone(i);for(r.push(s);q.compare(s,o)<0;)s=Yz(s,VI),q.compare(o,s)<=0&&q.clone(o,s),r.push(s)}return Mr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Mr.fromIso8601DateArray=function(e,t){return Mr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Mr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let d=0;d<c;++d)(_ae(i[d],VI)||d===0)&&(o&&l(a)?s=Yz(a,VI):s=Yz(n,VI),r.push(s),a=s);return Mr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Nr=Mr;var Fdn=T(S(),1),X9e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},nb=Object.freeze(X9e);var Ddn=T(S(),1);var W9e=new m(1,1,1),P9e=m.ZERO,v9e=ve.IDENTITY;function Tae(e,t,n){this.translation=m.clone(y(e,P9e)),this.rotation=ve.clone(y(t,v9e)),this.scale=m.clone(y(n,W9e))}Tae.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&ve.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var Vg=Tae;var oun=T(S(),1);function w9e(e,t){this.rectangle=e,this.maxLevel=t}function Sae(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Sae.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function F9e(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Hi({ellipsoid:e.ellipsoid});else throw new ae(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=jr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new w9e(new ce(a,c,d,u),h))}}function A9e(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Co.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function M9e(e,t,n){try{let i=await t.fetchXML();F9e(e,i)}catch(i){A9e(t,i,n)}}function Lg(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Lg.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Lg.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new Sae(t),i=Ze.createIfNeeded(e);await M9e(n,i);let o=new Lg(t);return n.build(o),o._resource=i,o};Lg.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Xa({buffer:Rm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:N9e(a,e,t,n),structure:a._terrainDataStructure})})};Lg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Cae=new ce;function N9e(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,h=ce.intersection(u,s,Cae);l(h)&&(fk(o,u,t*2,n*2,i+1)&&(a|=4),fk(o,u,t*2+1,n*2,i+1)&&(a|=8),fk(o,u,t*2,n*2+1,i+1)&&(a|=1),fk(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function fk(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,Cae))}Lg.prototype.getTileDataAvailable=function(e,t,n){};Lg.prototype.loadTileDataAvailability=function(e,t,n){};var zz=Lg;var uun=T(S(),1);function a_(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Be.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(a_.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(a_.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=k9e(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});a_.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};a_.prototype.isDestroyed=function(){return!1};a_.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};a_.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,Be.MINIMUM_VALUE),s=q.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?y(this.tolerance,1):.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function k9e(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Kz=a_;var hun=T(S(),1),U9e={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},Jz=Object.freeze(U9e);var Aun=T(S(),1);var Tun=T(S(),1);var Vae={};function D9e(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var B9e=new he,O9e=new he;function Y9e(e,t,n,i){t=To(t,m.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),d=new Array(o),u=t[0];a[0]=u;let h=e.cartesianToCartographic(u,B9e);s&&(h.height=n[0]),c[0]=h.height,r?d[0]=i[0]:d[0]=0;let p=c[0],g=d[0],f=p===g,x=1;for(let _=1;_<o;++_){let C=t[_],V=e.cartesianToCartographic(C,O9e);s&&(V.height=n[_]),f=f&&V.height===0,D9e(h,V)?h.height<V.height&&(c[x-1]=V.height):(a[x]=C,c[x]=V.height,r?d[x]=i[_]:d[x]=0,f=f&&c[x]===d[x],he.clone(V,h),++x)}if(!(f||x<2))return a.length=x,c.length=x,d.length=x,{positions:a,topHeights:c,bottomHeights:d}}var H9e=new Array(2),z9e=new Array(2),K9e={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Vae.computePositions=function(e,t,n,i,o,r){let s=Y9e(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,d,u,h=W.chordLength(o,e.maximumRadius),p=K9e;if(p.minDistance=h,p.ellipsoid=e,r){let g=0,f;for(f=0;f<a-1;f++)g+=vi.numberOfPoints(t[f],t[f+1],h)+1;d=new Float64Array(g*3),u=new Float64Array(g*3);let x=H9e,_=z9e;p.positions=x,p.height=_;let C=0;for(f=0;f<a-1;f++){x[0]=t[f],x[1]=t[f+1],_[0]=n[f],_[1]=n[f+1];let V=vi.generateArc(p);d.set(V,C),_[0]=i[f],_[1]=i[f+1],u.set(vi.generateArc(p),C),C+=V.length}}else p.positions=t,p.height=n,d=new Float64Array(vi.generateArc(p)),p.height=i,u=new Float64Array(vi.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var c_=Vae;var Qz=new m,pk=new m,J9e=new m,Lae=new m,Q9e=new m,j9e=new m,q9e=new m;function l_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Xe.DEFAULT),r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ne.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Xe.clone(o),this._granularity=r,this._ellipsoid=ne.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ne.packedLength+Xe.packedLength+1}l_.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n]=e._granularity,t};var Rae=ne.clone(ne.UNIT_SPHERE),Zae=new Xe,LI={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Rae,vertexFormat:Zae,granularity:void 0};l_.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,Rae);t+=ne.packedLength;let d=Xe.unpack(e,t,Zae);t+=Xe.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._vertexFormat=Xe.clone(d,n._vertexFormat),n._granularity=u,n):(LI.positions=r,LI.minimumHeights=s,LI.maximumHeights=a,LI.granularity=u,new l_(LI))};l_.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new l_(c)};l_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=c_.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,h=d.length,p=h*2,g=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,_=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,V=0,L=0,R=0,G=0,I=0,v=q9e,P=j9e,w=Q9e,M=!0;h/=3;let b,Z=0,E=1/(h-u-1);for(b=0;b<h;++b){let U=b*3,Y=m.fromArray(d,U,Qz),k=m.fromArray(c,U,pk);if(o.position&&(g[V++]=k.x,g[V++]=k.y,g[V++]=k.z,g[V++]=Y.x,g[V++]=Y.y,g[V++]=Y.z),o.st&&(C[I++]=Z,C[I++]=0,C[I++]=Z,C[I++]=1),o.normal||o.tangent||o.bitangent){let H=m.clone(m.ZERO,Lae),K=m.subtract(Y,s.geodeticSurfaceNormal(Y,pk),pk);if(b+1<h&&(H=m.fromArray(d,U+3,Lae)),M){let te=m.subtract(H,Y,J9e),z=m.subtract(K,Y,Qz);v=m.normalize(m.cross(z,te,v),v),M=!1}m.equalsEpsilon(Y,H,W.EPSILON10)?M=!0:(Z+=E,o.tangent&&(P=m.normalize(m.subtract(H,Y,P),P)),o.bitangent&&(w=m.normalize(m.cross(v,P,w),w))),o.normal&&(f[L++]=v.x,f[L++]=v.y,f[L++]=v.z,f[L++]=v.x,f[L++]=v.y,f[L++]=v.z),o.tangent&&(x[G++]=P.x,x[G++]=P.y,x[G++]=P.z,x[G++]=P.x,x[G++]=P.y,x[G++]=P.z),o.bitangent&&(_[R++]=w.x,_[R++]=w.y,_[R++]=w.z,_[R++]=w.x,_[R++]=w.y,_[R++]=w.z)}}let X=new mn;o.position&&(X.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(X.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(X.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(X.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(X.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C}));let F=p/3;p-=6*(u+1);let N=Ae.createTypedArray(F,p),O=0;for(b=0;b<F-2;b+=2){let U=b,Y=b+2,k=m.fromArray(g,U*3,Qz),H=m.fromArray(g,Y*3,pk);if(m.equalsEpsilon(k,H,W.EPSILON10))continue;let K=b+1,te=b+3;N[O++]=K,N[O++]=U,N[O++]=te,N[O++]=te,N[O++]=U,N[O++]=Y}return new lt({attributes:X,indices:N,primitiveType:we.TRIANGLES,boundingSphere:new le.fromVertices(g)})};var RI=l_;var qun=T(S(),1);var Gae=new m,Eae=new m;function d_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,W.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ne.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ne.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ne.packedLength+1}d_.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n]=e._granularity,t};var Iae=ne.clone(ne.UNIT_SPHERE),ZI={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Iae,granularity:void 0};d_.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,Iae);t+=ne.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._granularity=d,n):(ZI.positions=r,ZI.minimumHeights=s,ZI.maximumHeights=a,ZI.granularity=d,new d_(ZI))};d_.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new d_(c)};d_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=c_.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,h=new Float64Array(u),p=0;d/=3;let g;for(g=0;g<d;++g){let V=g*3,L=m.fromArray(c,V,Gae),R=m.fromArray(a,V,Eae);h[p++]=R.x,h[p++]=R.y,h[p++]=R.z,h[p++]=L.x,h[p++]=L.y,h[p++]=L.z}let f=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h})}),x=u/3;u=2*x-4+x;let _=Ae.createTypedArray(x,u),C=0;for(g=0;g<x-2;g+=2){let V=g,L=g+2,R=m.fromArray(h,V*3,Gae),G=m.fromArray(h,L*3,Eae);if(m.equalsEpsilon(R,G,W.EPSILON10))continue;let I=g+1,v=g+3;_[C++]=I,_[C++]=V,_[C++]=I,_[C++]=v,_[C++]=V,_[C++]=L}return _[C++]=x-2,_[C++]=x-1,new lt({attributes:f,indices:_,primitiveType:we.LINES,boundingSphere:new le.fromVertices(h)})};var GI=d_;var imn=T(S(),1);var jz={};function $9e(e){let t=Ae.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function eMe(e,t){let n=t.length,i=Ae.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function tMe(e){let t=e-2,n=2+t*4,i=Ae.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function nMe(e,t){let i=t.length-2,o=2+i*4,r=Ae.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function iMe(e){let t=e-2,n=2+t*4,i=Ae.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function oMe(e,t){let i=t.length-2,o=2+i*4,r=Ae.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}jz.createWireframeIndices=function(e,t,n){let i=l(n);if(e===we.TRIANGLES)return i?eMe(t,n):$9e(t);if(e===we.TRIANGLE_STRIP)return i?nMe(t,n):tMe(t);if(e===we.TRIANGLE_FAN)return i?oMe(t,n):iMe(t)};jz.getWireframeIndicesCount=function(e,t){return e===we.TRIANGLES?t*2:e===we.TRIANGLE_STRIP||e===we.TRIANGLE_FAN?2+(t-2)*4:t};var qC=jz;var amn=T(S(),1);function rMe(e){return e=y(e,y.EMPTY_OBJECT),Xx.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var EI=rMe;var mmn=T(S(),1);function sMe(e){return e=y(e,y.EMPTY_OBJECT),Xx.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ne.WGS84})}var u_=sMe;var pmn=T(S(),1);var aMe=1953029805,cMe=2917034100;function qz(e,t){if(qz.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ae("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===aMe||o===cMe)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,h=8;for(;s<c;)for(h=(h+8)%24,u=h;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(h=(h+8)%24,u=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}qz.passThroughDataForTesting=!1;var II=qz;var Tmn=T(S(),1);var $z=32767,lMe=new he,dMe=new m;function uMe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);wn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let h=s[u],p=a[u],g=c[u],f=W.lerp(t.west,t.east,h/$z),x=W.lerp(t.south,t.north,p/$z),_=W.lerp(n,i,g/$z),C=he.fromRadians(f,x,_,lMe),V=o.cartographicToCartesian(C,dMe);m.pack(V,d,u*3)}return d}var XI=uMe;var Vmn=T(S(),1);function mMe(e,t){_t(e,t)}var wa=mMe;var Rmn=T(S(),1),Xae=T(dd(),1);function hMe(e){let t=new Xae.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var ib=hMe;var Gmn=T(S(),1);function fMe(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var WI=fMe;var Wmn=T(S(),1);function pMe(e,t){return t=y(t,0),Pl(e,t,Math.min(4,e.length))}var zm=pMe;var Amn=T(S(),1);function bMe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ze.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ze.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ze({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var m_=bMe;var Nmn=T(S(),1);var eK=[],tK=[];function gMe(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=eK,d=tK,u,h;for(u=0;u<s;++u)c[u]=e[i+u];for(h=0;h<a;++h)d[h]=e[o+h+1];u=0,h=0;for(let p=i;p<=r;++p){let g=c[u],f=d[h];u<s&&(h>=a||t(g,f,n)<=0)?(e[p]=g,++u):h<a&&(e[p]=f,++h)}}function nK(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);nK(e,t,n,i,r),nK(e,t,n,r+1,o),gMe(e,t,n,i,r,o)}function yMe(e,t,n){let i=e.length,o=Math.ceil(i*.5);eK.length=o,tK.length=o,nK(e,t,n,0,i-1),eK.length=0,tK.length=0}var ob=yMe;var Omn=T(S(),1);var xMe=new m;function _Me(e,t,n,i){let o=fx(e,t,n,i,xMe);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var iK=_Me;var zmn=T(S(),1);function TMe(e){let t=document.createElement("canvas");return t.width=W.nextPowerOfTwo(e.width),t.height=W.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Rg=TMe;var Qmn=T(S(),1);async function SMe(e,t,n,i){return l(i)||(i=!1),LMe(e,t,n,i)}function CMe(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(Pae(i)):r=o.then(Pae(i)).catch(RMe(i)),e.shift(),t.push(r),!0}function VMe(e){return new Promise(function(t){setTimeout(t,e)})}function oK(e,t,n){return e.length?CMe(e,t,n)?oK(e,t,n):VMe(100).then(()=>oK(e,t,n)):Promise.resolve()}function LMe(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let h={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=h,s.push(h)}a[u].positions.push(n[r])}let c=[];return oK(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Wae(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Pae(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!Wae(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];Wae(s,i,n)}}):Promise.resolve()}}function RMe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var PI=SMe;var thn=T(S(),1);var rK=new D;async function vae(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,rK);let p=e.loadTileDataAvailability(rK.x,rK.y,1);l(p)&&s.push(p)}let h=i[u];l(h)||(i[u]=h=[]),h.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return PI(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await vae(e,a,n),t}var h_=vae;var ihn=T(S(),1);function ZMe(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var f_=ZMe;var rhn=T(S(),1);function GMe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var vI=GMe;var chn=T(S(),1);function EMe(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var sK=EMe;var dhn=T(S(),1);function IMe(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var wI=IMe;var Lhn=T(S(),1);var xhn=T(S(),1);var fhn=T(S(),1);function Zg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(Zg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Zg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Zg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Zg.prototype.equals=function(e){return this===e||e instanceof Zg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Zg.prototype.valueOf=function(){return this._value};Zg.prototype.toString=function(){return String(this._value)};var Qn=Zg;function XMe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function WMe(e){return new Qn(e)}function PMe(e,t,n){return XMe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,WMe))}var ue=PMe;function FI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(FI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),image:ue("image"),scale:ue("scale"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),color:ue("color"),rotation:ue("rotation"),alignedAxis:ue("alignedAxis"),sizeInMeters:ue("sizeInMeters"),width:ue("width"),height:ue("height"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),imageSubRegion:ue("imageSubRegion"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});FI.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new FI(this)};FI.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var pc=FI;var ifn=T(S(),1);var Zhn=T(S(),1),p_={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Je=Object.freeze(p_);function Mu(e){return e===p_.CLAMP_TO_GROUND||e===p_.CLAMP_TO_3D_TILE||e===p_.CLAMP_TO_TERRAIN}function $C(e){return e===p_.RELATIVE_TO_GROUND||e===p_.RELATIVE_TO_3D_TILE||e===p_.RELATIVE_TO_TERRAIN}var Ehn=T(S(),1),vMe={CENTER:0,LEFT:1,RIGHT:-1},_i=Object.freeze(vMe);var Xhn=T(S(),1),wMe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},An=Object.freeze(wMe);var Phn=T(S(),1),FMe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),dt=FMe;var Mhn=T(S(),1);function Km(){pe.throwInstantiationError()}Object.defineProperties(Km.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Km.prototype.getValue=pe.throwInstantiationError;Km.prototype.equals=pe.throwInstantiationError;Km.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Km.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Km.equals(e[i],t[i]))return!1;return!0};Km.isConstant=function(e){return!l(e)||e.isConstant};Km.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Km.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};Km.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var J=Km;var khn=T(S(),1),AMe={LEFT:-1,NONE:0,RIGHT:1},kr=Object.freeze(AMe);var MMe=B.WHITE,NMe=m.ZERO,kMe=Je.NONE,UMe=D.ZERO,DMe=1,BMe=0,OMe=m.ZERO,YMe=_i.CENTER,HMe=An.CENTER,zMe=!1,KMe=kr.NONE,JMe=new m,QMe=new B,jMe=new m,qMe=new D,$Me=new kt,eNe=new kt,tNe=new kt,nNe=new Ke,iNe=new wt;function wae(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Gg(e,t){t.collectionChanged.addEventListener(Gg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}Gg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;if(u&&(h=J.getValueOrUndefined(s._position,e,JMe),c=J.getValueOrUndefined(a._image,e),u=l(h)&&l(c)),!u){aK(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0),l(d)||(d=n.getBillboard(s),d.id=s,r.billboard=d,r.textureValue=void 0),d.show=u,r.textureValue!==c&&(d.image=c,r.textureValue=c),d.position=h,d.color=J.getValueOrDefault(a._color,e,MMe,QMe),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,NMe,jMe),d.heightReference=J.getValueOrDefault(a._heightReference,e,kMe),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,UMe,qMe),d.scale=J.getValueOrDefault(a._scale,e,DMe),d.rotation=J.getValueOrDefault(a._rotation,e,BMe),d.alignedAxis=J.getValueOrDefault(a._alignedAxis,e,OMe),d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,YMe),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,HMe),d.width=J.getValueOrUndefined(a._width,e),d.height=J.getValueOrUndefined(a._height,e),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,$Me),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,eNe),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,tNe),d.sizeInMeters=J.getValueOrDefault(a._sizeInMeters,e,zMe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,iNe),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,KMe);let p=J.getValueOrUndefined(a._imageSubRegion,e,nNe);l(p)&&d.setImageSubRegion(d.image,p)}return!0};Gg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return dt.FAILED;let i=n.billboard;if(i.heightReference===Je.NONE)t.center=m.clone(i.position,t.center);else{if(!l(i._clampedPosition))return dt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,dt.DONE};Gg.prototype.isDestroyed=function(){return!1};Gg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Gg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return me(this)};Gg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new wae(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new wae(r)):(aK(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],aK(s.get(r.id),r,a),s.remove(r.id)};function aK(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var AI=Gg;var pVn=T(S(),1);var ybn=T(S(),1);var rfn=T(S(),1),MI=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec3 v_tangentEC;
in vec3 v_bitangentEC;
in vec2 v_st;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;
    mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
    materialInput.positionToEyeEC = positionToEyeEC;
    materialInput.st = v_st;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var afn=T(S(),1),NI=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec3 tangent;
in vec3 bitangent;
in vec2 st;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec3 v_tangentEC;
out vec3 v_bitangentEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_tangentEC = czm_normal * tangent;                       // tangent in eye coordinates
    v_bitangentEC = czm_normal * bitangent;                   // bitangent in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var lfn=T(S(),1),kI=`in vec3 v_positionEC;
in vec3 v_normalEC;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var ufn=T(S(),1),UI=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var hfn=T(S(),1),DI=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec2 v_st;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    materialInput.st = v_st;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var pfn=T(S(),1),BI=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec2 st;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var Ffn=T(S(),1);var Lfn=T(S(),1);var yfn=T(S(),1);var oNe={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX},Fa=Object.freeze(oNe);var Tfn=T(S(),1);var rNe={ZERO:ie.ZERO,ONE:ie.ONE,SOURCE_COLOR:ie.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ie.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ie.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ie.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ie.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ie.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ie.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ie.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ie.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ie.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ie.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ie.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ie.SRC_ALPHA_SATURATE},Vo=Object.freeze(rNe);var sNe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Vo.SOURCE_ALPHA,functionSourceAlpha:Vo.ONE,functionDestinationRgb:Vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Vo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Vo.ONE,functionSourceAlpha:Vo.ONE,functionDestinationRgb:Vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Vo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Vo.SOURCE_ALPHA,functionSourceAlpha:Vo.ONE,functionDestinationRgb:Vo.ONE,functionDestinationAlpha:Vo.ONE})},un=Object.freeze(sNe);var Gfn=T(S(),1);var aNe={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK},Ti=Object.freeze(aNe);function e1(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(e1.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});e1.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
`)};e1.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};e1.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};e1.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ti.BACK}),l(n)&&(i=St(n,i,!0)),i};var io=e1;var rbn=T(S(),1);var Mfn=T(S(),1),OI=`uniform sampler2D image;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var kfn=T(S(),1),YI=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    vec2 centerPixel = fract(repeat * st);
    float centerBump = texture(image, centerPixel).channel;

    float imageWidth = float(imageDimensions.x);
    vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
    float rightBump = texture(image, rightPixel).channel;

    float imageHeight = float(imageDimensions.y);
    vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
    float topBump = texture(image, leftPixel).channel;

    vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;

    material.normal = normalEC;
    material.diffuse = vec3(0.01);

    return material;
}
`;var Dfn=T(S(),1),HI=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
    float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);  // 0.0 or 1.0

    // Find the distance from the closest separator (region between two colors)
    float scaledWidth = fract(repeat.s * st.s);
    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
    float scaledHeight = fract(repeat.t * st.t);
    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
    float value = min(scaledWidth, scaledHeight);

    vec4 currentColor = mix(lightColor, darkColor, b);
    vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);

    color = czm_gammaCorrect(color);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var Ofn=T(S(),1),zI=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
    float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));  // 0.0 or 1.0

    vec4 color = mix(lightColor, darkColor, b);
    color = czm_gammaCorrect(color);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var Hfn=T(S(),1),KI=`uniform sampler2D heights;
uniform sampler2D colors;

// This material expects heights to be sorted from lowest to highest.

float getHeight(int idx, float invTexSize)
{
    vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
#ifdef OES_texture_float
    return texture(heights, uv).x;
#else
    return czm_unpackFloat(texture(heights, uv));
#endif
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float height = materialInput.height;
    float invTexSize = 1.0 / float(heightsDimensions.x);

    float minHeight = getHeight(0, invTexSize);
    float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);

    // early-out when outside the height range
    if (height < minHeight || height > maxHeight) {
        material.diffuse = vec3(0.0);
        material.alpha = 0.0;
        return material;
    }

    // Binary search to find heights above and below.
    int idxBelow = 0;
    int idxAbove = heightsDimensions.x;
    float heightBelow = minHeight;
    float heightAbove = maxHeight;

    // while loop not allowed, so use for loop with max iterations.
    // maxIterations of 16 supports a texture size up to 65536 (2^16).
    const int maxIterations = 16;
    for (int i = 0; i < maxIterations; i++) {
        if (idxBelow >= idxAbove - 1) {
            break;
        }

        int idxMid = (idxBelow + idxAbove) / 2;
        float heightTex = getHeight(idxMid, invTexSize);

        if (height > heightTex) {
            idxBelow = idxMid;
            heightBelow = heightTex;
        } else {
            idxAbove = idxMid;
            heightAbove = heightTex;
        }
    }

    float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
    vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
    vec4 color = texture(colors, colorUv);

    // undo preumultiplied alpha
    if (color.a > 0.0) 
    {
        color.rgb /= color.a;
    }
    
    color.rgb = czm_gammaCorrect(color.rgb);

    material.diffuse = color.rgb;
    material.alpha = color.a;
    return material;
}
`;var Kfn=T(S(),1),JI=`uniform vec4 color;
uniform float spacing;
uniform float width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float distanceToContour = mod(materialInput.height, spacing);

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float dxc = abs(dFdx(materialInput.height));
    float dyc = abs(dFdy(materialInput.height));
    float dF = max(dxc, dyc) * czm_pixelRatio * width;
    float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
#else
    // If no derivatives available (IE 10?), use pixel ratio
    float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
#endif

    vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var Qfn=T(S(),1),QI=`uniform sampler2D image;
uniform float minimumHeight;
uniform float maximumHeight;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
    vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var qfn=T(S(),1),jI=`uniform vec4 fadeInColor;
uniform vec4 fadeOutColor;
uniform float maximumDistance;
uniform bool repeat;
uniform vec2 fadeDirection;
uniform vec2 time;

float getTime(float t, float coord)
{
    float scalar = 1.0 / maximumDistance;
    float q  = distance(t, coord) * scalar;
    if (repeat)
    {
        float r = distance(t, coord + 1.0) * scalar;
        float s = distance(t, coord - 1.0) * scalar;
        q = min(min(r, s), q);
    }
    return clamp(q, 0.0, 1.0);
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float s = getTime(time.x, st.s) * fadeDirection.s;
    float t = getTime(time.y, st.t) * fadeDirection.t;

    float u = length(vec2(s, t));
    vec4 color = mix(fadeInColor, fadeOutColor, u);

    color = czm_gammaCorrect(color);
    material.emission = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var epn=T(S(),1),qI=`uniform vec4 color;
uniform float cellAlpha;
uniform vec2 lineCount;
uniform vec2 lineThickness;
uniform vec2 lineOffset;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
    float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));

    float value;

    // Fuzz Factor - Controls blurriness of lines
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    const float fuzz = 1.2;
    vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;

    // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
    vec2 dx = abs(dFdx(st));
    vec2 dy = abs(dFdy(st));
    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
    value = min(
        smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
        smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
#else
    // If no derivatives available (IE 10?), revert to view-dependent fuzz
    const float fuzz = 0.05;

    vec2 range = 0.5 - (lineThickness * 0.05);
    value = min(
        1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
        1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
#endif

    // Edges taken from RimLightingMaterial.glsl
    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
    float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
    float sRim = smoothstep(0.8, 1.0, dRim);
    value *= (1.0 - sRim);

    vec4 halfColor;
    halfColor.rgb = color.rgb * 0.5;
    halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
    halfColor = czm_gammaCorrect(halfColor);
    material.diffuse = halfColor.rgb;
    material.emission = halfColor.rgb;
    material.alpha = halfColor.a;

    return material;
}
`;var npn=T(S(),1),$I=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    
    vec4 textureValue = texture(image, fract(repeat * materialInput.st));
    vec3 normalTangentSpace = textureValue.channels;
    normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
    normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
    normalTangentSpace = normalize(normalTangentSpace);
    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
    
    material.normal = normalEC;
    
    return material;
}
`;var opn=T(S(),1),eX=`uniform vec4 color;

float getPointOnLine(vec2 p0, vec2 p1, float x)
{
    float slope = (p0.y - p1.y) / (p0.x - p1.x);
    return slope * (x - p0.x) + p0.y;
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
#else
     // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
    float base = 0.975;
#endif

    vec2 center = vec2(1.0, 0.5);
    float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
    float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);

    float halfWidth = 0.15;
    float s = step(0.5 - halfWidth, st.t);
    s *= 1.0 - step(0.5 + halfWidth, st.t);
    s *= 1.0 - step(base, st.s);

    float t = step(base, materialInput.st.s);
    t *= 1.0 - step(ptOnUpperLine, st.t);
    t *= step(ptOnLowerLine, st.t);

    // Find the distance from the closest separator (region between two colors)
    float dist;
    if (st.s < base)
    {
        float d1 = abs(st.t - (0.5 - halfWidth));
        float d2 = abs(st.t - (0.5 + halfWidth));
        dist = min(d1, d2);
    }
    else
    {
        float d1 = czm_infinity;
        if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
        {
            d1 = abs(st.s - base);
        }
        float d2 = abs(st.t - ptOnUpperLine);
        float d3 = abs(st.t - ptOnLowerLine);
        dist = min(min(d1, d2), d3);
    }

    vec4 outsideColor = vec4(0.0);
    vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
    vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);

    outColor = czm_gammaCorrect(outColor);
    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;
    return material;
}
`;var spn=T(S(),1),tX=`uniform vec4 color;
uniform vec4 gapColor;
uniform float dashLength;
uniform float dashPattern;
in float v_polylineAngle;

const float maskLength = 16.0;

mat2 rotate(float rad) {
    float c = cos(rad);
    float s = sin(rad);
    return mat2(
        c, s,
        -s, c
    );
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;

    // Get the relative position within the dash from 0 to 1
    float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
    // Figure out the mask index.
    float maskIndex = floor(dashPosition * maskLength);
    // Test the bit mask.
    float maskTest = floor(dashPattern / pow(2.0, maskIndex));
    vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
    if (fragColor.a < 0.005) {   // matches 0/255 and 1/255
        discard;
    }

    fragColor = czm_gammaCorrect(fragColor);
    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;
    return material;
}
`;var cpn=T(S(),1),nX=`uniform vec4 color;
uniform float glowPower;
uniform float taperPower;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);

    if (taperPower <= 0.99999) {
        glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
    }

    vec4 fragColor;
    fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
    fragColor.a = clamp(0.0, 1.0, glow) * color.a;
    fragColor = czm_gammaCorrect(fragColor);

    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;

    return material;
}
`;var dpn=T(S(),1),iX=`uniform vec4 color;
uniform vec4 outlineColor;
uniform float outlineWidth;

in float v_width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float halfInteriorWidth =  0.5 * (v_width - outlineWidth) / v_width;
    float b = step(0.5 - halfInteriorWidth, st.t);
    b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);

    // Find the distance from the closest separator (region between two colors)
    float d1 = abs(st.t - (0.5 - halfInteriorWidth));
    float d2 = abs(st.t - (0.5 + halfInteriorWidth));
    float dist = min(d1, d2);

    vec4 currentColor = mix(outlineColor, color, b);
    vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
    outColor = czm_gammaCorrect(outColor);

    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var mpn=T(S(),1),oX=`uniform vec4 color;
uniform vec4 rimColor;
uniform float width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
    float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
    float s = smoothstep(1.0 - width, 1.0, d);

    vec4 outColor = czm_gammaCorrect(color);
    vec4 outRimColor = czm_gammaCorrect(rimColor);

    material.diffuse = outColor.rgb;
    material.emission = outRimColor.rgb * s;
    material.alpha = mix(outColor.a, outRimColor.a, s);

    return material;
}
`;var fpn=T(S(),1),rX=`uniform sampler2D image;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var bpn=T(S(),1),sX=`uniform vec4 evenColor;
uniform vec4 oddColor;
uniform float offset;
uniform float repeat;
uniform bool horizontal;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
    float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
    float value = fract((coord - offset) * (repeat * 0.5));
    float dist = min(value, min(abs(value - 0.5), 1.0 - value));

    vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
    vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
    color = czm_gammaCorrect(color);

    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var ypn=T(S(),1),aX=`uniform vec4 waterColor;
uniform vec4 landColor;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec4 outColor = mix(landColor, waterColor, materialInput.waterMask);
    outColor = czm_gammaCorrect(outColor);

    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var _pn=T(S(),1),cX=`// Thanks for the contribution Jonas
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog

uniform sampler2D specularMap;
uniform sampler2D normalMap;
uniform vec4 baseWaterColor;
uniform vec4 blendColor;
uniform float frequency;
uniform float animationSpeed;
uniform float amplitude;
uniform float specularIntensity;
uniform float fadeFactor;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float time = czm_frameNumber * animationSpeed;

    // fade is a function of the distance from the fragment and the frequency of the waves
    float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);

    float specularMapValue = texture(specularMap, materialInput.st).r;

    // note: not using directional motion at this time, just set the angle to 0.0;
    vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
    vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));

    // fade out the normal perturbation as we move further from the water surface
    normalTangentSpace.xy /= fade;

    // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
    normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);

    normalTangentSpace = normalize(normalTangentSpace);

    // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
    float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);

    // fade out water effect as specular map value decreases
    material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;

    // base color is a blend of the water and non-water color based on the value from the specular map
    // may need a uniform blend factor to better control this
    material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);

    // diffuse highlights are based on how perturbed the normal is
    material.diffuse += (0.1 * tsPerturbationRatio);

    material.diffuse = material.diffuse;

    material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);

    material.specular = specularIntensity;
    material.shininess = 10.0;

    return material;
}
`;function He(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,jt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,hi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,cNe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(He._uniformList[this.type])||(He._uniformList[this.type]=Object.keys(this._uniforms))}He._uniformList={};He.fromType=function(e,t){let n=new He({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};He.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};He.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let d=c.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(x){return x.bufferView}),d=d[0]);let h=new qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new vt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:h}):p=new vt({context:e,source:d,sampler:h});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let x=this.uniforms[f];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let d=c.images,u=new xr({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};He.prototype.isDestroyed=function(){return!1};He.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return me(this)};function cNe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ye(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ye(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ye(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Hn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=He._materialCache.getMaterial(t.type);if(l(i)){let r=Ye(i.fabric,!0);t._template=St(t._template,r,!0),n=i.translucent}mNe(t),l(i)||He._materialCache.addMaterial(t.type,t),fNe(t),yNe(t),_Ne(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function cK(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Fae(e,t){}function lNe(e,t){}var dNe=["type","materials","uniforms","components","source"],uNe=["diffuse","specular","shininess","normal","emission","alpha"];function mNe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;cK(t,dNe,Fae,!0),cK(o,uNe,Fae,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);cK(n,r,lNe,!1)}function hNe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function fNe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
{
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&hNe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; 
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; 
`:e.shaderSource+=`material.${o} = ${t[o]};
`}e.shaderSource+=`return material;
}
`}}var Aae={mat2:Ii,mat3:$,mat4:A},pNe=/\.ktx2$/i;function bNe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===He.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new vt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof vt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),a)return;let h=r instanceof Ze;if(!l(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:Ze.createIfNeeded(r),g;pNe.test(p.url)?g=Zl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function gNe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof xr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===He.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ze.createIfNeeded(i.positiveX).fetchImage(),Ze.createIfNeeded(i.negativeX).fetchImage(),Ze.createIfNeeded(i.positiveY).fetchImage(),Ze.createIfNeeded(i.negativeY).fetchImage(),Ze.createIfNeeded(i.positiveZ).fetchImage(),Ze.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function yNe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Mae(e,n)}function Mae(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=xNe(o),s;if(r==="channels")s=lX(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;TNe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},Mae(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=lX(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(bNe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(gNe(t));else if(r.indexOf("mat")!==-1){let d=new Aae[r];e._uniforms[c]=function(){return Aae[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function xNe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ze||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===He.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function _Ne(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new He({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=St(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;lX(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=lX(e,i,a)}}function lX(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function TNe(e,t,n){return lX(e,t,t,n)}He._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};He.DefaultImageId="czm_defaultImage";He.DefaultCubeMapId="czm_defaultCubeMap";He.ColorType="Color";He._materialCache.addMaterial(He.ColorType,{fabric:{type:He.ColorType,uniforms:{color:new B(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});He.ImageType="Image";He._materialCache.addMaterial(He.ImageType,{fabric:{type:He.ImageType,uniforms:{image:He.DefaultImageId,repeat:new D(1,1),color:new B(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});He.DiffuseMapType="DiffuseMap";He._materialCache.addMaterial(He.DiffuseMapType,{fabric:{type:He.DiffuseMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});He.AlphaMapType="AlphaMap";He._materialCache.addMaterial(He.AlphaMapType,{fabric:{type:He.AlphaMapType,uniforms:{image:He.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});He.SpecularMapType="SpecularMap";He._materialCache.addMaterial(He.SpecularMapType,{fabric:{type:He.SpecularMapType,uniforms:{image:He.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});He.EmissionMapType="EmissionMap";He._materialCache.addMaterial(He.EmissionMapType,{fabric:{type:He.EmissionMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});He.BumpMapType="BumpMap";He._materialCache.addMaterial(He.BumpMapType,{fabric:{type:He.BumpMapType,uniforms:{image:He.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:YI},translucent:!1});He.NormalMapType="NormalMap";He._materialCache.addMaterial(He.NormalMapType,{fabric:{type:He.NormalMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:$I},translucent:!1});He.GridType="Grid";He._materialCache.addMaterial(He.GridType,{fabric:{type:He.GridType,uniforms:{color:new B(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:qI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});He.StripeType="Stripe";He._materialCache.addMaterial(He.StripeType,{fabric:{type:He.StripeType,uniforms:{horizontal:!0,evenColor:new B(1,1,1,.5),oddColor:new B(0,0,1,.5),offset:0,repeat:5},source:sX},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});He.CheckerboardType="Checkerboard";He._materialCache.addMaterial(He.CheckerboardType,{fabric:{type:He.CheckerboardType,uniforms:{lightColor:new B(1,1,1,.5),darkColor:new B(0,0,0,.5),repeat:new D(5,5)},source:HI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});He.DotType="Dot";He._materialCache.addMaterial(He.DotType,{fabric:{type:He.DotType,uniforms:{lightColor:new B(1,1,0,.75),darkColor:new B(0,1,1,.75),repeat:new D(5,5)},source:zI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});He.WaterType="Water";He._materialCache.addMaterial(He.WaterType,{fabric:{type:He.WaterType,uniforms:{baseWaterColor:new B(.2,.3,.6,1),blendColor:new B(0,1,.699,1),specularMap:He.DefaultImageId,normalMap:He.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:cX},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});He.RimLightingType="RimLighting";He._materialCache.addMaterial(He.RimLightingType,{fabric:{type:He.RimLightingType,uniforms:{color:new B(1,0,0,.7),rimColor:new B(1,1,1,.4),width:.3},source:oX},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});He.FadeType="Fade";He._materialCache.addMaterial(He.FadeType,{fabric:{type:He.FadeType,uniforms:{fadeInColor:new B(1,0,0,1),fadeOutColor:new B(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:jI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});He.PolylineArrowType="PolylineArrow";He._materialCache.addMaterial(He.PolylineArrowType,{fabric:{type:He.PolylineArrowType,uniforms:{color:new B(1,1,1,1)},source:eX},translucent:!0});He.PolylineDashType="PolylineDash";He._materialCache.addMaterial(He.PolylineDashType,{fabric:{type:He.PolylineDashType,uniforms:{color:new B(1,0,1,1),gapColor:new B(0,0,0,0),dashLength:16,dashPattern:255},source:tX},translucent:!0});He.PolylineGlowType="PolylineGlow";He._materialCache.addMaterial(He.PolylineGlowType,{fabric:{type:He.PolylineGlowType,uniforms:{color:new B(0,.5,1,1),glowPower:.25,taperPower:1},source:nX},translucent:!0});He.PolylineOutlineType="PolylineOutline";He._materialCache.addMaterial(He.PolylineOutlineType,{fabric:{type:He.PolylineOutlineType,uniforms:{color:new B(1,1,1,1),outlineColor:new B(1,0,0,1),outlineWidth:1},source:iX},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});He.ElevationContourType="ElevationContour";He._materialCache.addMaterial(He.ElevationContourType,{fabric:{type:He.ElevationContourType,uniforms:{spacing:100,color:new B(1,0,0,1),width:1},source:JI},translucent:!1});He.ElevationRampType="ElevationRamp";He._materialCache.addMaterial(He.ElevationRampType,{fabric:{type:He.ElevationRampType,uniforms:{image:He.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:QI},translucent:!1});He.SlopeRampMaterialType="SlopeRamp";He._materialCache.addMaterial(He.SlopeRampMaterialType,{fabric:{type:He.SlopeRampMaterialType,uniforms:{image:He.DefaultImageId},source:rX},translucent:!1});He.AspectRampMaterialType="AspectRamp";He._materialCache.addMaterial(He.AspectRampMaterialType,{fabric:{type:He.AspectRampMaterialType,uniforms:{image:He.DefaultImageId},source:OI},translucent:!1});He.ElevationBandType="ElevationBand";He._materialCache.addMaterial(He.ElevationBandType,{fabric:{type:He.ElevationBandType,uniforms:{heights:He.DefaultImageId,colors:He.DefaultImageId},source:KI},translucent:!0});He.WaterMaskType="WaterMask";He._materialCache.addMaterial(He.WaterMaskType,{fabric:{type:He.WaterMaskType,source:aX,uniforms:{waterColor:new B(1,1,1,1),landColor:new B(0,0,0,0)}},translucent:!1});var zi=He;function b_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,b_.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(b_.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});b_.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;b_.prototype.isTranslucent=io.prototype.isTranslucent;b_.prototype.getRenderState=io.prototype.getRenderState;b_.MaterialSupport={BASIC:Object.freeze({vertexFormat:Xe.POSITION_AND_NORMAL,vertexShaderSource:UI,fragmentShaderSource:kI}),TEXTURED:Object.freeze({vertexFormat:Xe.POSITION_NORMAL_AND_ST,vertexShaderSource:BI,fragmentShaderSource:DI}),ALL:Object.freeze({vertexFormat:Xe.ALL,vertexShaderSource:NI,fragmentShaderSource:MI})};var ao=b_;var wbn=T(S(),1);var _bn=T(S(),1),dX=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec4 v_color;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    vec4 color = czm_gammaCorrect(v_color);

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getDefaultMaterial(materialInput);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
}
`;var Sbn=T(S(),1),uX=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec4 color;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec4 v_color;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_color = color;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var Vbn=T(S(),1),g_=`in vec4 v_color;

void main()
{
    out_FragColor = czm_gammaCorrect(v_color);
}
`;var Rbn=T(S(),1),mX=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 color;
in float batchId;

out vec4 v_color;

void main()
{
    vec4 p = czm_computePosition();

    v_color = color;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function rb(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?mX:uX,r=i?g_:dX,s=i?rb.FLAT_VERTEX_FORMAT:rb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(rb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});rb.VERTEX_FORMAT=Xe.POSITION_AND_NORMAL;rb.FLAT_VERTEX_FORMAT=Xe.POSITION_ONLY;rb.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;rb.prototype.isTranslucent=io.prototype.isTranslucent;rb.prototype.getRenderState=io.prototype.getRenderState;var dn=rb;var Bbn=T(S(),1);function t1(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(t1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});t1.prototype.getType=function(e){return"Color"};var SNe=new q;t1.prototype.getValue=function(e,t){return l(e)||(e=q.now(SNe)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};t1.prototype.equals=function(e){return this===e||e instanceof t1&&J.equals(this._color,e._color)};var Dt=t1;var rxn=T(S(),1);var Myn=T(S(),1);var _yn=T(S(),1);var Ybn=T(S(),1),hX=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;

#ifdef EXTRUDED_GEOMETRY
in vec3 extrudeDirection;

uniform float u_globeMinimumAltitude;
#endif // EXTRUDED_GEOMETRY

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif // PER_INSTANCE_COLOR

#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
out vec4 v_sphericalExtents;
#else // SPHERICAL
out vec2 v_inversePlaneExtents;
out vec4 v_westPlane;
out vec4 v_southPlane;
#endif // SPHERICAL
out vec3 v_uvMinAndSphericalLongitudeRotation;
out vec3 v_uMaxAndInverseDistance;
out vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES

void main()
{
    vec4 position = czm_computePosition();

#ifdef EXTRUDED_GEOMETRY
    float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
    delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;

    //extrudeDirection is zero for the top layer
    position = position + vec4(extrudeDirection * delta, 0.0);
#endif

#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
    v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
    v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
#else // SPHERICAL
#ifdef COLUMBUS_VIEW_2D
    vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
    vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);

    // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
    // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
    // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
    // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
    vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
    bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
    planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
    planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);

    // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
    // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
    // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
    idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
    idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
    planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
    planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);

    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
    vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
    vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
#else // COLUMBUS_VIEW_2D
    // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
    vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
    vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
#endif // COLUMBUS_VIEW_2D

    vec3 eastWard = southEastCorner - southWestCorner;
    float eastExtent = length(eastWard);
    eastWard /= eastExtent;

    vec3 northWard = northWestCorner - southWestCorner;
    float northExtent = length(northWard);
    northWard /= northExtent;

    v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
    v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
    v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
#endif // SPHERICAL
    vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
    vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);

    v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
    v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
    v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
#endif // TEXTURE_COORDINATES

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#endif

    gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
}
`;var zbn=T(S(),1),Eg=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

void main(void)
{
#ifdef VECTOR_TILE
    out_FragColor = czm_gammaCorrect(u_highlightColor);
#else
    out_FragColor = vec4(1.0);
#endif
    czm_writeDepthClamp();
}
`;var Jbn=T(S(),1),Nae={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Nae.NUMBER_OF_CLASSIFICATION_TYPES=3;var Dn=Object.freeze(Nae);var qbn=T(S(),1);var CNe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},bc=Object.freeze(CNe);var xgn=T(S(),1);var m0n=T(S(),1);function sb(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=VNe(t),o=e.floatingPointTexture,r=i===je.FLOAT&&!o,s=LNe(t,r),a=RNe(s,t,r),c=Math.floor(At.maximumTextureSize/a),d=Math.min(n,c),u=a*d,h=Math.ceil(n/d),p=1/u,g=p*.5,f=1/h,x=f*.5;this._textureDimensions=new D(u,h),this._textureStep=new se(p,g,f,x),this._pixelDatatype=r?je.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let _=4*u*h;this._batchValues=i===je.FLOAT&&!r?new Float32Array(_):new Uint8Array(_),this._batchValuesDirty=!1}Object.defineProperties(sb.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function VNe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Q.UNSIGNED_BYTE){t=!0;break}return t?je.FLOAT:je.UNSIGNED_BYTE}function Uae(e,t){let n=e[t].componentsPerAttribute;return n===2?D:n===3?m:n===4?se:Number}function LNe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==Q.UNSIGNED_BYTE&&t?i+=4:++i}return n}function RNe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==Q.UNSIGNED_BYTE&&n?o+4:o+1}var fX=new se;function ZNe(e,t,n){let i=se.unpack(e,t,fX),o=se.unpackFloat(i);i=se.unpack(e,t+4,fX);let r=se.unpackFloat(i);i=se.unpack(e,t+8,fX);let s=se.unpackFloat(i);i=se.unpack(e,t+12,fX);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function GNe(e,t,n){let i=se.packFloat(e.x,fX);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var kae=new se;sb.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?a=ZNe(this._batchValues,s,kae):a=se.unpack(this._batchValues,s,kae);let c=Uae(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var ENe=[void 0,void 0,new D,new m,new se],INe=new se;sb.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=ENe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Uae(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=INe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let d=this._offsets[t],h=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?GNe(c,this._batchValues,h):se.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function XNe(e,t){let n=e._textureDimensions;e._texture=new vt({context:t,pixelFormat:it.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:qt.NEAREST,flipY:!1})}function WNe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}sb.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||XNe(this,e.context),WNe(this))};sb.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:St(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function PNe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; 
vec2 computeSt(float batchId) 
{ 
    float stepX = batchTextureStep.x; 
    float centerX = batchTextureStep.y; 
    float numberOfAttributes = float(${t}); 
    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); 
} 
`:`uniform vec4 batchTextureStep; 
uniform vec2 batchTextureDimensions; 
vec2 computeSt(float batchId) 
{ 
    float stepX = batchTextureStep.x; 
    float centerX = batchTextureStep.y; 
    float stepY = batchTextureStep.z; 
    float centerY = batchTextureStep.w; 
    float numberOfAttributes = float(${t}); 
    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); 
    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); 
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); 
} 
`}function vNe(e){return e===1?"float":`vec${e}`}function wNe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function FNe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=vNe(o),a=wNe(o),c=e._offsets[t],d=`${s} ${r}(float batchId) 
{ 
    vec2 st = computeSt(batchId); 
    st.x += batchTextureStep.x * float(${c}); 
`;return e._packFloats&&i.componentDatatype!==je.UNSIGNED_BYTE?d+=`vec4 textureValue; 
textureValue.x = czm_unpackFloat(texture(batchTexture, st)); 
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); 
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); 
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); 
`:d+=`    vec4 textureValue = texture(batchTexture, st); 
`,d+=`    ${s} value = textureValue${a}; 
`,e._pixelDatatype===je.UNSIGNED_BYTE&&i.componentDatatype===Q.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0; 
`:e._pixelDatatype===je.FLOAT&&i.componentDatatype===Q.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0; 
`),d+=`    return value; 
} 
`,d}sb.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; 
`;t+=`${PNe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=FNe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};sb.prototype.isDestroyed=function(){return!1};sb.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),me(this)};var y_=sb;var G0n=T(S(),1);function ANe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!A.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Fn.transformToWorldCoordinates(e[r]);else A.multiplyTransformation(t,e[0].modelMatrix,t)}function lK(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function MNe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?lK(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(lK(i.westHemisphereGeometry,n),lK(i.eastHemisphereGeometry,n))}}function NNe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,d,u,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(ANe(t,a,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&Fn.splitLongitude(t[c]);if(MNe(t),r)for(c=0;c<h;++c){let g=t[c];l(g.geometry)?(Fn.reorderForPostVertexCache(g.geometry),Fn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Fn.reorderForPostVertexCache(g.westHemisphereGeometry),Fn.reorderForPreVertexCache(g.westHemisphereGeometry),Fn.reorderForPostVertexCache(g.eastHemisphereGeometry),Fn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Fn.combineInstances(t);for(h=p.length,c=0;c<h;++c){d=p[c];let g=d.attributes;if(o)for(let f in g)g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE&&Fn.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in g)if(g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE){let x=`${f}3D`,_=`${f}2D`;Fn.projectTo2D(d,f,x,_,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=le.fromVertices(d.attributes.position2D.values)),Fn.encodeAttribute(d,x,`${x}High`,`${x}Low`),Fn.encodeAttribute(d,_,`${_}High`,`${_}Low`)}s&&Fn.compressVertices(d)}if(!i){let g=[];for(h=p.length,c=0;c<h;++c)d=p[c],g=g.concat(Fn.fitToUnsignedShortIndices(d));p=g}return p}function dK(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;d<c;++d){let h=e[d][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function kNe(e,t){let n=[];return dK(e,"geometry",t,n),dK(e,"westHemisphereGeometry",t,n),dK(e,"eastHemisphereGeometry",t,n),n}var ab={};ab.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=NNe(e),t.length>0&&(n=Fn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=kNe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let h=i[u],p=h.geometry;l(p)&&(c[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,f=h.westHemisphereGeometry;l(g)&&l(f)&&(l(g.boundingSphere)&&l(f.boundingSphere)&&(c[u]=le.union(g.boundingSphere,f.boundingSphere)),l(g.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=le.union(g.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function UNe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function DNe(e,t){let n=e.length;for(let i=0;i<n;++i)UNe(e[i],t)}function BNe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*le.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}ab.packCreateGeometryResults=function(e,t){let n=new Float64Array(BNe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],d=l(c);if(n[s++]=d?1:0,!d)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let u=l(c.boundingSphere)?1:0;n[s++]=u,u&&le.pack(c.boundingSphere,n,s),s+=le.packedLength;let h=l(c.boundingSphereCV)?1:0;n[s++]=h,h&&le.pack(c.boundingSphereCV,n,s),s+=le.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let _=g[x],C=p[_];n[s++]=o[_],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let f=l(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};ab.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let h,p;n[s++]===1&&(h=le.unpack(n,s)),s+=le.packedLength,n[s++]===1&&(p=le.unpack(n,s)),s+=le.packedLength;let x,_,C,V=new mn,L=n[s++];for(i=0;i<L;i++){let G=t[n[s++]],I=n[s++];C=n[s++];let v=n[s++]!==0;x=n[s++],_=Q.createTypedArray(I,x);for(let P=0;P<x;P++)_[P]=n[s++];V[G]=new Ge({componentDatatype:I,componentsPerAttribute:C,normalize:v,values:_})}let R;if(x=n[s++],x>0){let G=_.length/C;for(R=Ae.createTypedArray(G,x),i=0;i<x;i++)R[i]=n[s++]}o[r++]=new lt({primitiveType:c,geometryType:d,boundingSphere:h,boundingSphereCV:p,indices:R,attributes:V,offsetAttribute:u})}return o};function ONe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(A.pack(s.modelMatrix,i,o),o+=A.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function YNe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=A.unpack(t,o),s;o+=A.packedLength,l(t[o])&&(s={offset:new $i(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}ab.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ONe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ei,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};ab.unpackCombineGeometryParameters=function(e){let t=YNe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=ab.unpackCreateGeometryResults(n[a]),d=c.length;for(let u=0;u<d;u++){let h=c[u],p=t[o];p.geometry=h,++o}}let r=ne.clone(e.ellipsoid),s=e.isGeographic?new Ei(r):new Wi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:A.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Dae(e){let t=e.length,n=1+(le.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function Bae(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=le.unpack(e,i)),++n,i+=le.packedLength;return t}ab.packCombineGeometryResults=function(e,t){l(e.geometries)&&DNe(e.geometries,t);let n=Dae(e.boundingSpheres),i=Dae(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};ab.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Bae(e.boundingSpheres),boundingSpheresCV:Bae(e.boundingSpheresCV)}};var x_=ab;var I0n=T(S(),1),HNe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Sr=Object.freeze(HNe);var W0n=T(S(),1),Vd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Vd.NUMBER_OF_SHADOW_MODES=4;Vd.castShadows=function(e){return e===Vd.ENABLED||e===Vd.CAST_ONLY};Vd.receiveShadows=function(e){return e===Vd.ENABLED||e===Vd.RECEIVE_ONLY};Vd.fromCastReceive=function(e,t){return e&&t?Vd.ENABLED:e?Vd.CAST_ONLY:t?Vd.RECEIVE_ONLY:Vd.DISABLED};var Tn=Object.freeze(Vd);function Cr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=new A,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,Tn.DISABLED),this._translucent=void 0,this._state=Sr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(Cr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function zNe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var KNe=new D,JNe=new m,qae=new se;function $ae(e){let t=e.length;if(t===1)return e[0];if(t===2)return D.unpack(e,0,KNe);if(t===3)return m.unpack(e,0,JNe);if(t===4)return se.unpack(e,0,qae)}function QNe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=zNe(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,g,f,x;for(g=0;g<s;++g)f=r[g],x=p[f],c[f]=g,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:1}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Q.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let _=a.length,C=new y_(t,a,o);for(g=0;g<o;++g){let V=i[g];p=V.attributes;for(let v=0;v<s;++v){f=r[v],x=p[f];let P=$ae(x.value),w=c[f];C.setBatchedAttribute(g,w,P)}let L={primitive:y(V.pickPrimitive,e)};l(V.id)&&(L.id=V.id);let R=t.createPickId(L);e._pickIds.push(R);let G=R.color,I=qae;I.x=B.floatToByte(G.red),I.y=B.floatToByte(G.green),I.z=B.floatToByte(G.blue),I.w=B.floatToByte(G.alpha),C.setBatchedAttribute(g,_-1,I)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function jNe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ge({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function qNe(e){let t=e.attributes,n=new mn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=jNe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new lt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function $Ne(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:A.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var e5e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Cr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=e5e.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
`,r+=`in vec4 position;
`,s+=`${c}
{
    return u_modifiedModelView * position;
}

`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
{
    return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}

`:(r+=`in vec3 ${a}2DHigh;
in vec3 ${a}2DLow;
`,s+=`${c}
{
    vec4 p;
    if (czm_morphTime == 1.0)
    {
        p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
    }
    else if (czm_morphTime == 0.0)
    {
        p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
    }
    else
    {
        p = czm_columbusViewMorph(
                czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
                czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
                czm_morphTime);
    }
    return p;
}

`)}return[o,r,t,s].join(`
`)};Cr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${De.replaceMain(t,"czm_non_show_main")}
void main() 
{ 
    czm_non_show_main(); 
    gl_Position *= czm_batchTable_show(batchId); 
}`:t};Cr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Oae(e){return`${De.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor; 
void main() 
{ 
    czm_non_pick_main(); 
    v_pickColor = czm_batchTable_pickColor(batchId); 
}`}function Yae(e){return`in vec4 v_pickColor;
${e}`}Cr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};Cr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
`;return o+=`    if (czm_sceneMode == czm_sceneMode3D)
`,o+=`    {
`,o+="        $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=`    }
`,o+=`    else
`,o+=`    {
`,o+="        $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=`    }
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};Cr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=De.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() 
{ 
    czm_non_distanceDisplayCondition_main(); 
    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
`;return n?o+=`    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
`:o+=`    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
    vec4 centerRTE;
    if (czm_morphTime == 1.0)
    {
        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
    }
    else if (czm_morphTime == 0.0)
    {
        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
    }
    else
    {
        centerRTE = czm_columbusViewMorph(
                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
                czm_morphTime);
    }
`,o+=`    float radiusSq = boundingSphereRadius * boundingSphereRadius; 
    float distanceSq; 
    if (czm_sceneMode == czm_sceneMode2D) 
    { 
        distanceSq = czm_eyeHeight2D.y - radiusSq; 
    } 
    else 
    { 
        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; 
    } 
    distanceSq = max(distanceSq, 0.0); 
    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; 
    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; 
    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; 
    gl_Position *= show; 
}`,`${i}
${o}`};function Hae(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",h="";if(i){u+=`vec2 st;
`;let f=s>1?`${c}.x`:c;h+=`    st = czm_decompressTextureCoordinates(${f});
`}n&&o&&r?(u+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,h+=`    czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(u+=`vec3 normal;
`,h+=`    normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
`),o&&(u+=`vec3 tangent;
`,h+=`    tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`),r&&(u+=`vec3 bitangent;
`,h+=`    bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=De.replaceMain(p,"czm_non_compressed_main");let g=`void main() 
{ 
${h}    czm_non_compressed_main(); 
}`;return[d,u,p,g].join(`
`)}function t5e(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    gl_Position = czm_depthClamp(gl_Position);}
`,t}function n5e(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    #if defined(LOG_DEPTH)
        czm_writeLogDepth();
    #else
        czm_writeDepthClamp();
    #endif
}
`,t}function zae(e,t){let n=e.vertexAttributes}function i5e(e,t){return function(){return e[t]}}var uK=Math.max(Bt.hardwareConcurrency-1,1),bk,o5e=new yi("combineGeometry");function r5e(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Sr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),d.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(bk))for(bk=new Array(uK),o=0;o<uK;o++)bk[o]=new yi("createGeometry");let u;for(d=vI(d,uK),o=0;o<d.length;o++){let h=0,p=d[o],g=p.length;for(r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=h,h+=y(i.constructor.packedLength,i.packedLength));let f;if(h>0){let x=new Float64Array(h);for(f=[x.buffer],r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,u.offset),u.geometry=x)}c.push(bk[o].scheduleTask({subTasks:d[o]},f))}e._state=Sr.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Sr.CREATED}).catch(function(h){bX(e,t,Sr.FAILED,h)})}else if(e._state===Sr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,d=t.mapProjection,u=o5e.scheduleTask(x_.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Sr.COMBINING,Promise.resolve(u).then(function(h){let p=x_.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=A.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):bX(e,t,Sr.FAILED,void 0)}).catch(function(h){bX(e,t,Sr.FAILED,h)})}}function s5e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=qNe(p):g=p.constructor.createGeometry(p),o[c++]=$Ne(s,g),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,h=x_.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=A.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):bX(e,t,Sr.FAILED,void 0)}function a5e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new le;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],_=e._batchTable.getBatchedAttribute(i,n,new m);x=r[i].clone(x),ice(x,_,o[i])}let c=[],d=[],u=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||le.intersectPlane(x,sn.ORIGIN_ZX_PLANE)!==Ht.INTERSECTING?c.push(x):(d.push(x),u.push(x))}let h=c[0],p=u[0],g=d[0];for(i=1;i<c.length;i++)h=le.union(h,c[i]);for(i=1;i<u.length;i++)p=le.union(p,u[i]);for(i=1;i<d.length;i++)g=le.union(g,d[i]);let f=[];for(l(h)&&f.push(h),l(p)&&f.push(p),l(g)&&f.push(g),i=0;i<f.length;i++){let x=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=le.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}Cr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Kae=new On,ece=new he,tce=new m,nce=new le;function c5e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,d=t.mapProjection,u=d.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let f=0;f<g;++f){let x=p[f];if(!l(x))continue;let _=e.modelMatrix;l(_)&&(x=le.transform(x,_,nce));let C=x.center,V=x.radius,L=On.fromCartesian(C,Kae);if(h.setBatchedAttribute(f,o,L.high),h.setBatchedAttribute(f,r,L.low),!t.scene3DOnly){let R=u.cartesianToCartographic(C,ece),G=d.project(R,tce);L=On.fromCartesian(G,Kae),h.setBatchedAttribute(f,s,L.high),h.setBatchedAttribute(f,a,L.low)}h.setBatchedAttribute(f,c,V)}e._batchTableBoundingSpheresUpdated=!0}var mK=new m,l5e=new m;function Jae(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let d=0;d<c;++d){let u=a[d];if(!l(u))continue;let h=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(m.equals(h,m.ZERO)){s.setBatchedAttribute(d,i,m.ZERO);continue}let p=e.modelMatrix;l(p)&&(u=le.transform(u,p,nce));let g=u.center;g=r.scaleToGeodeticSurface(g,l5e);let f=r.cartesianToCartographic(g,ece),x=o.project(f,tce),_=m.add(h,g,mK);f=r.cartesianToCartographic(_,f);let C=o.project(f,mK),V=m.subtract(C,x,mK),L=V.x;V.x=V.z,V.z=V.y,V.y=L,s.setBatchedAttribute(d,i,V)}e._batchTableOffsetsUpdated=!0}function d5e(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let d=i[c];if(s.push(ni.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(le.clone(d.boundingSphere)),e._boundingSphereWC.push(new le),!o){let u=d.boundingSphereCV.center,h=u.x,p=u.y,g=u.z;u.x=g,u.y=h,u.z=p,e._boundingSphereCV.push(le.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new le),e._boundingSphereMorph.push(new le)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,bX(e,t,Sr.COMPLETE,void 0)}function u5e(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ye(o,!1),r.cull={enabled:!0,face:Ti.BACK},e._frontFaceRS=Ue.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceRS=Ue.fromCache(r)):(e._frontFaceRS=Ue.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ye(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ye(o,!1),r.depthTest.func=bc.GREATER,i?(r.cull={enabled:!0,face:Ti.BACK},e._frontFaceDepthFailRS=Ue.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceDepthFailRS=Ue.fromCache(r)):(e._frontFaceDepthFailRS=Ue.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function m5e(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Cr._appendOffsetToShader(e,r),r=Cr._appendShowToShader(e,r),r=Cr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Oae(r),r=Cr._updateColorAttribute(e,r,!1),r=Hae(e,r),r=Cr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Yae(s),e._sp=$t.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),zae(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Cr._appendShowToShader(e,r),r=Cr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Oae(r),r=Cr._updateColorAttribute(e,r,!0),r=Hae(e,r),r=Cr._modifyShaderPosition(e,r,t.scene3DOnly),r=t5e(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Yae(s),s=n5e(s),e._spDepthFail=$t.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),zae(e._spDepthFail,o))}var pX=new A,Qae=new m;function jae(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=i5e(s,c));let a=St(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return A.multiply(c,e._modelMatrix,pX),A.multiplyByPoint(pX,e.rtcCenter,Qae),A.setTranslation(pX,Qae,pX),pX}),a}function h5e(e,t,n,i,o,r,s,a){let c=jae(e,t,n,a),d;l(e._depthFailAppearance)&&(d=jae(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Ee.TRANSLUCENT:Ee.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,g=0;for(let f=0;f<p;++f){let x;o&&(x=r[f],l(x)||(x=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,++f),x=r[f],l(x)||(x=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,l(e._depthFailAppearance)&&(o&&(++f,x=r[f],l(x)||(x=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++f,x=r[f],l(x)||(x=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++g}}Cr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!A.equals(n,e._modelMatrix))for(A.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=le.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=le.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=le.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function f5e(e,t,n,i,o,r,s,a){Cr._updateBoundingVolumes(e,t,o);let c;t.mode===oe.SCENE3D?c=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===oe.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let d=t.commandList,u=t.passes;if(u.render||u.pick){let h=e.allowPicking,p=Tn.castShadows(e.shadows),g=Tn.receiveShadows(e.shadows),f=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let _=0;_<f;++_){let C=Math.floor(_/x),V=n[_];V.modelMatrix=o,V.boundingVolume=c[C],V.cull=r,V.debugShowBoundingVolume=s,V.castShadows=p,V.receiveShadows=g,h?V.pickId="v_pickColor":V.pickId=void 0,d.push(V)}}}Cr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Sr.FAILED)return;let t=e.context;if(l(this._batchTable)||QNe(this,t),this._batchTable.attributes.length>0){if(At.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Sr.COMPLETE&&this._state!==Sr.COMBINED&&(this.asynchronous?r5e(this,e):s5e(this,e)),this._state===Sr.COMBINED&&(c5e(this,e),Jae(this,e),d5e(this,e)),!this.show||this._state!==Sr.COMPLETE)return;this._batchTableOffsetsUpdated||Jae(this,e),this._recomputeBoundingSpheres&&a5e(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&y(this._createRenderStatesFunction,u5e)(this,t,n,d),r&&y(this._createShaderProgramFunction,m5e)(this,e,n),(o||r)&&y(this._createCommandsFunction,h5e)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,f5e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var p5e=new le,b5e=new le;function ice(e,t,n){if(n===rn.TOP){let i=le.clone(e,p5e),o=le.clone(e,b5e);o.center=m.add(o.center,t,o.center),e=le.union(i,o,e)}else n===rn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function g5e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function y5e(e,t,n,i,o){return function(r){let s=$ae(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var x5e=new m;function _5e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&ice(i,m.fromArray(r.get(),0,x5e),e._offsetInstanceExtend[n]),l(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function T5e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Cr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];c[d]={get:g5e(s,n,u),set:y5e(s,n,u,this,d)}}return _5e(this,c,n),T5e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Cr.prototype.isDestroyed=function(){return!1};Cr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,me(this)};function bX(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Sr.COMPLETE||e._state===Sr.FAILED})}var In=Cr;var Mgn=T(S(),1);var Tgn=T(S(),1),n1=`#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
in vec4 v_sphericalExtents;
#else // SPHERICAL
in vec2 v_inversePlaneExtents;
in vec4 v_westPlane;
in vec4 v_southPlane;
#endif // SPHERICAL
in vec3 v_uvMinAndSphericalLongitudeRotation;
in vec3 v_uMaxAndInverseDistance;
in vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif

#ifdef NORMAL_EC
vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
    return eyeCoordinate.xyz / eyeCoordinate.w;
}

vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
    vec2 glFragCoordXY = gl_FragCoord.xy;
    // Sample depths at both offset and negative offset
    float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
    float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
    // Explicitly evaluate both paths
    // Necessary for multifrustum and for edges of the screen
    bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
    float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
    float useDownOrLeft = float(useUpOrRight == 0.0);
    vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
    vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
    return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
}
#endif // NORMAL_EC

void main(void)
{
#ifdef REQUIRES_EC
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
#endif

#ifdef REQUIRES_WC
    vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
    vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
#endif

#ifdef TEXTURE_COORDINATES
    vec2 uv;
#ifdef SPHERICAL
    // Treat world coords as a sphere normal for spherical coordinates
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
    sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
    uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
    uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
#else // SPHERICAL
    // Unpack planes and transform to eye space
    uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
    uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
#endif // SPHERICAL
#endif // TEXTURE_COORDINATES

#ifdef PICK
#ifdef CULL_FRAGMENTS
    // When classifying translucent geometry, logDepthOrDepth == 0.0
    // indicates a region that should not be classified, possibly due to there
    // being opaque pixels there in another buffer.
    // Check for logDepthOrDepth != 0.0 to make sure this should be classified.
    if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
        out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource
        czm_writeDepthClamp();
    }
#else // CULL_FRAGMENTS
        out_FragColor.a = 1.0;
#endif // CULL_FRAGMENTS
#else // PICK

#ifdef CULL_FRAGMENTS
    // When classifying translucent geometry, logDepthOrDepth == 0.0
    // indicates a region that should not be classified, possibly due to there
    // being opaque pixels there in another buffer.
    if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
        discard;
    }
#endif

#ifdef NORMAL_EC
    // Compute normal by sampling adjacent pixels in 2x2 block in screen space
    vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
    vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
    vec3 normalEC = normalize(cross(leftRight, downUp));
#endif


#ifdef PER_INSTANCE_COLOR

    vec4 color = czm_gammaCorrect(v_color);
#ifdef FLAT
    out_FragColor = color;
#else // FLAT
    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = -eyeCoordinate.xyz;
    czm_material material = czm_getDefaultMaterial(materialInput);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

#else // PER_INSTANCE_COLOR

    // Material support.
    // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
    // dependencies for culling but might not actually be used by the material.

    czm_materialInput materialInput;

#ifdef USES_NORMAL_EC
    materialInput.normalEC = normalEC;
#endif

#ifdef USES_POSITION_TO_EYE_EC
    materialInput.positionToEyeEC = -eyeCoordinate.xyz;
#endif

#ifdef USES_TANGENT_TO_EYE
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
#endif

#ifdef USES_ST
    // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
    // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
    // Shader is provided a set of reference points for remapping.
    materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
    materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
#endif

    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else // FLAT
    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

#endif // PER_INSTANCE_COLOR
    czm_writeDepthClamp();
#endif // PICK
}
`;function Nu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new hK;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new hK;if(o.requiresTextureCoordinates=e,n instanceof dn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Nu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof dn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof dn||(o=t.material.shaderSource),new De({defines:i,sources:[o,n1]})};Nu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new De({defines:n,sources:[n1],pickColorQualifier:"in"})};Nu.prototype.createVertexShader=function(e,t,n,i){return uce(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Nu.prototype.createPickVertexShader=function(e,t,n,i){return uce(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var oce=new m,rce=new he,sce={high:0,low:0};function uce(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=rce;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,oce),h=On.encode(u.x,sce);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=rce;p.longitude=-W.PI,p.latitude=0,p.height=0;let g=s.project(p,oce);h=On.encode(g.x,sce),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof dn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new De({defines:c,sources:[o]})}function hK(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(hK.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function ace(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/D.distance(t,e)}var S5e=[new D,new D,new D,new D];function mce(e,t){let n=S5e,i=D.unpack(t,0,n[0]),o=D.unpack(t,2,n[1]),r=D.unpack(t,4,n[2]);e.uMaxVmax=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/ace(i,o,r),a=1/ace(i,r,o);e.uvMinAndExtents=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var hce=new he,fce=new m,C5e=new m,V5e=new m,gk={high:0,low:0};function pce(e,t,n){let i=hce;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,fce);i.latitude=e.north;let r=t.project(i,C5e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,V5e),a=[0,0,0,0],c=[0,0,0,0],d=On.encode(o.x,gk);a[0]=d.high,c[0]=d.low,d=On.encode(o.y,gk),a[1]=d.high,c[1]=d.low,d=On.encode(r.y,gk),a[2]=d.high,c[2]=d.low,d=On.encode(s.x,gk),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var L5e=new A,R5e=new A,cce=new m,Z5e=new he,G5e=[new he,new he,new he,new he,new he,new he,new he,new he];function E5e(e,t,n,i,o,r){let s=ce.center(e,Z5e);s.height=n;let a=he.toCartesian(s,t,cce),c=Pt.eastNorthUpToFixedFrame(a,t,L5e),d=A.inverse(c,R5e),u=e.west,h=e.east,p=e.north,g=e.south,f=G5e;f[0].latitude=g,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=h,f[3].latitude=g,f[3].longitude=h;let x=(u+h)*.5,_=(p+g)*.5;f[4].latitude=g,f[4].longitude=x,f[5].latitude=p,f[5].longitude=x,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=h;let C=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){f[P].height=n;let w=he.toCartesian(f[P],t,cce);A.multiplyByPoint(d,w,w),w.z=0,C=Math.min(C,w.x),V=Math.max(V,w.x),L=Math.min(L,w.y),R=Math.max(R,w.y)}let G=i;G.x=C,G.y=L,G.z=0,A.multiplyByPoint(c,G,G);let I=o;I.x=V,I.y=L,I.z=0,A.multiplyByPoint(c,I,I),m.subtract(I,G,o);let v=r;v.x=C,v.y=R,v.z=0,A.multiplyByPoint(c,v,v),m.subtract(v,G,r)}var I5e=new m,X5e=new m,W5e=new On;Nu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=fce,s=I5e,a=X5e;E5e(e,n,y(o,0),r,s,a);let c={};mce(c,t);let d=On.fromCartesian(r,W5e);return c.southWest_HIGH=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.high,[0,0,0])}),c.southWest_LOW=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.low,[0,0,0])}),c.eastward=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),pce(e,i,c),c};var P5e=new m;function lce(e,t,n,i){let o=hce;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,P5e),s=Math.sqrt(r.x*r.x+r.y*r.y),a=W.fastApproximateAtan2(s,r.z),c=W.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var dce=new D;Nu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=lce(e.south,e.west,n,dce),r=o.x,s=o.y,a=lce(e.north,e.east,n,dce),c=a.x,d=a.y,u=0;s>d&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let h=1/(d-s),p=1/(c-r),g={sphericalExtents:new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new cc({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return mce(g,t),pce(e,i,g),g};Nu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Nu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function v5e(e){return Math.max(e.width,e.height)>Nu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Nu.shouldUseSphericalCoordinates=function(e){return v5e(e)};Nu.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var Ld=Nu;var Kgn=T(S(),1);var Ugn=T(S(),1);var w5e={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},Bn=Object.freeze(w5e);var Ogn=T(S(),1);var F5e={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP},ht=Object.freeze(F5e);var yk={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};yk.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Bn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Bn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:yk.CESIUM_3D_TILE_MASK,mask:yk.CESIUM_3D_TILE_MASK}};var Ut=Object.freeze(yk);function __(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Dn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(__.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});__.isSupported=function(e){return e.context.stencilBuffer};function i1(e,t){let n=t?Bn.EQUAL:Bn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:bc.LESS_OR_EQUAL},depthMask:!1}}function pK(e){return{stencilTest:{enabled:e,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var A5e={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function M5e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(i1(o,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(i1(o,!0)),e._rsColorPass=Ue.fromCache(pK(o,!1)),e._rsPickPass=Ue.fromCache(A5e)}function N5e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
`,r=`    extrudeDirection = czm_octDecode(${n}, 65535.0);
`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=De.replaceMain(s,"czm_non_compressed_main");let a=`void main() 
{ 
${r}    czm_non_compressed_main(); 
}`;return[i,o,s,a].join(`
`)}}function k5e(e,t){let n=t.context,i=e._primitive,o=hX;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=N5e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new De({defines:[a],sources:[o]}),d=new De({sources:[Eg]}),u=e._primitive._attributeLocations,h=new Ld(s,r,e.appearance);if(e._spStencil=$t.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=De.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let x=h.createPickFragmentShader(!1),_=h.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=$t.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let V=h.createPickFragmentShader(!0),L=h.createPickVertexShader([a],f,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=C}}else e._spPick=$t.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new De({defines:[a],sources:[o]}),e._sp=$t.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=$t.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let x=h.createFragmentShader(!0),_=h.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u})}e._spColor2D=f}}function U5e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Ee.TERRAIN_CLASSIFICATION,s=$e.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Ee.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=St(c,x._uniforms)),r.uniformMap=c,s=$e.shallowClone(r,r.derivedCommands.tileset),s.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let _=$e.shallowClone(r,r.derivedCommands.appearance2D);_.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=_,_=$e.shallowClone(s,s.derivedCommands.appearance2D),_.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=_}}let u=e._commandsIgnoreShow,h=e._spStencil,p=0;i=u.length=i/2;for(let g=0;g<i;++g){let f=u[g]=$e.shallowClone(t[p],u[g]);f.shaderProgram=h,f.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function D5e(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,d,u,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[h++];if(n&&(a=r[s++],f=i._va[a.index]),d=t[c],l(d)||(d=t[c]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Ee.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=$e.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Ee.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=$e.shallowClone(d,d.derivedCommands.tileset),u.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,g){let x=$e.shallowClone(d,d.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=x,x=$e.shallowClone(u,u.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x}}}function B5e(e,t,n,i,o,r,s){U5e(e,r),D5e(e,s)}function bce(e,t){return Math.floor(e%t/2)}function fK(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function gce(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function O5e(e,t,n,i,o,r,s,a){let c=e._primitive;In._updateBoundingVolumes(c,t,o);let d;t.mode===oe.SCENE3D?d=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,h=u!==Dn.CESIUM_3D_TILE,p=u!==Dn.TERRAIN,g=t.passes,f,x,_;if(g.render){let C=n.length;for(f=0;f<C;++f)x=d[bce(f,C)],h&&(_=n[f],fK(_,t,o,r,x,s)),p&&(_=n[f].derivedCommands.tileset,fK(_,t,o,r,x,s));if(t.invertClassification){let V=e._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=d[f],_=V[f],fK(_,t,o,r,x,s)}}if(g.pick){let C=i.length,V=c._pickOffsets;for(f=0;f<C;++f){let L=V[bce(f,C)];x=d[L.index],h&&(_=i[f],gce(_,t,o,r,x)),p&&(_=i[f].derivedCommands.tileset,gce(_,t,o,r,x))}}}__.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,d=!1,u=!0,h,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=Ld.hasAttributesForSphericalExtents(c),g=Ld.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(d=!0),u=u&&l(x)&&Yt.equals(h,x)}if(!u&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new dn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new Et({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=f,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,_){n._createBoundingVolumeFunction(x,_)}),i._createRenderStatesFunction=function(x,_,C,V){M5e(n,_)},i._createShaderProgramFunction=function(x,_,C){k5e(n,_)},i._createCommandsFunction=function(x,_,C,V,L,R,G){B5e(n,void 0,void 0,!0,!1,R,G)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,_,C,V,L,R,G,I){n._updateAndQueueCommandsFunction(x,_,C,V,L,R,G,I)}:i._updateAndQueueCommandsFunction=function(x,_,C,V,L,R,G,I){O5e(n,_,C,V,L,R,G,I)},this._primitive=new In(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ue.fromCache(i1(!1,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(i1(!1,!0)),this._rsColorPass=Ue.fromCache(pK(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ue.fromCache(i1(!0,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(i1(!0,!0)),this._rsColorPass=Ue.fromCache(pK(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};__.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};__.prototype.isDestroyed=function(){return!1};__.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,me(this)};var o1=__;var Y5e={u_globeMinimumAltitude:function(){return 55e3}};function Ml(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new dn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Dn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=di._defaultMaxTerrainHeight,this._minTerrainHeight=di._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:Y5e}}Object.defineProperties(Ml.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});Ml.isSupported=o1.isSupported;function yce(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function xce(e){return function(t,n){return e._minHeight}}var H5e=new m,z5e=new m,K5e=new m,J5e=new he,Q5e=new ce;function xk(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=m.unpack(i,h,H5e),g=m.unpack(o,h,z5e),f=m.add(p,g,K5e),x=n.cartesianToCartographic(f,J5e),_=x.latitude,C=x.longitude;s=Math.min(s,_),a=Math.min(a,C),c=Math.max(c,_),d=Math.max(d,C)}let u=Q5e;return u.north=c,u.south=s,u.east=d,u.west=a,u}function j5e(e,t,n){let i=di.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function q5e(e,t,n){let i=t.mapProjection.ellipsoid,o=xk(t,n),r=Gn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=le.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function bK(e,t){return Math.floor(e%t/2)}function gK(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function _ce(e,t,n,i,o,r){let s=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function $5e(e,t,n,i,o,r,s,a){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==Dn.CESIUM_3D_TILE,h=d!==Dn.TERRAIN,p=t.passes,g=e._primitive,f,x,_;if(p.render){let C=n.length;for(f=0;f<C;++f)x=c[bK(f,C)],u&&(_=n[f],gK(e,_,t,o,r,x,s)),h&&(_=n[f].derivedCommands.tileset,gK(e,_,t,o,r,x,s));if(t.invertClassification){let V=g._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=c[f],_=V[f],gK(e,_,t,o,r,x,s)}}if(p.pick){let C=i.length,V;for(e._useFragmentCulling||(V=g._primitive._pickOffsets),f=0;f<C;++f){if(x=c[bK(f,C)],!e._useFragmentCulling){let L=V[bK(f,C)];x=c[L.index]}u&&(_=i[f],_ce(e,_,t,o,r,x)),h&&(_=i[f].derivedCommands.tileset,_ce(e,_,t,o,r,x))}}}Ml.initializeTerrainHeights=function(){return di.initialize()};Ml.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!di.initialized){Ml.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,d=new Array(c),u,h;for(u=0;u<c;++u){o=a[u],r=o.geometry;let x=xk(e,r);l(h)?l(x)&&ce.union(h,x,h):h=ce.clone(x);let _=o.id;if(l(_)&&l(x)){let C=di.getBoundingSphere(x,i);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(C)}s=r.constructor,!l(s)||l(s.createShadowVolume)}j5e(this,h,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Tr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Tr.getHeight(this._maxTerrainHeight,p,g);let f=Ml._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let x,_=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,h=xk(e,r),Ld.shouldUseSphericalCoordinates(h)){_=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let C=xk(e,r),V=r.textureCoordinateRotationPoints;_?x=Ld.getPlanarTextureCoordinateAttributes(C,V,i,e.mapProjection,this._maxHeight):x=Ld.getSphericalExtentGeometryInstanceAttributes(C,V,i,e.mapProjection);let L=o.attributes;for(let R in L)L.hasOwnProperty(R)&&(x[R]=L[R]);d[u]=new Et({geometry:s.createShadowVolume(r,xce(this),yce(this)),attributes:x,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new Et({geometry:s.createShadowVolume(r,xce(this),yce(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,_){q5e(t,x,_)},n._updateAndQueueCommandsFunction=function(x,_,C,V,L,R,G,I){$5e(t,_,C,V,L,R,G,I)},this._primitive=new o1(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Ml.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Ml.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Ml._supportsMaterials=function(e){return e.depthTexture};Ml.supportsMaterials=function(e){return Ml._supportsMaterials(e.frameState.context)};var qc=Ml;var Yyn=T(S(),1);function r1(){pe.throwInstantiationError()}Object.defineProperties(r1.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});r1.prototype.getType=pe.throwInstantiationError;r1.prototype.getValue=pe.throwInstantiationError;r1.prototype.equals=pe.throwInstantiationError;var eke=new q;r1.getValue=function(e,t,n){let i;return l(e)||(e=q.now(eke)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=zi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==zi.ColorType)&&(n=zi.fromType(zi.ColorType)),B.clone(B.WHITE,n.uniforms.color),n)};var qo=r1;function T_(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}T_.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!J.getValueOrDefault(t.show,n,!0)};T_.prototype._setOptions=pe.throwInstantiationError;T_.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Dt,h,p=t._getIsClosed(c);if(u)h=new dn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=qo.getValue(e,d,this._material);this._material=g,h=new ao({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=dn.VERTEX_FORMAT,this._primitive=o.add(new qc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),J.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=J.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:d,appearance:new dn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};T_.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),dt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),dt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?dt.PENDING:dt.FAILED};T_.prototype.isDestroyed=function(){return!1};T_.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),me(this)};var oi=T_;var V1n=T(S(),1);var a1n=T(S(),1);var g_n=T(S(),1);var axn=T(S(),1),gX=`in vec4 v_startPlaneNormalEcAndHalfWidth;
in vec4 v_endPlaneNormalEcAndBatchId;
in vec4 v_rightPlaneEC; // Technically can compute distance for this here
in vec4 v_endEcAndStartEcX;
in vec4 v_texcoordNormalizationAndStartEcYZ;

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif

void main(void)
{
    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
    vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);

    // Discard for sky
    if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
    // Check distance of the eye coordinate against the right-facing plane
    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);

    // Check eye coordinate against the mitering planes
    float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
    float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);

    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    // Check distance of the eye coordinate against start and end planes with normals in the right plane.
    // For computing unskewed lengthwise texture coordinate.
    // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.

    // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
    vec3 alignedPlaneNormal;

    // start aligned plane
    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
    distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);

    // end aligned plane
    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
    distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);

#ifdef PER_INSTANCE_COLOR
    out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
    // Clamp - distance to aligned planes may be negative due to mitering,
    // so fragment texture coordinate might be out-of-bounds.
    float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
    s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
    float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);

    czm_materialInput materialInput;

    materialInput.s = s;
    materialInput.st = vec2(s, t);
    materialInput.str = vec3(s, t, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

    czm_writeDepthClamp();
}
`;var lxn=T(S(),1),yX=`in vec3 v_forwardDirectionEC;
in vec3 v_texcoordNormalizationAndHalfWidth;
in float v_batchId;

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#else
in vec2 v_alignedPlaneDistances;
in float v_texcoordT;
#endif

float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
    // We don't expect the ray to ever be parallel to the plane
    return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
}

void main(void)
{
    vec4 eyeCoordinate = gl_FragCoord;
    eyeCoordinate /= eyeCoordinate.w;

#ifdef PER_INSTANCE_COLOR
    out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
    // Use distances for planes aligned with segment to prevent skew in dashing
    float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
    float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);

    // Clamp - distance to aligned planes may be negative due to mitering
    distanceFromStart = max(0.0, distanceFromStart);
    distanceFromEnd = max(0.0, distanceFromEnd);

    float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
    s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;

    czm_materialInput materialInput;

    materialInput.s = s;
    materialInput.st = vec2(s, v_texcoordT);
    materialInput.str = vec3(s, v_texcoordT, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
}
`;var uxn=T(S(),1),xX=`in vec3 position3DHigh;
in vec3 position3DLow;

in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;

in float batchId;

out vec3 v_forwardDirectionEC;
out vec3 v_texcoordNormalizationAndHalfWidth;
out float v_batchId;

// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#else
out vec2 v_alignedPlaneDistances;
out float v_texcoordT;
#endif

// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
void main()
{
    v_batchId = batchId;

    // Start position
    vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
    vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
    vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
    vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
    vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
    vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;

    // Start plane
    vec4 startPlane2D;
    vec4 startPlane3D;
    startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
    startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
    startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
    startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);

    // Right plane
    vec4 rightPlane2D;
    vec4 rightPlane3D;
    rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
    rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
    rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
    rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);

    // End position
    posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
    posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
    posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
    posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
    posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
    vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
    vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
    vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));

    // End plane
    vec4 endPlane2D;
    vec4 endPlane3D;
    endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
    endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
    endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
    endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);

    // Forward direction
    v_forwardDirectionEC = normalize(endEC - startEC);

    vec2 cleanTexcoordNormalization2D;
    cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
    cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
    vec2 cleanTexcoordNormalization3D;
    cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
    cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
    cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));

    v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#else // PER_INSTANCE_COLOR
    // For computing texture coordinates

    v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
    v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
#endif // PER_INSTANCE_COLOR

#ifdef WIDTH_VARYING
    float width = czm_batchTable_width(batchId);
    float halfWidth = width * 0.5;
    v_width = width;
    v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#else
    float halfWidth = 0.5 * czm_batchTable_width(batchId);
    v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#endif

    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
    // Since this is morphing, compute both 3D and 2D positions and then blend.

    // ****** 3D ******
    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
    float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
    float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
    vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    vec3 normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.

    // Nudge the top vertex upwards to prevent flickering
    vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
    geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
    positionEc3D.xyz += geodeticSurfaceNormal;

    // Determine if this vertex is on the "left" or "right"
    normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);

    // A "perfect" implementation would push along normals according to the angle against forward.
    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
    positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)

    // ****** 2D ******
    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
    absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
    absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
    planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
    upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.

    // Nudge the top vertex upwards to prevent flickering
    geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
    geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
    positionEc2D.xyz += geodeticSurfaceNormal;

    // Determine if this vertex is on the "left" or "right"
    normalEC *= sign(texcoordNormalization2D.x);
#ifndef PER_INSTANCE_COLOR
    // Use vertex's sidedness to compute its texture coordinate.
    v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
#endif

    // A "perfect" implementation would push along normals according to the angle against forward.
    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
    positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)

    // Blend for actual position
    gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);

#ifdef ANGLE_VARYING
    // Approximate relative screen space direction of the line.
    vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var hxn=T(S(),1),_X=`in vec3 position3DHigh;
in vec3 position3DLow;

// In 2D and in 3D, texture coordinate normalization component signs encodes:
// * X sign - sidedness relative to right plane
// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
#ifndef COLUMBUS_VIEW_2D
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
#else
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
#endif

in float batchId;

out vec4 v_startPlaneNormalEcAndHalfWidth;
out vec4 v_endPlaneNormalEcAndBatchId;
out vec4 v_rightPlaneEC;
out vec4 v_endEcAndStartEcX;
out vec4 v_texcoordNormalizationAndStartEcYZ;

// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif

void main()
{
#ifdef COLUMBUS_VIEW_2D
    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;

    vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
    vec3 ecEnd = forwardDirectionEC + ecStart;
    forwardDirectionEC = normalize(forwardDirectionEC);

    // Right plane
    v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);

    // start plane
    vec4 startPlaneEC;
    startPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.xy);
    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);

    // end plane
    vec4 endPlaneEC;
    endPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.zw);
    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);

    v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
    v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;

#else // COLUMBUS_VIEW_2D
    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
    vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
    vec3 ecEnd = ecStart + offset;

    vec3 forwardDirectionEC = normalize(offset);

    // start plane
    vec4 startPlaneEC;
    startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);

    // end plane
    vec4 endPlaneEC;
    endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);

    // Right plane
    v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);

    v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
    v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;

#endif // COLUMBUS_VIEW_2D

    v_endEcAndStartEcX.xyz = ecEnd;
    v_endEcAndStartEcX.w = ecStart.x;
    v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#endif // PER_INSTANCE_COLOR

    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
    vec4 positionRelativeToEye = czm_computePosition();

    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
    float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
    float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
    vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    vec3 normalEC = normalize(cross(planeDirection, upOrDown));           // In practice, the opposite seems to work too.

    // Extrude bottom vertices downward for far view distances, like for GroundPrimitives
    upOrDown = cross(forwardDirectionEC, normalEC);
    upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
    upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
    upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
    positionEC.xyz += upOrDown;

    v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));

    // Determine distance along normalEC to push for a volume of appropriate width.
    // Make volumes about double pixel width for a conservative fit - in practice the
    // extra cost here is minimal compared to the loose volume heights.
    //
    // N = normalEC (guaranteed "right-facing")
    // R = rightEC
    // p = angle between N and R
    // w = distance to push along R if R == N
    // d = distance to push along N
    //
    //   N   R
    //  {  p| }      * cos(p) = dot(N, R) = w / d
    //  d  |  |w    * d = w / dot(N, R)
    //    { | }
    //       o---------- polyline segment ---->
    //
    float width = czm_batchTable_width(batchId);
#ifdef WIDTH_VARYING
    v_width = width;
#endif

    v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
    v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;

    v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
    v_endPlaneNormalEcAndBatchId.w = batchId;

    width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
    width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N

    // Determine if this vertex is on the "left" or "right"
#ifdef COLUMBUS_VIEW_2D
        normalEC *= sign(texcoordNormalization2D.x);
#else
        normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
#endif

    positionEC.xyz += width * normalEC;
    gl_Position = czm_depthClamp(czm_projection * positionEC);

#ifdef ANGLE_VARYING
    // Approximate relative screen space direction of the line.
    vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var Rxn=T(S(),1);var pxn=T(S(),1),TX=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec4 color;
in float batchId;

out vec4 v_color;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = czm_computePosition();
    vec4 prev = czm_computePrevPosition();
    vec4 next = czm_computeNextPosition();

    float angle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;

    v_color = color;
}
`;var gxn=T(S(),1),Rd=`void clipLineSegmentToNearPlane(
    vec3 p0,
    vec3 p1,
    out vec4 positionWC,
    out bool clipped,
    out bool culledByNearPlane,
    out vec4 clippedPositionEC)
{
    culledByNearPlane = false;
    clipped = false;

    vec3 p0ToP1 = p1 - p0;
    float magnitude = length(p0ToP1);
    vec3 direction = normalize(p0ToP1);

    // Distance that p0 is behind the near plane. Negative means p0 is
    // in front of the near plane.
    float endPoint0Distance =  czm_currentFrustum.x + p0.z;

    // Camera looks down -Z.
    // When moving a point along +Z: LESS VISIBLE
    //   * Points in front of the camera move closer to the camera.
    //   * Points behind the camrea move farther away from the camera.
    // When moving a point along -Z: MORE VISIBLE
    //   * Points in front of the camera move farther away from the camera.
    //   * Points behind the camera move closer to the camera.

    // Positive denominator: -Z, becoming more visible
    // Negative denominator: +Z, becoming less visible
    // Nearly zero: parallel to near plane
    float denominator = -direction.z;

    if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
    {
        // p0 is behind the near plane and the line to p1 is nearly parallel to
        // the near plane, so cull the segment completely.
        culledByNearPlane = true;
    }
    else if (endPoint0Distance > 0.0)
    {
        // p0 is behind the near plane, and the line to p1 is moving distinctly
        // toward or away from it.

        // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
        float t = endPoint0Distance / denominator;
        if (t < 0.0 || t > magnitude)
        {
            // Near plane intersection is not between the two points.
            // We already confirmed p0 is behind the naer plane, so now
            // we know the entire segment is behind it.
            culledByNearPlane = true;
        }
        else
        {
            // Segment crosses the near plane, update p0 to lie exactly on it.
            p0 = p0 + t * direction;

            // Numerical noise might put us a bit on the wrong side of the near plane.
            // Don't let that happen.
            p0.z = min(p0.z, -czm_currentFrustum.x);

            clipped = true;
        }
    }

    clippedPositionEC = vec4(p0, 1.0);
    positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
}

vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
{
    // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.

#ifdef POLYLINE_DASH
    // Compute the window coordinates of the points.
    vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
    vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
    vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);

    // Determine the relative screen space direction of the line.
    vec2 lineDir;
    if (usePrevious) {
        lineDir = normalize(positionWindow.xy - previousWindow.xy);
    }
    else {
        lineDir = normalize(nextWindow.xy - positionWindow.xy);
    }
    angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)

    // Quantize the angle so it doesn't change rapidly between segments.
    angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
#endif

    vec4 clippedPrevWC, clippedPrevEC;
    bool prevSegmentClipped, prevSegmentCulled;
    clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);

    vec4 clippedNextWC, clippedNextEC;
    bool nextSegmentClipped, nextSegmentCulled;
    clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);

    bool segmentClipped, segmentCulled;
    vec4 clippedPositionWC, clippedPositionEC;
    clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);

    if (segmentCulled)
    {
        return vec4(0.0, 0.0, 0.0, 1.0);
    }

    vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
    vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);

    // If a segment was culled, we can't use the corresponding direction
    // computed above. We should never see both of these be true without
    // \`segmentCulled\` above also being true.
    if (prevSegmentCulled)
    {
        directionToPrevWC = -directionToNextWC;
    }
    else if (nextSegmentCulled)
    {
        directionToNextWC = -directionToPrevWC;
    }

    vec2 thisSegmentForwardWC, otherSegmentForwardWC;
    if (usePrevious)
    {
        thisSegmentForwardWC = -directionToPrevWC;
        otherSegmentForwardWC = directionToNextWC;
    }
    else
    {
        thisSegmentForwardWC = directionToNextWC;
        otherSegmentForwardWC =  -directionToPrevWC;
    }

    vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);

    vec2 leftWC = thisSegmentLeftWC;
    float expandWidth = width * 0.5;

    // When lines are split at the anti-meridian, the position may be at the
    // same location as the next or previous position, and we need to handle
    // that to avoid producing NaNs.
    if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
    {
        vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);

        vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
        float leftSumLength = length(leftSumWC);
        leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);

        // The sine of the angle between the two vectors is given by the formula
        //         |a x b| = |a||b|sin(theta)
        // which is
        //     float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
        // Because the z components of both vectors are zero, the x and y coordinate will be zero.
        // Therefore, the sine of the angle is just the z component of the cross product.
        vec2 u = -thisSegmentForwardWC;
        vec2 v = leftWC;
        float sinAngle = abs(u.x * v.y - u.y * v.x);
        expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 0.5);
    }

    vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
    return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
}

vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
{
    vec4 positionEC = czm_modelViewRelativeToEye * position;
    vec4 prevEC = czm_modelViewRelativeToEye * previous;
    vec4 nextEC = czm_modelViewRelativeToEye * next;
    return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
}
`;var yK=`${Rd}
${TX}`,tke=g_;Bt.isInternetExplorer()||(yK=`#define CLIP_POLYLINE 
${yK}`);function S_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=S_.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,yK),this._fragmentShaderSource=y(e.fragmentShaderSource,tke),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(S_.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});S_.VERTEX_FORMAT=Xe.POSITION_ONLY;S_.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;S_.prototype.isTranslucent=io.prototype.isTranslucent;S_.prototype.getRenderState=io.prototype.getRenderState;var es=S_;var Uxn=T(S(),1);var Gxn=T(S(),1),SX=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec2 st;
in float batchId;

out float v_width;
out vec2 v_st;
out float v_polylineAngle;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = czm_computePosition();
    vec4 prev = czm_computePrevPosition();
    vec4 next = czm_computeNextPosition();

    float angle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;

    v_width = width;
    v_st.s = st.s;
    v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
    v_polylineAngle = angle;
}
`;var Ixn=T(S(),1),C_=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_st;

void main()
{
    czm_materialInput materialInput;

    vec2 st = v_st;
    st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);

    materialInput.s = st.s;
    materialInput.st = st;
    materialInput.str = vec3(st, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#ifdef VECTOR_TILE
    out_FragColor *= u_highlightColor;
#endif

    czm_writeLogDepth();
}
`;var xK=`${Rd}
${SX}`,nke=C_;Bt.isInternetExplorer()||(xK=`#define CLIP_POLYLINE 
${xK}`);function V_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=V_.VERTEX_FORMAT;this.material=l(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,xK),this._fragmentShaderSource=y(e.fragmentShaderSource,nke),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(V_.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});V_.VERTEX_FORMAT=Xe.POSITION_AND_ST;V_.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;V_.prototype.isTranslucent=io.prototype.isTranslucent;V_.prototype.getRenderState=io.prototype.getRenderState;var ua=V_;function cb(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ua),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Dn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Tce(!1),this._renderState3DTiles=Tce(!0),this._renderStateMorph=Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(cb.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});cb.initializeTerrainHeights=function(){return di.initialize()};function ike(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(_X);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(xX);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(gX),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new De({defines:d,sources:[s]}),f=new De({defines:p,sources:[h,c]});e._sp=$t.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:f,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new De({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=x;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let C=new De({defines:d.concat([`MAX_TERRAIN_HEIGHT ${di._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(yX);let V=new De({defines:p,sources:[h,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=_}function Tce(e){return Ue.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Bn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Bn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function oke(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof es?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let h=0;h<a;h++){let p=s._va[h],g=o[h];l(g)||(g=o[h]=new $e({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=u,g.pass=Ee.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=$e.shallowClone(g,g.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=f;let x=$e.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let _=$e.shallowClone(f,f.derivedCommands.color2D);_.shaderProgram=e._sp2D,f.derivedCommands.color2D=_;let C=$e.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function Sce(e,t,n,i,o,r,s){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function rke(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let c;t.mode===oe.SCENE3D?c=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===oe.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===oe.MORPHING,u=e.classificationType,h=u!==Dn.CESIUM_3D_TILE,p=u!==Dn.TERRAIN&&!d,g,f=t.passes;if(f.render||f.pick&&a.allowPicking){let x=n.length;for(let _=0;_<x;++_){let C=c[_];h&&(g=n[_],Sce(e,g,t,o,r,C,s)),p&&(g=n[_].derivedCommands.tileset,Sce(e,g,t,o,r,C,s))}}}cb.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!di.initialized){cb.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let d=c.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);l(a.width)||(a.width=new cc({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,zx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Et({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){ike(n,d,u)},i._createCommandsFunction=function(c,d,u,h,p,g,f){oke(n,d,u,h,g,f)},i._updateAndQueueCommandsFunction=function(c,d,u,h,p,g,f,x){rke(n,d,u,h,p,g,f)},this._primitive=new In(i)}if(this.appearance instanceof es&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};cb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};cb.isSupported=function(e){return e.frameState.context.depthTexture};cb.prototype.isDestroyed=function(){return!1};cb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,me(this)};var Jm=cb;var U_n=T(S(),1);var v_n=T(S(),1);var Z_n=T(S(),1);var ske=new D(1,1),ake=!1,cke=B.WHITE;function s1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(s1.prototype,{isConstant:{get:function(){return J.isConstant(this._image)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});s1.prototype.getType=function(e){return"Image"};var lke=new q;s1.prototype.getValue=function(e,t){return l(e)||(e=q.now(lke)),l(t)||(t={}),t.image=J.getValueOrUndefined(this._image,e),t.repeat=J.getValueOrClonedDefault(this._repeat,e,ske,t.repeat),t.color=J.getValueOrClonedDefault(this._color,e,cke,t.color),J.getValueOrDefault(this._transparent,e,ake)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};s1.prototype.equals=function(e){return this===e||e instanceof s1&&J.equals(this._image,e._image)&&J.equals(this._repeat,e._repeat)&&J.equals(this._color,e._color)&&J.equals(this._transparent,e._transparent)};var Ig=s1;function dke(e){if(e instanceof B)return new Dt(e);if(typeof e=="string"||e instanceof Ze||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Ig;return t.image=e,t}}function uke(e,t){return ue(e,t,dke)}var Wo=uke;function CX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(CX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});CX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new CX(this)};CX.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var L_=CX;var oTn=T(S(),1);var J_n=T(S(),1);function a1(){pe.throwInstantiationError()}Object.defineProperties(a1.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});a1.prototype.getValue=pe.throwInstantiationError;a1.prototype.getValueInReferenceFrame=pe.throwInstantiationError;a1.prototype.equals=pe.throwInstantiationError;var Cce=new $;a1.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=Pt.computeIcrfToCentralBodyFixedMatrix(e,Cce);if(n===Ui.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ui.FIXED)return $.multiplyByVector($.transpose(r,Cce),t,o)};var Qm=a1;function R_(e,t){this._definitionChanged=new be,this._value=m.clone(e),this._referenceFrame=y(t,Ui.FIXED)}Object.defineProperties(R_.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var mke=new q;R_.prototype.getValue=function(e,t){return l(e)||(e=q.now(mke)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};R_.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};R_.prototype.getValueInReferenceFrame=function(e,t,n){return Qm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};R_.prototype.equals=function(e){return this===e||e instanceof R_&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var $c=R_;var uTn=T(S(),1);function VX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(VX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});VX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new VX(this)};VX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Z_=VX;var fTn=T(S(),1);function hke(e){return e}function fke(e,t){return ue(e,t,hke)}var el=fke;var TTn=T(S(),1);function LX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(LX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),length:ue("length"),topRadius:ue("topRadius"),bottomRadius:ue("bottomRadius"),heightReference:ue("heightReference"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});LX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new LX(this)};LX.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var G_=LX;var GTn=T(S(),1);function RX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(RX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),semiMajorAxis:ue("semiMajorAxis"),semiMinorAxis:ue("semiMinorAxis"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});RX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new RX(this)};RX.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var E_=RX;var wTn=T(S(),1);function ZX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(ZX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),radii:ue("radii"),innerRadii:ue("innerRadii"),minimumClock:ue("minimumClock"),maximumClock:ue("maximumClock"),minimumCone:ue("minimumCone"),maximumCone:ue("maximumCone"),heightReference:ue("heightReference"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),stackPartitions:ue("stackPartitions"),slicePartitions:ue("slicePartitions"),subdivisions:ue("subdivisions"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});ZX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new ZX(this)};ZX.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var I_=ZX;var UTn=T(S(),1);function GX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(GX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),text:ue("text"),font:ue("font"),style:ue("style"),scale:ue("scale"),showBackground:ue("showBackground"),backgroundColor:ue("backgroundColor"),backgroundPadding:ue("backgroundPadding"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),fillColor:ue("fillColor"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),scaleByDistance:ue("scaleByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance")});GX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new GX(this)};GX.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var jm=GX;var hSn=T(S(),1);var QTn=T(S(),1);var _K=new Vg;function EX(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(EX.prototype,{isConstant:{get:function(){return J.isConstant(this._translation)&&J.isConstant(this._rotation)&&J.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var pke=new q;EX.prototype.getValue=function(e,t){return l(e)||(e=q.now(pke)),l(t)||(t=new Vg),t.translation=J.getValueOrClonedDefault(this._translation,e,_K.translation,t.translation),t.rotation=J.getValueOrClonedDefault(this._rotation,e,_K.rotation,t.rotation),t.scale=J.getValueOrClonedDefault(this._scale,e,_K.scale,t.scale),t};EX.prototype.equals=function(e){return this===e||e instanceof EX&&J.equals(this._translation,e._translation)&&J.equals(this._rotation,e._rotation)&&J.equals(this._scale,e._scale)};var X_=EX;var rSn=T(S(),1);function lb(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(lb.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!J.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});lb.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function bke(e){return new Qn(e)}lb.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,ue(e,!0,y(n,bke))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};lb.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var gke=new q;lb.prototype.getValue=function(e,t){l(e)||(e=q.now(gke)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=J.getValueOrUndefined(this[r],e,t[r])}return t};lb.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function yke(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!J.equals(e[s],t[s]))return!1}return!0}lb.prototype.equals=function(e){return this===e||e instanceof lb&&yke(this,e)};var tl=lb;function Vce(e){return new X_(e)}function xke(e){return new tl(e,Vce)}function _ke(e){return new tl(e)}function Tke(e){return new tl(e)}function IX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(IX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),scale:ue("scale"),enableVerticalExaggeration:ue("enableVerticalExaggeration"),minimumPixelSize:ue("minimumPixelSize"),maximumScale:ue("maximumScale"),incrementallyLoadTextures:ue("incrementallyLoadTextures"),runAnimations:ue("runAnimations"),clampAnimations:ue("clampAnimations"),shadows:ue("shadows"),heightReference:ue("heightReference"),silhouetteColor:ue("silhouetteColor"),silhouetteSize:ue("silhouetteSize"),color:ue("color"),colorBlendMode:ue("colorBlendMode"),colorBlendAmount:ue("colorBlendAmount"),imageBasedLightingFactor:ue("imageBasedLightingFactor"),environmentMapOptions:ue("environmentMapOptions",void 0,Tke),lightColor:ue("lightColor"),distanceDisplayCondition:ue("distanceDisplayCondition"),nodeTransformations:ue("nodeTransformations",void 0,xke),articulations:ue("articulations",void 0,_ke),clippingPlanes:ue("clippingPlanes"),customShader:ue("customShader")});IX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new IX(this)};IX.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.enableVerticalExaggeration=y(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.environmentMapOptions=y(this.environmentMapOptions,e.environmentMapOptions),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new tl(t,Vce)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new tl(n)}};var db=IX;var xSn=T(S(),1);function XX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(XX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),maximumScreenSpaceError:ue("maximumScreenSpaceError")});XX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new XX(this)};XX.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var W_=XX;var RSn=T(S(),1);function WX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(WX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),leadTime:ue("leadTime"),trailTime:ue("trailTime"),width:ue("width"),resolution:ue("resolution"),material:Wo("material"),distanceDisplayCondition:ue("distanceDisplayCondition")});WX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new WX(this)};WX.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ub=WX;var PSn=T(S(),1);function PX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(PX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),plane:ue("plane"),dimensions:ue("dimensions"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});PX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new PX(this)};PX.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var vX=PX;var NSn=T(S(),1);function wX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),pixelSize:ue("pixelSize"),heightReference:ue("heightReference"),color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});wX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new wX(this)};wX.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var P_=wX;var KSn=T(S(),1);function Ske(e){return Array.isArray(e)&&(e=new va(e)),new Qn(e)}function FX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(FX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),hierarchy:ue("hierarchy",void 0,Ske),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),perPositionHeight:ue("perPositionHeight"),closeTop:ue("closeTop"),closeBottom:ue("closeBottom"),arcType:ue("arcType"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex"),textureCoordinates:ue("textureCoordinates")});FX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new FX(this)};FX.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var qm=FX;var tCn=T(S(),1);function AX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(AX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),granularity:ue("granularity"),material:Wo("material"),depthFailMaterial:Wo("depthFailMaterial"),arcType:ue("arcType"),clampToGround:ue("clampToGround"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});AX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new AX(this)};AX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var gc=AX;var cCn=T(S(),1);function MX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(MX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),shape:ue("shape"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});MX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new MX(this)};MX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var v_=MX;var pCn=T(S(),1);function NX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(NX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),coordinates:ue("coordinates"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});NX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new NX(this)};NX.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var $m=NX;var SCn=T(S(),1);function kX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(kX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),minimumHeights:ue("minimumHeights"),maximumHeights:ue("maximumHeights"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});kX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new kX(this)};kX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var mb=kX;var Cke=new he,TK=[];function Vke(e){return new $c(e)}function Lke(e){return ue(e,void 0,Vke)}function Bs(e,t){return ue(e,void 0,function(n){return n instanceof t?n:new t(n)})}function ku(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=Hn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=y(e.show,!0),this._trackingReferenceFrame=y(e.trackingReferenceFrame,nb.AUTODETECT),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...TK],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function SK(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&SK(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(ku.prototype,{availability:el("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:el("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&SK(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:el("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&SK(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Bs("billboard",pc),box:Bs("box",L_),corridor:Bs("corridor",Z_),cylinder:Bs("cylinder",G_),description:ue("description"),ellipse:Bs("ellipse",E_),ellipsoid:Bs("ellipsoid",I_),label:Bs("label",jm),model:Bs("model",db),tileset:Bs("tileset",W_),orientation:ue("orientation"),path:Bs("path",ub),plane:Bs("plane",vX),point:Bs("point",P_),polygon:Bs("polygon",qm),polyline:Bs("polyline",gc),polylineVolume:Bs("polylineVolume",v_),properties:Bs("properties",tl),position:Lke("position"),rectangle:Bs("rectangle",$m),viewFrom:ue("viewFrom"),wall:Bs("wall",mb)});ku.registerEntityType=function(e,t){Object.defineProperties(ku.prototype,{[e]:Bs(e,t)}),TK.includes(e)||TK.push(e)};ku.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};ku.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,el(e,!0))};ku.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};ku.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var Lce=new $,Rce=new m,Zce=new ve;ku.prototype.computeModelMatrix=function(e,t){let n=J.getValueOrUndefined(this._position,e,Rce);if(!l(n))return;let i=J.getValueOrUndefined(this._orientation,e,Zce);return l(i)?t=A.fromRotationTranslation($.fromQuaternion(i,Lce),n,t):t=Pt.eastNorthUpToFixedFrame(n,void 0,t),t};ku.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=J.getValueOrDefault(t,e,Je.NONE),s=J.getValueOrUndefined(this._position,e,Rce);if(r===Je.NONE||!l(s)||m.equalsEpsilon(s,m.ZERO,W.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,Cke);Mu(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=J.getValueOrUndefined(this._orientation,e,Zce);return l(c)?o=A.fromRotationTranslation($.fromQuaternion(c,Lce),s,o):o=Pt.eastNorthUpToFixedFrame(s,void 0,o),o};ku.supportsMaterialsforEntitiesOnTerrain=function(e){return qc.supportsMaterials(e)};ku.supportsPolylinesOnTerrain=function(e){return Jm.isSupported(e)};var $o=ku;var Rke=new Dt(B.WHITE),Zke=new Qn(!0),Gke=new Qn(!0),Eke=new Qn(!1),Ike=new Qn(B.BLACK),Xke=new Qn(Tn.DISABLED),Wke=new Qn(new wt),Pke=new Qn(Dn.BOTH);function nl(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=$o.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(nl.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&J.isConstant(this._showProperty)&&J.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&J.isConstant(this._showProperty)&&J.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});nl.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};nl.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};nl.prototype.createFillGeometryInstance=pe.throwInstantiationError;nl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;nl.prototype.isDestroyed=function(){return!1};nl.prototype.destroy=function(){me(this)};nl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Be.MINIMUM_VALUE)};nl.prototype._isOnTerrain=function(e,t){return!1};nl.prototype._getIsClosed=function(e){return!0};nl.prototype._isDynamic=pe.throwInstantiationError;nl.prototype._setStaticOptions=pe.throwInstantiationError;nl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(Be.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Be.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,Rke),this._fillProperty=y(r,Gke),this._showProperty=y(d,Zke),this._showOutlineProperty=y(o.outline,Eke),this._outlineColorProperty=c?y(o.outlineColor,Ike):void 0,this._shadowsProperty=y(o.shadows,Xke),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,Wke),this._classificationTypeProperty=y(o.classificationType,Pke),this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Dt);if(c&&u&&(_t(_t.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(Be.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};nl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ri=nl;var z1n=T(S(),1);var E1n=T(S(),1);function c1(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(c1.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var vke=new q;c1.prototype.getValue=function(e,t){return l(e)||(e=q.now(vke)),this._callback(e,t)};c1.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};c1.prototype.equals=function(e){return this===e||e instanceof c1&&this._callback===e._callback&&this._isConstant===e._isConstant};var eh=c1;var U1n=T(S(),1);var Gce=new m;function l1(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new he,this._normal=new m,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Be.MINIMUM_VALUE,Gce);if(!l(r)||m.equals(r,m.ZERO)||!l(e.globe))return;this._position=m.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(l1.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});l1.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(m.equals(t,m.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var wke=new q;l1.prototype.getValue=function(e,t){l(e)||(e=q.now(wke));let n=J.getValueOrDefault(this._heightReference,e,Je.NONE),i=J.getValueOrDefault(this._extrudedHeightReference,e,Je.NONE);if(n===Je.NONE&&!$C(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Gce);if(!l(r)||m.equals(r,m.ZERO)||!l(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,W.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};l1.prototype.isDestroyed=function(){return!1};l1.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var w_=l1;function Fke(e,t,n,i){if(ri.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new eh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new w_(this._scene,s,r)}}var hb=Fke;var Ece=m.ZERO,Ice=new m,Ake=new m,Xce=new B;function Mke(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Zd(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Mke(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Zd.prototype=Object.create(ri.prototype),Zd.prototype.constructor=Zd);Object.defineProperties(Zd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Zd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Xce)),l(a)||(a=B.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Ece,Ice))),new Et({id:t,geometry:Ea.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Zd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Xce),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Ece,Ice))),new Et({id:t,geometry:Am.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Zd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Zd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ri.prototype._isHidden.call(this,e,t)};Zd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};Zd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Be.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Je.NONE?rn.ALL:void 0};Zd.prototype._onEntityPropertyChanged=hb;Zd.DynamicGeometryUpdater=d1;function d1(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(d1.prototype=Object.create(oi.prototype),d1.prototype.constructor=d1);d1.prototype._isHidden=function(e,t,n){let i=J.getValueOrUndefined(e.position,n,Ake),o=this._options.dimensions;return!l(i)||!l(o)||oi.prototype._isHidden.call(this,e,t,n)};d1.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,Je.NONE),o=this._options;o.dimensions=J.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Je.NONE?rn.ALL:void 0};var UX=Zd;var CVn=T(S(),1);function F_(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,Ui.FIXED),this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(F_.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Nke=new q;F_.prototype.getValue=function(e,t){return l(e)||(e=q.now(Nke)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};F_.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};F_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Qm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};F_.prototype.equals=function(e){return this===e||e instanceof F_&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var DX=F_;var Csi=T(S(),1);var msi=T(S(),1);var UVn=T(S(),1);var vVn=T(S(),1);function A_(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(A_.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});A_.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function CK(e){e._cubeMapBuffers=void 0}A_.prototype.update=function(e){let{context:t}=e;if(!A_.isSupported(t))return;if(l(this._texture)){CK(this);return}if(!l(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);l(u)&&(CK(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let u=this;Zl(this._url).then(function(h){u._cubeMapBuffers=h,u._loading=!1}).catch(function(h){u.isDestroyed()||u._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT);let o=it.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(xr.FaceName).forEach(h=>{u[h]=void 0});for(let h=r;h<a;h++)n.push(u)}let c=new qt({minificationFilter:jt.LINEAR_MIPMAP_LINEAR}),d=new xr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};A_.prototype.isDestroyed=function(){return!1};A_.prototype.destroy=function(){return CK(this),this._texture=this._texture&&this._texture.destroy(),me(this)};var th=A_;function BX(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?D.clone(e.imageBasedLightingFactor):new D(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=D.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(BX.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=D.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function kke(e,t){if(th.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new th(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}BX.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;D.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(kke(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};BX.prototype.isDestroyed=function(){return!1};BX.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var M_=BX;var YVn=T(S(),1);var fb={X:0,Y:1,Z:2};fb.Y_UP_TO_Z_UP=A.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));fb.Z_UP_TO_Y_UP=A.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));fb.X_UP_TO_Z_UP=A.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));fb.Z_UP_TO_X_UP=A.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));fb.X_UP_TO_Y_UP=A.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));fb.Y_UP_TO_X_UP=A.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));fb.fromName=function(e){return fb[e]};var Po=Object.freeze(fb);var Wii=T(S(),1);var KVn=T(S(),1);function Wce(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Wce.prototype,{metadata:{get:function(){return this._metadata}}});var N_=Wce;var Lei=T(S(),1);var nLn=T(S(),1);function Uu(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Uu.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var OX=Uint32Array.BYTES_PER_ELEMENT;Uu.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=OX;let c=a.getUint32(o,!0);if(c!==1)throw new ae(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=OX,o+=OX;let d=a.getUint32(o,!0);o+=OX;let u=n.queryParameters.compositeIndex;l(u)?u=`${u}_`:u="";let h=[];h.length=d;for(let f=0;f<d;++f){let x=zm(s,o),_=a.getUint32(o+OX*2,!0),C=r[x],V=`${u}${f}`,L=n.getDerivedResource({queryParameters:{compositeIndex:V}});if(l(C))h[f]=Promise.resolve(C(e,t,L,i,o));else throw new ae(`Unknown tile content type, ${x}, inside Composite tile`);o+=_}let p=await Promise.all(h);return new Uu(e,t,n,p)};Uu.prototype.hasProperty=function(e,t){return!1};Uu.prototype.getFeature=function(e){};Uu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Uu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Uu.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Uu.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=m.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};Uu.prototype.isDestroyed=function(){return!1};Uu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var YX=Uu;var WZn=T(S(),1);var cRn=T(S(),1);var pLn=T(S(),1);function yc(e){this._id=Hn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,At.maximumTextureSize),r=Math.ceil(t/At.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new D(o,r),i=new se(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(yc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});yc.DEFAULT_COLOR_VALUE=B.WHITE;yc.DEFAULT_SHOW_VALUE=!0;function Pce(e){let t=e._textureDimensions;return t.x*t.y*4}function vce(e){if(!l(e._batchValues)){let t=Pce(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function wce(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}yc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=wce(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=vce(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};yc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};yc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Uke=new Array(4);yc.prototype.setColor=function(e,t){if(B.equals(t,yc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Uke),i=n[3],o=vce(this),r=e*4,s=wce(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,d=s[a]!==0;o[r+3]=d?i:0,s[a+1]=i;let u=i!==255;u&&!c?++this._translucentFeaturesLength:!u&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};yc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};yc.prototype.getColor=function(e,t){if(!l(this._batchValues))return B.clone(yc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return B.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};yc.prototype.getPickColor=function(e){return this._pickIds[e]};function Fce(e,t,n){let i=e._textureDimensions;return new vt({context:t,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:qt.NEAREST})}function Dke(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Pce(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let d=t.createPickId(s.getFeature(c));i.push(d);let u=d.color,h=c*4;r[h]=B.floatToByte(u.red),r[h+1]=B.floatToByte(u.green),r[h+2]=B.floatToByte(u.blue),r[h+3]=B.floatToByte(u.alpha)}e._pickTexture=Fce(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function Bke(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}yc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Dke(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Fce(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),Bke(this))};yc.prototype.isDestroyed=function(){return!1};yc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var il=yc;var vLn=T(S(),1);var VLn=T(S(),1);var Oke={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Yke={SCALAR:void 0,VEC2:D,VEC3:m,VEC4:se,MAT2:Ii,MAT3:$,MAT4:A};function Hke(e){let t=e.componentType,n;typeof t=="string"?n=Q.fromName(t):n=t;let i=Oke[e.type],o=Yke[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return Q.createArrayBufferView(n,r,s,i*a)}}}var Gd=Hke;function pb(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,zke(this,e.extension,e.binaryBody)}Object.defineProperties(pb.prototype,{byteLength:{get:function(){return this._byteLength}}});function zke(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,h=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,Q.UNSIGNED_SHORT),c.type=on.SCALAR,r=Gd(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(d)){for(l(d.byteOffset)&&(d.componentType=y(d.componentType,Q.UNSIGNED_SHORT),d.type=on.SCALAR,r=Gd(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=d[i];p+=g.byteLength}l(u)&&l(u.byteOffset)&&(u.componentType=y(u.componentType,Q.UNSIGNED_SHORT),u.type=on.SCALAR,r=Gd(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,h),p+=u.byteLength);let f=a.length;for(i=0;i<f;++i){let C=a[i].length,V=a[i].instances,L=Kke(C,V,n);p+=Jke(L),a[i].instances=St(L,V)}let x=new Array(f).fill(0),_=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],_[i]=x[o],++x[o];p+=_.byteLength,e._classes=a,e._classIds=c,e._classIndexes=_,e._parentCounts=d,e._parentIndexes=g,e._parentIds=u,e._byteLength=p}function Kke(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new ae("componentType is required.");if(!l(c))throw new ae("type is required.");if(!l(n))throw new ae(`Property ${o} requires a batch table binary.`);let d=Gd(r),u=d.componentsPerAttribute,h=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:h}}}return i}function Jke(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Qke=[],jke=[],qke=0;function $ke(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=Qke;c.length=Math.max(c.length,a);let d=++qke,u=jke;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let h=n(e,t);if(l(h))return h;let p=o[t],g=s[t];for(let f=0;f<p;++f){let x=r[g+f];x!==t&&u.push(x)}}}function eUe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function HX(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return $ke(e,t,n)}else return n(e,t);return eUe(e,t,n)}pb.prototype.hasProperty=function(e,t){let n=HX(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};pb.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};pb.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,HX(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};pb.prototype.getProperty=function(e,t){return HX(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?tUe(a,s):Ye(a[s],!0)})};function tUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}pb.prototype.setProperty=function(e,t,n){let i=HX(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],d=a.instances[t];if(l(d))return l(d.typedArray)?nUe(d,c,n):d[c]=Ye(n,!0),!0});return l(i)};function nUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}pb.prototype.isClass=function(e,t){let n=HX(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};pb.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var k_=pb;var FLn=T(S(),1),iUe={HIGHLIGHT:0,REPLACE:1,MIX:2},Nl=Object.freeze(iUe);var VK=il.DEFAULT_COLOR_VALUE,LK=il.DEFAULT_SHOW_VALUE;function po(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=oUe(n);this._properties=s,this._batchTableHierarchy=rUe(this,n,i);let a=Mce(t,s,i);this._binaryPropertiesByteLength=sUe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new il({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}po._deprecationWarning=wa;Object.defineProperties(po.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function oUe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function rUe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(po._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new k_({extension:i,binaryBody:n})}function Mce(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new ae("componentType is required.");if(!l(c))throw new ae("type is required.");if(!l(n))throw new ae(`Property ${o} requires a batch table binary.`);let d=Gd(r),u=d.componentsPerAttribute,h=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:h}}}return i}function sUe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}po.getBinaryProperties=function(e,t,n){return Mce(e,t,n)};po.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};po.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};po.prototype.getShow=function(e){return this._batchTexture.getShow(e)};po.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};po.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};po.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};po.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var aUe=new B;po.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(VK),this.setAllShow(LK);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,aUe),VK):VK,s=l(e.show)?y(e.show.evaluate(o),LK):LK;this.setColor(i,r),this.setShow(i,s)}};function cUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function lUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}po.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};po.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};po.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};po.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};po.prototype.hasPropertyBySemantic=function(){return!1};po.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};po.prototype.getPropertyBySemantic=function(e,t){};po.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return cUe(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};po.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){lUe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ye(n,!0)};function dUe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; 
vec2 computeSt(float batchId) 
{ 
    float stepX = tile_textureStep.x; 
    float centerX = tile_textureStep.y; 
    return vec2(centerX + (batchId * stepX), 0.5); 
} 
`:`uniform vec4 tile_textureStep; 
uniform vec2 tile_textureDimensions; 
vec2 computeSt(float batchId) 
{ 
    float stepX = tile_textureStep.x; 
    float centerX = tile_textureStep.y; 
    float stepY = tile_textureStep.z; 
    float centerY = tile_textureStep.w; 
    float xId = mod(batchId, tile_textureDimensions.x); 
    float yId = floor(batchId / tile_textureDimensions.x); 
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); 
} 
`}po.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Nce(o,n,!1),s;return At.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; 
`),s+=`uniform sampler2D tile_batchTexture; 
out vec4 tile_featureColor; 
out vec2 tile_featureSt; 
void main() 
{ 
    vec2 st = computeSt(${t}); 
    vec4 featureProperties = texture(tile_batchTexture, st); 
    tile_color(featureProperties); 
    float show = ceil(featureProperties.a); 
    gl_Position *= show; 
`,e&&(s+=`    bool isStyleTranslucent = (featureProperties.a != 1.0); 
    if (czm_pass == czm_passTranslucent) 
    { 
        if (!isStyleTranslucent && !tile_translucentCommand) 
        { 
            gl_Position *= 0.0; 
        } 
    } 
    else 
    { 
        if (isStyleTranslucent) 
        { 
            gl_Position *= 0.0; 
        } 
    } 
`),s+=`    tile_featureColor = featureProperties; 
    tile_featureSt = st; 
}`):s=`out vec2 tile_featureSt; 
void main() 
{ 
    tile_color(vec4(1.0)); 
    tile_featureSt = computeSt(${t}); 
}`,`${r}
${dUe(i)}${s}`}};function Ace(e,t){return e=De.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; 
void tile_color(vec4 tile_featureColor) 
{ 
    tile_main(); 
    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
} 
`:`${e}void tile_color(vec4 tile_featureColor) 
{ 
    tile_main(); 
} 
`}function uUe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d<e.length;++d){let u=e.charAt(d);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=d+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Nce(e,t,n){if(!l(t))return Ace(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Ace(e,n);let r=o[0],s=o[2];e=De.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) 
{ 
    return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); 
} 
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) 
{ 
    vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); 
    vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; 
    return vec4(diffuse.rgb, sourceDiffuse.a); 
} 
`,c=`    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
`,d;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,h=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),d=`    vec4 source = ${u}; 
    tile_diffuse = tile_diffuse_final(source, tile_featureColor); 
    tile_main(); 
`}else s==="sampler2D"&&(e=uUe(e,t),d=`    tile_diffuse = tile_featureColor; 
    tile_main(); 
`);return e=`uniform float tile_colorBlend; 
vec4 tile_diffuse = vec4(1.0); 
${a}${r}
${e}
void tile_color(vec4 tile_featureColor) 
{ 
${d}`,n&&(e+=c),e+=`} 
`,e}po.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Nce(i,t,!0),At.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; 
in vec2 tile_featureSt; 
in vec4 tile_featureColor; 
void main() 
{ 
    tile_color(tile_featureColor); 
`,n&&(i+=`    out_FragColor.rgb *= out_FragColor.a; 
`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; 
`),i+=`uniform sampler2D tile_pickTexture; 
uniform sampler2D tile_batchTexture; 
in vec2 tile_featureSt; 
void main() 
{ 
    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); 
    if (featureProperties.a == 0.0) { 
        discard; 
    } 
`,e&&(i+=`    bool isStyleTranslucent = (featureProperties.a != 1.0); 
    if (czm_pass == czm_passTranslucent) 
    { 
        if (!isStyleTranslucent && !tile_translucentCommand) 
        { 
            discard; 
        } 
    } 
    else 
    { 
        if (isStyleTranslucent) 
        { 
            discard; 
        } 
    } 
`),i+=`    tile_color(featureProperties); 
`,n&&(i+=`    out_FragColor.rgb *= out_FragColor.a; 
`),i+=`} 
`),i}};po.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=De.replaceMain(e,"tile_main"),At.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt; 
in vec4 tile_featureColor; 
void main() 
{ 
    tile_main(); 
    out_FragColor = tile_featureColor; 
    out_FragColor.rgb *= out_FragColor.a; 
}`:e+=`uniform sampler2D tile_batchTexture; 
uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt; 
void main() 
{ 
    tile_main(); 
    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); 
    if (featureProperties.a == 0.0) { 
        discard; 
    } 
    out_FragColor = featureProperties; 
    out_FragColor.rgb *= out_FragColor.a; 
} 
`,e}};function mUe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Nl.HIGHLIGHT)return 0;if(n===Nl.REPLACE)return 1;if(n===Nl.MIX)return W.clamp(i,W.EPSILON4,1)}po.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return St(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return mUe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};po.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Xg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};po.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=hUe(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Ee.COMPUTE)continue;let h=u.derivedCommands.tileset;(!l(h)||u.dirty)&&(h={},u.derivedCommands.tileset=h,h.originalCommand=fUe(u),u.dirty=!1);let p=h.originalCommand;c!==Xg.ALL_OPAQUE&&u.pass!==Ee.TRANSLUCENT&&(l(h.translucent)||(h.translucent=pUe(p))),c!==Xg.ALL_TRANSLUCENT&&u.pass!==Ee.TRANSLUCENT&&(l(h.opaque)||(h.opaque=bUe(p)),a&&(r||(l(h.zback)||(h.zback=yUe(e.context,p)),s._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==_Ue(h.stencil))&&(u.renderState.depthMask?h.stencil=xUe(p,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,f=h.translucent;u.pass!==Ee.TRANSLUCENT?(c===Xg.ALL_OPAQUE&&(n[d]=g),c===Xg.ALL_TRANSLUCENT&&(n[d]=f),c===Xg.OPAQUE_AND_TRANSLUCENT&&(n[d]=g,n.push(f))):n[d]=p}};function hUe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Xg.ALL_OPAQUE:t===e.featuresLength?Xg.ALL_TRANSLUCENT:Xg.OPAQUE_AND_TRANSLUCENT}function fUe(e){let t=$e.shallowClone(e),n=t.pass===Ee.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function pUe(e){let t=$e.shallowClone(e);return t.pass=Ee.TRANSLUCENT,t.renderState=TUe(e.renderState),t}function bUe(e){let t=$e.shallowClone(e);return t.renderState=SUe(e.renderState),t}function gUe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function yUe(e,t){let n=$e.shallowClone(t),i=Ye(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ti.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK,n.renderState=Ue.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ye(t.uniformMap);let o=new D(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=gUe(e,t.shaderProgram),n}function xUe(e,t){let n=$e.shallowClone(e),i=Ye(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ut.SKIP_LOD_MASK,i.stencilTest.reference=Ut.CESIUM_3D_TILE_MASK|t<<Ut.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Bn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ht.REPLACE,i.stencilTest.backFunction=Bn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ht.REPLACE,i.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,n.renderState=Ue.fromCache(i),n}function _Ue(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function TUe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function SUe(e){let t=Ye(e,!0);return t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}po.prototype.update=function(e,t){this._batchTexture.update(e,t)};po.prototype.isDestroyed=function(){return!1};po.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var bb=po;var TZn=T(S(),1);var dRn=T(S(),1);function CUe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Zf=CUe;var cZn=T(S(),1);var mRn=T(S(),1),u1=`in vec3 position;
in float a_batchId;

uniform mat4 u_modifiedModelViewProjection;

void main()
{
    gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var bRn=T(S(),1);function Du(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Du.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new B),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Du.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Du.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Du.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Du.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};Du.prototype.getPropertyInherited=function(e){return Du.getPropertyInherited(this._content,this._batchId,e)};Du.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Du.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Du.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Du.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Os=Du;var WRn=T(S(),1);var xRn=T(S(),1),RK=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},ZK=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},kl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+="	";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},VUe=new RK;Object.assign(kl,{hooks:VUe,plugins:new ZK(kl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});kl.max_unop_len=kl.getMaxKeyLen(kl.unary_ops);kl.max_binop_len=kl.getMaxKeyLen(kl.binary_ops);var Wg=e=>new kl(e).parse(),LUe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(kl).filter(e=>!LUe.includes(e)&&Wg[e]===void 0).forEach(e=>{Wg[e]=kl[e]});Wg.Jsep=kl;var RUe="ConditionalExpression",ZUe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:RUe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Wg.plugins.register(ZUe);var TRn=T(S(),1),GUe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(GUe);function nh(e,t){this._expression=e,e=UUe(e,t),e=BUe(DUe(e)),Wg.addBinaryOp("=~",0),Wg.addBinaryOp("!~",0);let n;try{n=Wg(e)}catch(i){throw new ae(i)}this._runtimeAst=Li(this,n)}Object.defineProperties(nh.prototype,{expression:{get:function(){return this._expression}}});var vn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new m],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new D),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};nh.prototype.evaluate=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof B&&n instanceof se?B.fromCartesian4(n,t):n instanceof D||n instanceof m||n instanceof se?n.clone(t):n};nh.prototype.evaluateColor=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return B.fromCartesian4(n,t)};nh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
    return ${o};
}
`,o};nh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};nh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var EUe=["!","-","+"],kce=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],zX=/\${(.*?)}/g,IUe=/\\/g,XUe="@#%",WUe=/@#%/g,Sk=new B,Ck={abs:Ys(Math.abs),sqrt:Ys(Math.sqrt),cos:Ys(Math.cos),sin:Ys(Math.sin),tan:Ys(Math.tan),acos:Ys(Math.acos),asin:Ys(Math.asin),atan:Ys(Math.atan),radians:Ys(W.toRadians),degrees:Ys(W.toDegrees),sign:Ys(W.sign),floor:Ys(Math.floor),ceil:Ys(Math.ceil),round:Ys(Math.round),exp:Ys(Math.exp),exp2:Ys(vUe),log:Ys(Math.log),log2:Ys(wUe),fract:Ys(PUe),length:FUe,normalize:AUe},Vk={atan2:_k(Math.atan2,!1),pow:_k(Math.pow,!1),min:_k(Math.min,!0),max:_k(Math.max,!0),distance:MUe,dot:NUe,cross:kUe},IK={clamp:Uce(W.clamp,!0),mix:Uce(W.lerp,!0)};function PUe(e){return e-Math.floor(e)}function vUe(e){return Math.pow(2,e)}function wUe(e){return W.log2(e)}function Ys(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),vn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),vn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),vn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function _k(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),vn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),vn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),vn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),vn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Uce(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),vn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof D&&o instanceof D&&r instanceof D)return D.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),vn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),vn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),vn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function FUe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function AUe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,vn.getCartesian2());if(t instanceof m)return m.normalize(t,vn.getCartesian3());if(t instanceof se)return se.normalize(t,vn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function MUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function NUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function kUe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,vn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Vt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,$Ue(this)}function UUe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function DUe(e){return e.replace(IUe,XUe)}function EK(e){return e.replace(WUe,"\\")}function BUe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new ae("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function OUe(e){let t=typeof e.value;if(e.value===null)return new Vt(gt.LITERAL_NULL,null);if(t==="boolean")return new Vt(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Vt(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Vt(gt.VARIABLE_IN_STRING,e.value):new Vt(gt.LITERAL_STRING,EK(e.value))}function YUe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Vt(gt.LITERAL_BOOLEAN,!1):new Vt(gt.LITERAL_NULL,null):(s=Li(e,c),a=Li(e,n[0]),new Vt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Li(e,c),new Vt(gt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Vt(gt.LITERAL_COLOR,o);if(r=Li(e,n[0]),l(n[1])){let c=Li(e,n[1]);return new Vt(gt.LITERAL_COLOR,o,[r,c])}return new Vt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[Li(e,n[0]),Li(e,n[1]),Li(e,n[2])],new Vt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[Li(e,n[0]),Li(e,n[1]),Li(e,n[2]),Li(e,n[3])],new Vt(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Li(e,n[c]);return new Vt(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Vt(gt.LITERAL_BOOLEAN,!0):new Vt(gt.LITERAL_BOOLEAN,!1):(r=Li(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ae(`${o} requires exactly one argument.`);return r=Li(e,n[0]),new Vt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Vt(gt.UNARY,o)}else if(l(Ck[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=Li(e,n[0]),new Vt(gt.UNARY,o,r)}else if(l(Vk[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=Li(e,n[0]),a=Li(e,n[1]),new Vt(gt.BINARY,o,s,a)}else if(l(IK[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=Li(e,n[0]),a=Li(e,n[1]);let c=Li(e,n[2]);return new Vt(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Vt(gt.LITERAL_BOOLEAN,!1):(r=Li(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="Number")return i===0?new Vt(gt.LITERAL_NUMBER,0):(r=Li(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="String")return i===0?new Vt(gt.LITERAL_STRING,""):(r=Li(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="regExp")return HUe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function HUe(e,t){let n=t.arguments;if(n.length===0)return new Vt(gt.LITERAL_REGEX,new RegExp);let i=Li(e,n[0]),o;if(n.length>1){let r=Li(e,n[1]);if(GK(i)&&GK(r)){try{o=new RegExp(EK(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Vt(gt.LITERAL_REGEX,o)}return new Vt(gt.REGEX,i,r)}if(GK(i)){try{o=new RegExp(EK(String(i._value)))}catch(r){throw new ae(r)}return new Vt(gt.LITERAL_REGEX,o)}return new Vt(gt.REGEX,i)}function zUe(e){if(jUe(e.name)){let t=qUe(e.name);return t.substr(0,8)==="tiles3d_"?new Vt(gt.BUILTIN_VARIABLE,t):new Vt(gt.VARIABLE,t)}else{if(e.name==="NaN")return new Vt(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Vt(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Vt(gt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function KUe(e){let t=e.property.name;if(t==="PI")return new Vt(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Vt(gt.LITERAL_NUMBER,Math.E)}function JUe(e){if(e.property.name==="POSITIVE_INFINITY")return new Vt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function QUe(e,t){if(t.object.name==="Math")return KUe(t);if(t.object.name==="Number")return JUe(t);let n,i=Li(e,t.object);return t.computed?(n=Li(e,t.property),new Vt(gt.MEMBER,"brackets",i,n)):(n=new Vt(gt.LITERAL_STRING,t.property.name),new Vt(gt.MEMBER,"dot",i,n))}function GK(e){return e._type>=gt.LITERAL_NULL}function jUe(e){return e.substr(0,4)==="czm_"}function qUe(e){return e.substr(4)}function Li(e,t){let n,i,o,r;if(t.type==="Literal")n=OUe(t);else if(t.type==="CallExpression")n=YUe(e,t);else if(t.type==="Identifier")n=zUe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Li(e,t.argument);if(EUe.indexOf(i)>-1)n=new Vt(gt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Li(e,t.left),r=Li(e,t.right),kce.indexOf(i)>-1)n=new Vt(gt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Li(e,t.left),r=Li(e,t.right),kce.indexOf(i)>-1&&(n=new Vt(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Li(e,t.test);o=Li(e,t.consequent),r=Li(e,t.alternate),n=new Vt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=QUe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Li(e,t.elements[a]);n=new Vt(gt.ARRAY,s)}else throw t.type==="Compound"?new ae("Provide exactly one expression."):new ae("Cannot parse expression.");return n}function $Ue(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===gt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(Ck[e._value])&&(e.evaluate=tDe(e._value)):e._type===gt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(Vk[e._value])&&(e.evaluate=nDe(e._value)):e._type===gt.TERNARY?e.evaluate=iDe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=eDe):e.evaluate=e._evaluateLiteral}function eDe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function tDe(e){let t=Ck[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function nDe(e){let t=Vk[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function iDe(e){let t=IK[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function Lk(e,t){if(l(e))return e.getPropertyInherited(t)}Vt.prototype._evaluateLiteral=function(){return this._value};Vt.prototype._evaluateLiteralColor=function(e){let t=Sk,n=this._left;if(this._value==="color")l(n)?n.length>1?(B.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):B.fromCssColorString(n[0].evaluate(e),t):B.fromBytes(255,255,255,255,t);else if(this._value==="rgb")B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,vn.getCartesian4())};Vt.prototype._evaluateLiteralVector=function(e){let t=vn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof D)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new ae(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new ae(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,vn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,vn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,vn.getCartesian4())};Vt.prototype._evaluateLiteralString=function(){return this._value};Vt.prototype._evaluateVariableString=function(e){let t=this._value,n=zX.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=Lk(e,o);l(r)||(r=""),t=t.replace(i,r),zX.lastIndex+=r.length-i.length,n=zX.exec(t)}return t};Vt.prototype._evaluateVariable=function(e){return Lk(e,this._value)};function U_(e){return e._value==="feature"}Vt.prototype._evaluateMemberDot=function(e){if(U_(this._left))return Lk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Vt.prototype._evaluateMemberBrackets=function(e){if(U_(this._left))return Lk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Vt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Vt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Vt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof D)return D.negate(t,vn.getCartesian2());if(t instanceof m)return m.negate(t,vn.getCartesian3());if(t instanceof se)return se.negate(t,vn.getCartesian4());if(typeof t=="number")return-t;throw new ae(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Vt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof D||t instanceof m||t instanceof se||typeof t=="number"))throw new ae(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Vt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Vt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Vt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Vt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Vt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Vt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Vt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,vn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,vn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,vn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,vn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,vn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,vn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof se&&t instanceof se?t.equals(n):t===n};Vt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Vt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Vt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Vt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Vt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Vt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Vt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Vt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Vt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Vt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Vt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Vt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof m||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function Dce(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return B.fromHsl(i,o,r,s,Sk)}function Bce(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=Sk;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function Pg(e){return e%1===0?e.toFixed(1):e.toString()}function oDe(e){let t=Pg(e.red),n=Pg(e.green),i=Pg(e.blue);return`vec3(${t}, ${n}, ${i})`}function Tk(e){let t=Pg(e.red),n=Pg(e.green),i=Pg(e.blue),o=Pg(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function Oce(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function Yce(e,t){return l(t[e])?t[e]:nh.NULL_SENTINEL}nh.NULL_SENTINEL="czm_infinity";Vt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=Oce(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Oce(this._value,e,t,this));let d,u,h;switch(a){case gt.VARIABLE:return U_(this)?void 0:Yce(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(Ck[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new ae(`Error generating style shader: "${c}" is not supported.`);return c+o;case gt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(Vk[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case gt.TERNARY:if(l(IK[c]))return`${c}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return U_(this._left)?Yce(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case gt.FUNCTION_CALL:throw new ae(`Error generating style shader: "${c}" is not supported.`);case gt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new ae("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new ae("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return nh.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return Pg(c);case gt.LITERAL_STRING:if(l(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||U_(n._left)))return c;if(i=B.fromCssColorString(c,Sk),l(i))return oDe(i);throw new ae("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=Bce(this),l(i)?Tk(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=Bce(this),l(i)?Tk(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=Dce(this),l(i)?Tk(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=Dce(this),l(i)?(i.alpha!==1&&(t.translucent=!0),Tk(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case gt.LITERAL_VECTOR:u=o.length,h=`${c}(`;for(let p=0;p<u;++p)h+=o[p],p<u-1&&(h+=", ");return h+=")",h;case gt.LITERAL_REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return nh.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Vt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case gt.VARIABLE:U_(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=zX.exec(s);a!==null;)e.push(a[1]),a=zX.exec(s);break;case gt.LITERAL_STRING:l(t)&&t._type===gt.MEMBER&&U_(t._left)&&e.push(s);break}};var Bu=nh;function gb(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,m.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,Dn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(gb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var rDe={position:0,a_batchId:1};function sDe(e,t){if(l(e._va))return;let n=xt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=xt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),o=xt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:Q.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Q.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ni({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ni({context:t,attributes:r,indexBuffer:xt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function aDe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,rDe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=De.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`,e._spPick=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(u1),c=n.getFragmentShaderCallback(!1,void 0,!0)(Eg);o=n.getPickId();let d=new De({sources:[a]}),u=new De({defines:["VECTOR_TILE"],sources:[c]});e._sp=$t.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new De({sources:[u1]}),u=new De({defines:["VECTOR_TILE"],sources:[Eg]}),e._spStencil=$t.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),c=De.replaceMain(c,"czm_non_pick_main"),c=`${c}
void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`;let h=new De({sources:[a]}),p=new De({defines:["VECTOR_TILE"],sources:[c]});e._spPick=$t.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function Hce(e){let t=e?Bn.EQUAL:Bn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:t,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:bc.LESS_OR_EQUAL},depthMask:!1}}var cDe={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},lDe={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function dDe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ue.fromCache(Hce(!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(Hce(!0)),e._rsColorPass=Ue.fromCache(cDe),e._rsPickPass=Ue.fromCache(lDe))}var D_=new A,zce=new m;function uDe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return A.clone(i,D_),A.multiplyByPoint(D_,e._center,zce),A.setTranslation(D_,zce,D_),A.multiply(o,D_,D_),D_},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function XK(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d<c;++d){let u=r[d],h=s[u],p=i[h],g=o[h],f=new e.constructor(e.buffer,a*p,g);t.set(f,n),i[h]=n,n+=g}return n}function mDe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],d=XK(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(B.equals(u.color,a.color))d=XK(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let h=d;d=XK(n,s,d,i,o,u.batchIds,r),u.offset=h,u.count=d-h,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function WK(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d<c;++d){let u=r[d],h=s[u],p=i[h],g=o[h];t.copyFromBuffer(e,p*a,n*a,g*a),i[h]=n,n+=g}return n}function hDe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,d=WK(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let h=t.pop();if(B.equals(h.color,r.color))d=WK(a,c,d,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=d-r.offset;else{let p=d;d=WK(a,c,d,n,i,h.batchIds,o),h.offset=p,h.count=d-p,s.push(h),r=h}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function fDe(e,t){return t.color.toRgba()-e.color.toRgba()}function pDe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(fDe),t.webgl2?hDe(e,n):mDe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function bDe(e,t){let n=pDe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,d=y(e._modelMatrix,A.IDENTITY),u=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,f=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new $e({owner:e})),x.vertexArray=a,x.modelMatrix=d,x.offset=g,x.count=f,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=u,x.boundingVolume=h,x.cull=!1,x.pass=Ee.TERRAIN_CLASSIFICATION;let _=$e.shallowClone(x,x.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=_;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new $e({owner:e})),C.vertexArray=a,C.modelMatrix=d,C.offset=g,C.count=f,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=u,C.boundingVolume=h,C.cull=!1,C.pass=Ee.TERRAIN_CLASSIFICATION;let V=$e.shallowClone(C,C.derivedCommands.tileset);V.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=V}e._commandsDirty=!0}function gDe(e,t){if(e.classificationType===Dn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let d=i[c]=$e.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function yDe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,A.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let d=e._indexOffsets[c],u=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new $e({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=Ee.TERRAIN_CLASSIFICATION;let g=$e.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new $e({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=d,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=h,f.pass=Ee.TERRAIN_CLASSIFICATION;let x=$e.shallowClone(f,f.derivedCommands.tileset);x.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=x}e._pickCommandsDirty=!1}gb.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Os(e,r)}};gb.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function xDe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=B.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=B.clone(B.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var _De=new B,TDe=B.WHITE,SDe=!0,CDe=/\$/;gb.prototype.applyStyle=function(e,t){if(!l(e)){xDe(this,t);return}let n=e.color,i=n instanceof Bu&&!CDe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,_De):TDe,c.show=l(e.show)?e.show.evaluate(c):SDe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=B.clone(B.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};gb.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,d=c.length,u;for(u=0;u<d;++u){let x=c[u].offset,_=c[u].count;if(s>=x&&s<x+_)break}c.push(new Zf({color:B.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],g=c[u].batchIds,f=g.length;for(let x=0;x<f;++x){let _=g[x];if(_===e)continue;let C=n[_];o[C]<s?h.push(_):p.push(_)}p.length!==0&&c.push(new Zf({color:B.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),h.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=h):c.splice(u,1),this._batchDirty=!0};function Kce(e,t,n,i){let o=e.classificationType,r=o!==Dn.CESIUM_3D_TILE,s=o!==Dn.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Ee.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!l(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function VDe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ee.OPAQUE,n.push(r)}}function LDe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ue.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=we.LINES):(n=e._rsColorPass,i=we.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}gb.prototype.update=function(e){let t=e.context;sDe(this,t),aDe(this,t),dDe(this),uDe(this,t);let n=e.passes;n.render&&(bDe(this,t),gDe(this,e),LDe(this),this._debugWireframe?VDe(e,this._commands):Kce(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(yDe(this),Kce(this,e,this._pickCommands))};gb.prototype.isDestroyed=function(){return!1};gb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),me(this)};var B_=gb;function Ed(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Dn.BOTH}Object.defineProperties(Ed.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Ed.packedBoxLength=A.packedLength+m.packedLength;Ed.packedCylinderLength=A.packedLength+2;Ed.packedEllipsoidLength=A.packedLength+m.packedLength;Ed.packedSphereLength=m.packedLength+1;function RDe(e){let t=new Float64Array(A.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,A.pack(e._modelMatrix,t,n),t}function ZDe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=le.unpack(t,n),n+=le.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let d=B.unpack(t,n);n+=B.packedLength;let u=t[n++],h=t[n++],p=t[n++],g=new Array(p);for(let f=0;f<p;++f)g[f]=t[n++];a[c]=new Zf({color:d,offset:u,count:h,batchIds:g})}return i}var GDe=new yi("createVectorTileGeometries",5),EDe=new B;function IDe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!l(d)){let f=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),d=e._batchTableColors=new Uint32Array(f);let x=e._batchTable;for(let _=0;_<f;++_){let C=x.getColor(_,EDe);d[_]=C.toRgba()}u=e._packedBuffer=RDe(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,s.buffer),l(a)&&h.push(a.buffer,c.buffer),h.push(d.buffer,u.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},g=e._verticesPromise=GDe.scheduleTask(p,h);return l(g)?g.then(function(f){if(e.isDestroyed())return;let x=new Float64Array(f.packedBuffer);ZDe(e,x)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),XDe(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function XDe(e){l(e._primitive)||(e._primitive=new B_({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Ed.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Ed.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Ed.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Ed.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Ed.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=IDe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Ed.prototype.isDestroyed=function(){return!1};Ed.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var yb=Ed;function Gf(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,vDe(this,i,o)}Object.defineProperties(Gf.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function WDe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function PDe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),d=y(e.ELLIPSOIDS_LENGTH,0),u=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!l(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=f++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var O_=Uint32Array.BYTES_PER_ELEMENT;function vDe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=O_;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Geometry tile version 1 is supported.  Version ${r} is not.`);n+=O_;let s=o.getUint32(n,!0);if(n+=O_,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=O_,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=O_;let d=o.getUint32(n,!0);n+=O_;let u=o.getUint32(n,!0);n+=O_;let h=Jo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,f;d>0&&(g=Jo(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=y(h.BOXES_LENGTH,0),_=y(h.CYLINDERS_LENGTH,0),C=y(h.ELLIPSOIDS_LENGTH,0),V=y(h.SPHERES_LENGTH,0),L=x+_+C+V,R=new bb(e,L,g,f,WDe(e));if(e._batchTable=R,L===0)return;let G=e.tile.computedTransform,I;l(h.RTC_CENTER)&&(I=m.unpack(h.RTC_CENTER),A.multiplyByPoint(G,I,I));let v=PDe(h,p);if(x>0||_>0||C>0||V>0){let P,w,M,b;if(x>0){let Z=p.byteOffset+h.BOXES.byteOffset;P=new Float32Array(p.buffer,Z,yb.packedBoxLength*x)}if(_>0){let Z=p.byteOffset+h.CYLINDERS.byteOffset;w=new Float32Array(p.buffer,Z,yb.packedCylinderLength*_)}if(C>0){let Z=p.byteOffset+h.ELLIPSOIDS.byteOffset;M=new Float32Array(p.buffer,Z,yb.packedEllipsoidLength*C)}if(V>0){let Z=p.byteOffset+h.SPHERES.byteOffset;b=new Float32Array(p.buffer,Z,yb.packedSphereLength*V)}return e._geometries=new yb({boxes:P,boxBatchIds:v.boxes,cylinders:w,cylinderBatchIds:v.cylinders,ellipsoids:M,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:I,modelMatrix:G,batchTable:R,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Jce(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Gf.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Gf.prototype.getFeature=function(e){return Jce(this),this._features[e]};Gf.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Gf.prototype.applyStyle=function(e){Jce(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Gf.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};Gf.prototype.pick=function(e,t,n){};Gf.prototype.isDestroyed=function(){return!1};Gf.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};var KX=Gf;var ewn=T(S(),1);var Wvn=T(S(),1);var wZn=T(S(),1);function wDe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var si=wDe;var kZn=T(S(),1);function PK(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new ae(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=FDe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function FDe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(PK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});PK.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var m1=PK;var BZn=T(S(),1);function xb(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(xb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xb.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};xb.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};xb.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};xb.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};xb.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};xb.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};xb.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var h1=xb;var YZn=T(S(),1);var Rk={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};Rk.getBranchingFactor=function(e){switch(e){case Rk.OCTREE:return 8;case Rk.QUADTREE:return 4}};var ts=Object.freeze(Rk);var tGn=T(S(),1);var QZn=T(S(),1);function ma(){}Object.defineProperties(ma.prototype,{class:{get:function(){pe.throwInstantiationError()}}});ma.prototype.hasProperty=function(e){pe.throwInstantiationError()};ma.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};ma.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};ma.prototype.getProperty=function(e){pe.throwInstantiationError()};ma.prototype.setProperty=function(e,t){pe.throwInstantiationError()};ma.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};ma.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};ma.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};ma.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ma.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};ma.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ma.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ma.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ma.getProperty(o.id,t,n)};ma.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ma.setProperty(r.id,t,n,i):!1};var Nn=ma;function _b(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(_b.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});_b.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};_b.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};_b.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};_b.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};_b.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};_b.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};_b.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var JX=_b;var HGn=T(S(),1);var NGn=T(S(),1);var sGn=T(S(),1);var Mt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Mt.getMinimum=function(e){switch(e){case Mt.INT8:return-128;case Mt.UINT8:return 0;case Mt.INT16:return-32768;case Mt.UINT16:return 0;case Mt.INT32:return-2147483648;case Mt.UINT32:return 0;case Mt.INT64:return Bt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Mt.UINT64:return Bt.supportsBigInt()?BigInt(0):0;case Mt.FLOAT32:return-34028234663852886e22;case Mt.FLOAT64:return-Number.MAX_VALUE}};Mt.getMaximum=function(e){switch(e){case Mt.INT8:return 127;case Mt.UINT8:return 255;case Mt.INT16:return 32767;case Mt.UINT16:return 65535;case Mt.INT32:return 2147483647;case Mt.UINT32:return 4294967295;case Mt.INT64:return Bt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Mt.UINT64:return Bt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Mt.FLOAT32:return 34028234663852886e22;case Mt.FLOAT64:return Number.MAX_VALUE}};Mt.isIntegerType=function(e){switch(e){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.INT64:case Mt.UINT64:return!0;default:return!1}};Mt.isUnsignedIntegerType=function(e){switch(e){case Mt.UINT8:case Mt.UINT16:case Mt.UINT32:case Mt.UINT64:return!0;default:return!1}};Mt.isVectorCompatible=function(e){switch(e){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.FLOAT32:case Mt.FLOAT64:return!0;default:return!1}};Mt.normalize=function(e,t){return Math.max(Number(e)/Number(Mt.getMaximum(t)),-1)};Mt.unnormalize=function(e,t){let n=Mt.getMaximum(t),i=Mt.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Mt.INT64||t===Mt.UINT64)&&Bt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Mt.applyValueTransform=function(e,t,n){return n*e+t};Mt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Mt.getSizeInBytes=function(e){switch(e){case Mt.INT8:case Mt.UINT8:return 1;case Mt.INT16:case Mt.UINT16:return 2;case Mt.INT32:case Mt.UINT32:return 4;case Mt.INT64:case Mt.UINT64:return 8;case Mt.FLOAT32:return 4;case Mt.FLOAT64:return 8}};Mt.fromComponentDatatype=function(e){switch(e){case Q.BYTE:return Mt.INT8;case Q.UNSIGNED_BYTE:return Mt.UINT8;case Q.SHORT:return Mt.INT16;case Q.UNSIGNED_SHORT:return Mt.UINT16;case Q.INT:return Mt.INT32;case Q.UNSIGNED_INT:return Mt.UINT32;case Q.FLOAT:return Mt.FLOAT32;case Q.DOUBLE:return Mt.FLOAT64}};Mt.toComponentDatatype=function(e){switch(e){case Mt.INT8:return Q.BYTE;case Mt.UINT8:return Q.UNSIGNED_BYTE;case Mt.INT16:return Q.SHORT;case Mt.UINT16:return Q.UNSIGNED_SHORT;case Mt.INT32:return Q.INT;case Mt.UINT32:return Q.UNSIGNED_INT;case Mt.FLOAT32:return Q.FLOAT;case Mt.FLOAT64:return Q.DOUBLE}};var Ft=Object.freeze(Mt);var ZGn=T(S(),1);var fGn=T(S(),1);var No={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};No.isVectorType=function(e){switch(e){case No.VEC2:case No.VEC3:case No.VEC4:return!0;default:return!1}};No.isMatrixType=function(e){switch(e){case No.MAT2:case No.MAT3:case No.MAT4:return!0;default:return!1}};No.getComponentCount=function(e){switch(e){case No.SCALAR:case No.STRING:case No.ENUM:case No.BOOLEAN:return 1;case No.VEC2:return 2;case No.VEC3:return 3;case No.VEC4:return 4;case No.MAT2:return 4;case No.MAT3:return 9;case No.MAT4:return 16}};No.getMathType=function(e){switch(e){case No.VEC2:return D;case No.VEC3:return m;case No.VEC4:return se;case No.MAT2:return Ii;case No.MAT3:return $;case No.MAT4:return A;default:return}};var ct=Object.freeze(No);function Aa(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&Ft.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=r;let s=Ye(e.offset,!0),a=Ye(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=y(e.required,!0),this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Aa.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=ADe(n),o=MDe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new Aa({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Aa.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function ADe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===ct.SCALAR||ct.isMatrixType(t)||ct.isVectorType(t))return!1;if(l(Ft[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function MDe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===ct.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===ct.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===ct.SCALAR||ct.isMatrixType(n)||ct.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===ct.BOOLEAN||n===ct.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===ct.BOOLEAN||i===ct.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Ft[i]))return{type:ct.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Ft[n]))return{type:ct.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Aa.prototype.normalize=function(e){return this._normalized?vK(e,this._valueType,Ft.normalize):e};Aa.prototype.unnormalize=function(e){return this._normalized?vK(e,this._valueType,Ft.unnormalize):e};Aa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Aa.valueTransformInPlace(e,this._offset,this._scale,Ft.applyValueTransform)};Aa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Aa.valueTransformInPlace(e,this._offset,this._scale,Ft.unapplyValueTransform)};Aa.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=ct.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Aa.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!$ce(e,t))return e};function $ce(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!$ce(e[n],t[n]))return!1;return!0}Aa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ct.getMathType(this._type),i=this._isArray,o=ct.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Aa.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ct.getMathType(this._type),i=this._isArray,o=ct.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Aa.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?NDe(this,e):ele(this,e)};function NDe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=ele(e,t[i]);if(l(o))return o}}function ele(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return ct.isVectorType(n)?kDe(t,n,i):ct.isMatrixType(n)?UDe(t,n,i):n===ct.STRING?DDe(t):n===ct.BOOLEAN?BDe(t):n===ct.ENUM?ODe(t,o):YDe(t,i,r)}function kDe(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===ct.VEC2&&!(e instanceof D))return`vector value ${e} must be a Cartesian2`;if(t===ct.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===ct.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function UDe(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===ct.MAT2&&!(e instanceof Ii))return`matrix value ${e} must be a Matrix2`;if(t===ct.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===ct.MAT4&&!(e instanceof A))return`matrix value ${e} must be a Matrix4`}function DDe(e){if(typeof e!="string")return Zk(e,ct.STRING)}function BDe(e){if(typeof e!="boolean")return Zk(e,ct.BOOLEAN)}function ODe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function YDe(e,t,n){let i=typeof e;switch(t){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return i!=="number"?Zk(e,t):isFinite(e)?jce(e,t,n):qce(e,t);case Ft.INT64:case Ft.UINT64:return i!=="number"&&i!=="bigint"?Zk(e,t):i==="number"&&!isFinite(e)?qce(e,t):jce(e,t,n)}}function Zk(e,t){return`value ${e} does not match type ${t}`}function Qce(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function jce(e,t,n){if(n){let i=Ft.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Qce(e,t,n):void 0}if(e<Ft.getMinimum(t)||e>Ft.getMaximum(t))return Qce(e,t,n)}function qce(e,t){return`value ${e} of type ${t} must be finite`}function vK(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=vK(e[i],t,n);return e}Aa.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=Aa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Ef=Aa;function QX(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===ct.STRING,h=r===ct.BOOLEAN,p=0,g;if(a){let b=y(n.arrayOffsetType,n.offsetType);b=y(Ft[b],Ft.UINT32);let Z=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new wK(o[Z],b,t+1),p+=g.typedArray.byteLength}let f=ct.getComponentCount(r),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let _=f*x,C;if(u){let b=y(n.stringOffsetType,n.offsetType);b=y(Ft[b],Ft.UINT32);let Z=y(n.stringOffsets,n.stringOffsetBufferView);C=new wK(o[Z],b,_+1),p+=C.typedArray.byteLength}(u||h)&&(c=Ft.UINT8);let V;u?V=C.get(_)-C.get(0):h?V=Math.ceil(_/8):V=_;let L=y(n.values,n.bufferView),R=new wK(o[L],c,V);p+=R.typedArray.byteLength;let G=n.offset,I=n.scale,v=i.hasValueTransform||l(G)||l(I);G=y(G,i.offset),I=y(I,i.scale),G=tle(G),I=tle(I);let P,w,M=this;u?P=function(b){return KDe(b,M._values,M._stringOffsets)}:h?(P=function(b){return JDe(b,M._values)},w=function(b,Z){QDe(b,M._values,Z)}):l(d)?(P=function(b){let Z=M._values.get(b);return d.namesByValue[Z]},w=function(b,Z){let E=d.valuesByName[Z];M._values.set(b,E)}):(P=function(b){return M._values.get(b)},w=function(b,Z){M._values.set(b,Z)}),this._arrayOffsets=g,this._stringOffsets=C,this._values=R,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=G,this._scale=I,this._hasValueTransform=v,this._getValue=P,this._setValue=w,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(QX.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});QX.prototype.get=function(e){let t=HDe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=oBe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};QX.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=rBe(this,t),t=n.unnormalize(t),zDe(this,e,t)};QX.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function tle(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function HDe(e,t){ile(e)&&ole(e);let n=e._classProperty,i=n.isArray,o=n.type,r=ct.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ye(s,!0):s}return!i&&r===1?e._getValue(t):nle(e,n,t)}function nle(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=ct.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function zDe(e,t,n){nBe(e,t,n)&&ole(e);let i=e._classProperty,o=i.isArray,r=i.type,s=ct.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ye(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let u=y(i.arrayLength,1)*e._vectorComponentCount;a=t*u,c=u}for(let d=0;d<c;++d)e._setValue(a+d,n[d])}function KDe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Pl(t.typedArray,i,o)}function JDe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function QDe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function jDe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function qDe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function $De(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function eBe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function tBe(e){switch(e){case Ft.INT8:return Q.BYTE;case Ft.UINT8:return Q.UNSIGNED_BYTE;case Ft.INT16:return Q.SHORT;case Ft.UINT16:return Q.UNSIGNED_SHORT;case Ft.INT32:return Q.INT;case Ft.UINT32:return Q.UNSIGNED_INT;case Ft.FLOAT32:return Q.FLOAT;case Ft.FLOAT64:return Q.DOUBLE}}function ile(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===ct.STRING||i===Ft.INT64&&!Bt.supportsBigInt64Array()||i===Ft.UINT64&&!Bt.supportsBigUint64Array()}function nBe(e,t,n){if(ile(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function ole(e){e._unpackedValues=iBe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function iBe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=ct.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=nle(e,i,a);return n}function oBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Ef.valueTransformInPlace(t,e._offset,e._scale,Ft.applyValueTransform)}function rBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Ef.valueTransformInPlace(t,e._offset,e._scale,Ft.unapplyValueTransform)}function wK(e,t,n){let i=this,o,r,s;if(t===Ft.INT64)Bt.supportsBigInt()?Bt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return qDe(a,i)}):(_t("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return jDe(a,i)});else if(t===Ft.UINT64)Bt.supportsBigInt()?Bt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return eBe(a,i)}):(_t("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return $De(a,i)});else{let a=tBe(t);o=Q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,d){i.typedArray[c]=d}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var jX=QX;function ih(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new jX({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(ih.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});ih.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};ih.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};ih.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};ih.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=sBe(this._class,t),i};ih.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};ih.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};ih.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};ih.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};ih.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function sBe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ye(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Ou=ih;var yvn=T(S(),1);var sEn=T(S(),1);var qGn=T(S(),1);function vg(){}Object.defineProperties(vg.prototype,{cacheKey:{get:function(){pe.throwInstantiationError()}}});vg.prototype.load=function(){pe.throwInstantiationError()};vg.prototype.unload=function(){};vg.prototype.process=function(e){return!1};vg.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
${t.message}`);let n=new ae(e);return l(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};vg.prototype.isDestroyed=function(){return!1};vg.prototype.destroy=function(){return this.unload(),me(this)};var Ki=vg;var eEn=T(S(),1),aBe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},yt=Object.freeze(aBe);function Tb(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Tb.prototype=Object.create(Ki.prototype),Tb.prototype.constructor=Tb);Object.defineProperties(Tb.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Tb.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=cBe(this),this._promise)};async function cBe(e){let t=e._resource;e._state=yt.LOADING;try{let n=await Tb._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Tb._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Tb.prototype.unload=function(){this._typedArray=void 0};var Y_=Tb;var XEn=T(S(),1);var xEn=T(S());var lEn=T(S()),aEn=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var f=new Uint8Array(g.length),x=0;x<g.length;++x){var _=g.charCodeAt(x);f[x]=_>96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x<g.length;++x)f[C++]=f[x]<60?t[f[x]]:(f[x]-60)*64+f[++x];return f.buffer.slice(0,C)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,f,x,_){var C=n.exports.sbrk,V=C(f.length*4),L=C(x*4),R=new Uint8Array(n.exports.memory.buffer),G=s(f);R.set(G,V),_&&_(V,V,f.length,x);var I=g(L,V,f.length,x);R=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);new Uint8Array(v.buffer).set(R.subarray(L,L+x*4)),G.set(R.subarray(V,V+f.length*4)),C(V-C(0));for(var P=0;P<f.length;++P)f[P]=v[f[P]];return[v,I]}function c(g,f,x,_){var C=n.exports.sbrk,V=C(x*4),L=C(x*_),R=new Uint8Array(n.exports.memory.buffer);R.set(s(f),L),g(V,L,x,_),R=new Uint8Array(n.exports.memory.buffer);var G=new Uint32Array(x);return new Uint8Array(G.buffer).set(R.subarray(V,V+x*4)),C(V-C(0)),G}function d(g,f,x,_,C){var V=n.exports.sbrk,L=V(f),R=V(_*C),G=new Uint8Array(n.exports.memory.buffer);G.set(s(x),R);var I=g(L,f,R,_,C),v=new Uint8Array(I);return v.set(G.subarray(L,L+I)),V(L-V(0)),v}function u(g){for(var f=0,x=0;x<g.length;++x){var _=g[x];f=f<_?_:f}return f}function h(g,f){if(r(f==2||f==4),f==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var x=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(x)}function p(g,f,x,_,C,V,L){var R=n.exports.sbrk,G=R(x*_),I=R(x*V),v=new Uint8Array(n.exports.memory.buffer);v.set(s(f),I),g(G,x,_,C,I,L);var P=new Uint8Array(x*_);return P.set(v.subarray(G,G+x*_)),R(G-R(0)),P}return{ready:i,supported:!0,reorderMesh:function(g,f,x){var _=f?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,u(g)+1,_)},reorderPoints:function(g,f){return r(g instanceof Float32Array),r(g.length%f==0),r(f>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,x);return d(n.exports.meshopt_encodeVertexBuffer,_,g,f,x)},encodeIndexBuffer:function(g,f,x){r(x==2||x==4),r(f%3==0);var _=h(g,x),C=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,C,_,f,4)},encodeIndexSequence:function(g,f,x){r(x==2||x==4);var _=h(g,x),C=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,C,_,f,4)},encodeGltfBuffer:function(g,f,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](g,f,x)},encodeFilterOct:function(g,f,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,g,f,x,_,16)},encodeFilterQuat:function(g,f,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,x,_,16)},encodeFilterExp:function(g,f,x,_,C){r(x>0&&x%4==0),r(_>=1&&_<=24);var V={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,f,x,_,x,C?V[C]:1)}}}();var uEn=T(S()),rle=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L<C.length;++L){var R=C.charCodeAt(L);V[L]=R>96?R-97:R>64?R-39:R+4}for(var G=0,L=0;L<C.length;++L)V[G++]=V[L]<60?i[V[L]]:(V[L]-60)*64+V[++L];return V.buffer.slice(0,G)}function c(C,V,L,R,G,I,v){var P=C.exports.sbrk,w=R+3&-4,M=P(w*G),b=P(I.length),Z=new Uint8Array(C.exports.memory.buffer);Z.set(I,b);var E=V(M,R,G,b,I.length);if(E==0&&v&&v(M,w,G),L.set(Z.subarray(M,M+R*G)),P(M-P(0)),E!=0)throw new Error("Malformed buffer data: "+E)}var d={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function g(C){var V={object:new Worker(C),pending:0,requests:{}};return V.object.onmessage=function(L){var R=L.data;V.pending-=R.count,V.requests[R.id][R.action](R.value),delete V.requests[R.id]},V}function f(C){for(var V="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+_.name+";"+c.toString()+_.toString(),L=new Blob([V],{type:"text/javascript"}),R=URL.createObjectURL(L),G=h.length;G<C;++G)h[G]=g(R);for(var G=C;G<h.length;++G)h[G].object.postMessage({});h.length=C,URL.revokeObjectURL(R)}function x(C,V,L,R,G){for(var I=h[0],v=1;v<h.length;++v)h[v].pending<I.pending&&(I=h[v]);return new Promise(function(P,w){var M=new Uint8Array(L),b=++p;I.pending+=C,I.requests[b]={resolve:P,reject:w},I.object.postMessage({id:b,count:C,size:V,source:M,mode:R,filter:G},[M.buffer])})}function _(C){var V=C.data;if(!V.id)return self.close();self.ready.then(function(L){try{var R=new Uint8Array(V.count*V.size);c(L,L.exports[V.mode],R,V.count,V.size,V.source,L.exports[V.filter]),self.postMessage({id:V.id,count:V.count,action:"resolve",value:R},[R.buffer])}catch(G){self.postMessage({id:V.id,count:V.count,action:"reject",value:G})}})}return{ready:s,supported:!0,useWorkers:function(C){f(C)},decodeVertexBuffer:function(C,V,L,R,G){c(r,r.exports.meshopt_decodeVertexBuffer,C,V,L,R,r.exports[d[G]])},decodeIndexBuffer:function(C,V,L,R){c(r,r.exports.meshopt_decodeIndexBuffer,C,V,L,R)},decodeIndexSequence:function(C,V,L,R){c(r,r.exports.meshopt_decodeIndexSequence,C,V,L,R)},decodeGltfBuffer:function(C,V,L,R,G,I){c(r,r.exports[u[G]],C,V,L,R,r.exports[d[I]])},decodeGltfBufferAsync:function(C,V,L,R,G){return h.length>0?x(C,V,L,u[R],d[G]):s.then(function(){var I=new Uint8Array(C*V);return c(r,r.exports[u[R]],I,C,V,L,r.exports[d[G]]),I})}}}();var fEn=T(S()),mEn=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbh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cefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaT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cifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_<f.length;++_){var C=f.charCodeAt(_);x[_]=C>96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_<f.length;++_)x[V++]=x[_]<60?t[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,V)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function a(f,x,_){var C=n.exports.sbrk,V=C(x.length*4),L=C(_*4),R=new Uint8Array(n.exports.memory.buffer),G=s(x);R.set(G,V);var I=f(L,V,x.length,_);R=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(_);new Uint8Array(v.buffer).set(R.subarray(L,L+_*4)),G.set(R.subarray(V,V+x.length*4)),C(V-C(0));for(var P=0;P<x.length;++P)x[P]=v[x[P]];return[v,I]}function c(f){for(var x=0,_=0;_<f.length;++_){var C=f[_];x=x<C?C:x}return x}function d(f,x,_,C,V,L,R,G,I){var v=n.exports.sbrk,P=v(4),w=v(_*4),M=v(V*L),b=v(_*4),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(C),M),Z.set(s(x),b);var E=f(w,b,_,M,V,L,R,G,I,P);Z=new Uint8Array(n.exports.memory.buffer);var X=new Uint32Array(E);s(X).set(Z.subarray(w,w+E*4));var F=new Float32Array(1);return s(F).set(Z.subarray(P,P+4)),v(P-v(0)),[X,F[0]]}function u(f,x,_,C,V,L,R,G,I,v,P,w,M){var b=n.exports.sbrk,Z=b(4),E=b(_*4),X=b(V*L),F=b(V*G),N=b(I.length*4),O=b(_*4),U=v?b(V):0,Y=new Uint8Array(n.exports.memory.buffer);Y.set(s(C),X),Y.set(s(R),F),Y.set(s(I),N),Y.set(s(x),O),v&&Y.set(s(v),U);var k=f(E,O,_,X,V,L,F,G,N,I.length,U,P,w,M,Z);Y=new Uint8Array(n.exports.memory.buffer);var H=new Uint32Array(k);s(H).set(Y.subarray(E,E+k*4));var K=new Float32Array(1);return s(K).set(Y.subarray(Z,Z+4)),b(Z-b(0)),[H,K[0]]}function h(f,x,_,C){var V=n.exports.sbrk,L=V(_*C),R=new Uint8Array(n.exports.memory.buffer);R.set(s(x),L);var G=f(L,_,C);return V(L-V(0)),G}function p(f,x,_,C,V,L,R,G){var I=n.exports.sbrk,v=I(G*4),P=I(_*C),w=I(_*L),M=new Uint8Array(n.exports.memory.buffer);M.set(s(x),P),V&&M.set(s(V),w);var b=f(v,P,_,C,w,L,R,G);M=new Uint8Array(n.exports.memory.buffer);var Z=new Uint32Array(b);return s(Z).set(M.subarray(v,v+b*4)),I(v-I(0)),Z}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(f){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0);var x=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(f)+1)},simplify:function(f,x,_,C,V,L){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C>=0&&C<=f.length),r(C%3==0),r(V>=0);for(var R=0,G=0;G<(L?L.length:0);++G)r(L[G]in g),r(this.useExperimentalFeatures||L[G]!="Prune"),R|=g[L[G]];var I=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),v=d(n.exports.meshopt_simplify,I,f.length,x,x.length/_,_*4,C,V,R);return v[0]=f instanceof Uint32Array?v[0]:new f.constructor(v[0]),v},simplifyWithAttributes:function(f,x,_,C,V,L,R,G,I,v){r(this.useExperimentalFeatures),r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C instanceof Float32Array),r(C.length%V==0),r(V>=0),r(R==null||R instanceof Uint8Array),r(R==null||R.length==x.length/_),r(G>=0&&G<=f.length),r(G%3==0),r(I>=0),r(Array.isArray(L)),r(V>=L.length),r(L.length<=32);for(var P=0;P<L.length;++P)r(L[P]>=0);for(var w=0,P=0;P<(v?v.length:0);++P)r(v[P]in g),w|=g[v[P]];var M=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),b=u(n.exports.meshopt_simplifyWithAttributes,M,f.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),R?new Uint8Array(R):null,G,I,w);return b[0]=f instanceof Uint32Array?b[0]:new f.constructor(b[0]),b},getScale:function(f,x){return r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),h(n.exports.meshopt_simplifyScale,f,f.length/x,x*4)},simplifyPoints:function(f,x,_,C,V,L){return r(this.useExperimentalFeatures),r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),r(_>=0&&_<=f.length/x),C?(r(C instanceof Float32Array),r(C.length%V==0),r(V>=3),r(f.length/x==C.length/V),p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,C,V*4,L,_)):p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,void 0,0,0,_)}}}();var gEn=T(S()),pEn=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd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PIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_<f.length;++_){var C=f.charCodeAt(_);x[_]=C>96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_<f.length;++_)x[V++]=x[_]<60?t[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,V)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}var a=48,c=16;function d(f,x){var _=f.meshlets[x*4+0],C=f.meshlets[x*4+1],V=f.meshlets[x*4+2],L=f.meshlets[x*4+3];return{vertices:f.vertices.subarray(_,_+V),triangles:f.triangles.subarray(C,C+L*3)}}function u(f,x,_,C,V,L,R){var G=n.exports.sbrk,I=n.exports.meshopt_buildMeshletsBound(f.length,V,L),v=G(I*c),P=G(I*V*4),w=G(I*L*3),M=G(f.byteLength),b=G(x.byteLength),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(f),M),Z.set(s(x),b);var E=n.exports.meshopt_buildMeshlets(v,P,w,M,f.length,b,_,C,V,L,R);Z=new Uint8Array(n.exports.memory.buffer);for(var X=Z.subarray(v,v+E*c),F=new Uint32Array(X.buffer,X.byteOffset,X.byteLength/4).slice(),N=0;N<E;++N){var O=F[N*4+0],U=F[N*4+1],_=F[N*4+2],Y=F[N*4+3];n.exports.meshopt_optimizeMeshlet(P+O*4,w+U,Y,_)}var k=F[(E-1)*4+0],H=F[(E-1)*4+1],K=F[(E-1)*4+2],te=F[(E-1)*4+3],z=k+K,j=H+(te*3+3&-4),ee={meshlets:F,vertices:new Uint32Array(Z.buffer,P,z).slice(),triangles:new Uint8Array(Z.buffer,w,j*3).slice(),meshletCount:E};return G(v-G(0)),ee}function h(f){var x=new Float32Array(n.exports.memory.buffer,f,a/4);return{centerX:x[0],centerY:x[1],centerZ:x[2],radius:x[3],coneApexX:x[4],coneApexY:x[5],coneApexZ:x[6],coneAxisX:x[7],coneAxisY:x[8],coneAxisZ:x[9],coneCutoff:x[10]}}function p(f,x,_,C){var V=n.exports.sbrk,L=[],R=V(x.byteLength),G=V(f.vertices.byteLength),I=V(f.triangles.byteLength),v=V(a),P=new Uint8Array(n.exports.memory.buffer);P.set(s(x),R),P.set(s(f.vertices),G),P.set(s(f.triangles),I);for(var w=0;w<f.meshletCount;++w){var M=f.meshlets[w*4+0],b=f.meshlets[w*4+0+1],Z=f.meshlets[w*4+0+3];n.exports.meshopt_computeMeshletBounds(v,G+M*4,I+b,Z,R,_,C),L.push(h(v))}return V(R-V(0)),L}function g(f,x,_,C){var V=n.exports.sbrk,L=V(a),R=V(f.byteLength),G=V(x.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(f),R),I.set(s(x),G),n.exports.meshopt_computeClusterBounds(L,R,f.length,G,_,C);var v=h(L);return V(L-V(0)),v}return{ready:i,supported:!0,buildMeshlets:function(f,x,_,C,V,L){r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C<=255||C>0),r(V<=512),r(V%4==0),L=L||0;var R=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return u(R,x,x.length/_,_*4,C,V,L)},computeClusterBounds:function(f,x,_){r(f.length%3==0),r(f.length/3<=512),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3);var C=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return g(C,x,x.length/_,_*4)},computeMeshletBounds:function(f,x,_){return r(f.meshletCount!=0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),p(f,x,x.length/_,_*4)},extractMeshlet:function(f,x){return r(x>=0&&x<f.meshletCount),d(f,x)}}}();function H_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,d=a.byteOffset,u=a.byteLength,h=!1,p,g,f,x;if(si(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,d=y(C.byteOffset,0),u=C.byteLength,h=!0,p=C.byteStride,g=C.count,f=C.mode,x=y(C.filter,"NONE")}let _=n.buffers[c];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=f,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=_,this._bufferId=c,this._byteOffset=d,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(H_.prototype=Object.create(Ki.prototype),H_.prototype.constructor=H_);Object.defineProperties(H_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function lBe(e){try{let t=dBe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);rle.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=yt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load buffer view",t)}}H_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=lBe(this),this._promise)};function dBe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}H_.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var f1=H_;var JEn=T(S(),1);var AEn=T(S(),1);function Ur(){}Ur._maxDecodingConcurrency=Math.max(Bt.hardwareConcurrency-1,1);Ur._decoderTaskProcessor=void 0;Ur._taskProcessorReady=!1;Ur._error=void 0;Ur._getDecoderTaskProcessor=function(){if(!l(Ur._decoderTaskProcessor)){let e=new yi("decodeDraco",Ur._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Ur._taskProcessorReady=!0:Ur._error=new ae("Draco decoder could not be initialized.")}).catch(t=>{Ur._error=t}),Ur._decoderTaskProcessor=e}return Ur._decoderTaskProcessor};Ur.decodePointCloud=function(e){let t=Ur._getDecoderTaskProcessor();if(l(Ur._error))throw Ur._error;if(Ur._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ur.decodeBufferView=function(e){let t=Ur._getDecoderTaskProcessor();if(l(Ur._error))throw Ur._error;if(Ur._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Sb=Ur;var kEn=T(S(),1);var ai={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function uBe(e){switch(e){case ai.POSITION:return"positionMC";case ai.NORMAL:return"normalMC";case ai.TANGENT:return"tangentMC";case ai.TEXCOORD:return"texCoord";case ai.COLOR:return"color";case ai.JOINTS:return"joints";case ai.WEIGHTS:return"weights";case ai.FEATURE_ID:return"featureId"}}ai.hasSetIndex=function(e){switch(e){case ai.POSITION:case ai.NORMAL:case ai.TANGENT:return!1;case ai.TEXCOORD:case ai.COLOR:case ai.JOINTS:case ai.WEIGHTS:case ai.FEATURE_ID:return!0}};ai.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ai.POSITION;case"NORMAL":return ai.NORMAL;case"TANGENT":return ai.TANGENT;case"TEXCOORD":return ai.TEXCOORD;case"COLOR":return ai.COLOR;case"JOINTS":return ai.JOINTS;case"WEIGHTS":return ai.WEIGHTS;case"_FEATURE_ID":return ai.FEATURE_ID}};ai.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ai.POSITION;case"RGBA":case"RGB":case"RGB565":return ai.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ai.NORMAL;case"BATCH_ID":return ai.FEATURE_ID}};ai.getGlslType=function(e){switch(e){case ai.POSITION:case ai.NORMAL:case ai.TANGENT:return"vec3";case ai.TEXCOORD:return"vec2";case ai.COLOR:return"vec4";case ai.JOINTS:return"ivec4";case ai.WEIGHTS:return"vec4";case ai.FEATURE_ID:return"int"}};ai.getVariableName=function(e,t){let n=uBe(e);return l(t)&&(n+=`_${t}`),n};var ft=Object.freeze(ai);function wg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=s,this._gltf=n,this._primitive=i,this._draco=o,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=yt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(wg.prototype=Object.create(Ki.prototype),wg.prototype.constructor=wg);Object.defineProperties(wg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function mBe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;sle(e,n)}}wg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=mBe(this),this._promise)};function sle(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load Draco",t)}async function hBe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=yt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var z_={};z_[ft.POSITION]="POSITION";z_[ft.NORMAL]="NORMAL";z_[ft.COLOR]="COLOR";z_[ft.TEXCOORD]="TEX_COORD";function fBe(e){for(let t in z_)if(z_.hasOwnProperty(t)&&e.startsWith(t))return z_[t]}wg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.PROCESSING||(l(this._dracoError)&&sle(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,n=this._primitive,i=this._gltf,o=i.bufferViews,r=t.bufferView,s=o[r],a=t.attributes,c=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=fBe(h);l(p)&&i.accessors[n.attributes[h]].componentType===Q.FLOAT&&(c.includes(p)||c.push(p))}let d={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:c},u=Sb.decodeBufferView(d);if(!l(u))return!1;this._decodePromise=hBe(this,u)};wg.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0};var p1=wg;var oIn=T(S(),1);function Cb(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Cb.prototype=Object.create(Ki.prototype),Cb.prototype.constructor=Cb);Object.defineProperties(Cb.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Cb.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=pBe(this),this._promise):(this._promise=bBe(this),this._promise)};function ale(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function pBe(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await yBe(i);if(e.isDestroyed())return;let r=ale(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(n){return e.isDestroyed()?void 0:cle(e,n,"Failed to load embedded image")}}async function bBe(e){e._state=yt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await _Be(i);if(e.isDestroyed())return;let r=ale(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(o){return e.isDestroyed()?void 0:cle(e,o,`Failed to load image: ${n}`)}}function cle(e,t,n){return e.unload(),e._state=yt.FAILED,Promise.reject(e.getError(n,t))}function gBe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ae("Image format is not recognized")}async function yBe(e){let t=gBe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Zl(n)}return Cb._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var xBe=/(^data:image\/ktx2)|(\.ktx2$)/i;function _Be(e){let t=e.getUrlComponent(!1,!0);return xBe.test(t)?Zl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Cb.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Cb._loadImageFromTypedArray=m_;var b1=Cb;var yIn=T(S(),1);var sIn=T(S(),1),TBe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ma=Object.freeze(TBe);function Fg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,c=e.cacheKey,d=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),h=y(e.loadTypedArray,!1),p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._primitive=s,this._draco=a,this._cacheKey=c,this._asynchronous=d,this._loadBuffer=u,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Fg.prototype=Object.create(Ki.prototype),Fg.prototype.constructor=Fg);Object.defineProperties(Fg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var SBe=new AK;Fg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=CBe(this),this._promise):(this._promise=VBe(this),this._promise)};async function CBe(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;FK(e,n)}}async function VBe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=yt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=LBe(e,a),e._state=yt.PROCESSING,e}catch(s){if(e.isDestroyed())return;FK(e,s)}}function LBe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ae.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let h=r*a,p=new Uint8Array(c,d,h);c=new Uint8Array(p).buffer,d=0,wa("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ae.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ae.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ae.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function FK(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load index buffer",t)}function AK(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}AK.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};AK.prototype.execute=function(){this.buffer=lle(this.typedArray,this.indexDatatype,this.context)};function lle(e,t,n){let i=xt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Fg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){FK(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=SBe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Ma.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=lle(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Fg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var g1=Fg;var R2n=T(S(),1);var BIn=T(S(),1);var TIn=T(S(),1);function RBe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Zs=RBe;var GIn=T(S(),1);var VIn=T(S(),1);function ZBe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var lr=ZBe;function Kt(){}Kt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};Kt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};Kt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Kt.objectLegacy(i,n):Kt.object(i,n)};Kt.accessor=function(e,t){return Kt.topLevel(e,"accessors",t)};Kt.accessorWithSemantic=function(e,t,n){let i={};return Kt.mesh(e,function(o){return Kt.meshPrimitive(o,function(r){let s=Kt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let d=n(a);if(l(d))return d}});return l(s)?s:Kt.meshPrimitiveTarget(r,function(a){return Kt.meshPrimitiveTargetAttribute(a,function(c,d){if(d.indexOf(t)===0&&!l(i[c])){i[c]=!0;let u=n(c);if(l(u))return u}})})})})};Kt.accessorContainingVertexAttributeData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=Kt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Kt.meshPrimitiveTarget(o,function(s){return Kt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Kt.accessorContainingIndexData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};Kt.animation=function(e,t){return Kt.topLevel(e,"animations",t)};Kt.animationChannel=function(e,t){let n=e.channels;return Kt.object(n,t)};Kt.animationSampler=function(e,t){let n=e.samplers;return Kt.object(n,t)};Kt.buffer=function(e,t){return Kt.topLevel(e,"buffers",t)};Kt.bufferView=function(e,t){return Kt.topLevel(e,"bufferViews",t)};Kt.camera=function(e,t){return Kt.topLevel(e,"cameras",t)};Kt.image=function(e,t){return Kt.topLevel(e,"images",t)};Kt.material=function(e,t){return Kt.topLevel(e,"materials",t)};Kt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.mesh=function(e,t){return Kt.topLevel(e,"meshes",t)};Kt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};Kt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};Kt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};Kt.node=function(e,t){return Kt.topLevel(e,"nodes",t)};Kt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let d=a.children;if(l(d)&&(c=Kt.nodeInTree(e,d,n),l(c)))return c}}}};Kt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Kt.nodeInTree(e,i,n)};Kt.program=function(e,t){return lr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.programs,t):Kt.topLevel(e,"programs",t)};Kt.sampler=function(e,t){return Kt.topLevel(e,"samplers",t)};Kt.scene=function(e,t){return Kt.topLevel(e,"scenes",t)};Kt.shader=function(e,t){return lr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.shaders,t):Kt.topLevel(e,"shaders",t)};Kt.skin=function(e,t){return Kt.topLevel(e,"skins",t)};Kt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};Kt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.technique=function(e,t){return lr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.techniques,t):Kt.topLevel(e,"techniques",t)};Kt.texture=function(e,t){return Kt.topLevel(e,"textures",t)};var We=Kt;var wIn=T(S(),1);var IIn=T(S(),1);function GBe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var Id=GBe;function EBe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*Id(t.type)}var Ul=EBe;function IBe(e){We.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),We.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),We.mesh(e,function(n){We.meshPrimitive(n,function(i){if(i.mode=y(i.mode,ie.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Zs(e.materials,o)}})}),We.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Ul(e,i),r.target=ie.ARRAY_BUFFER}}),We.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),We.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=y(d.transparency,1),c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=y(d.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&We.materialValue(n,function(c){l(c.index)&&K_(c)}),K_(n.emissiveTexture),K_(n.normalTexture),K_(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),K_(s.baseColorTexture),K_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),K_(a.specularGlossinessTexture))}),We.animation(e,function(n){We.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=XBe(e);return We.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),We.sampler(e,function(n){n.wrapS=y(n.wrapS,ie.REPEAT),n.wrapT=y(n.wrapT,ie.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function XBe(e){let t={};return We.animation(e,function(n){We.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function K_(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var qX=IBe;var zIn=T(S(),1);function WBe(e){return We.shader(e,function(t){Gk(t)}),We.buffer(e,function(t){Gk(t)}),We.image(e,function(t){Gk(t)}),Gk(e),e}function Gk(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Ag=WBe;var lXn=T(S(),1);var eXn=T(S(),1);var QIn=T(S(),1);function PBe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var $X=PBe;function vBe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),$X(e,t),n.length===0&&delete e.extensionsUsed}}var J_=vBe;var wBe=4;function FBe(e){if(zm(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=dle(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?ABe(e,n):MBe(e,n)}function dle(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*wBe,!0);return o}function ABe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ae("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Pl(e,r,i),c=JSON.parse(a);Ag(c);let d=e.subarray(s,n),u=c.buffers;if(l(u)&&Object.keys(u).length>0){let h=y(u.binary_glTF,u.KHR_binary_glTF);l(h)&&(h.extras._pipeline.source=d,delete h.uri)}return J_(c,"KHR_binary_glTF"),c}function MBe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=dle(e,i,2),a=s[0],c=s[1];i+=8;let d=e.subarray(i,i+a);if(i+=a,c===1313821514){let u=Pl(d);o=JSON.parse(u),Ag(o)}else c===5130562&&(r=d)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var eW=FBe;var hXn=T(S(),1);function NBe(e){return We.shader(e,function(t){Ek(t)}),We.buffer(e,function(t){Ek(t)}),We.image(e,function(t){Ek(t)}),Ek(e),e}function Ek(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var tW=NBe;var KWn=T(S(),1);var gXn=T(S(),1);function kBe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Zs(n,t,!0)}var Yu=kBe;var ZXn=T(S(),1);var _Xn=T(S(),1);function UBe(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case Q.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case Q.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case Q.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case Q.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case Q.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case Q.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case Q.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Vb=UBe;function DBe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Id(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],d=c.buffer,h=i[d].extras._pipeline.source,p=t.count,g=Ul(e,t),f=t.byteOffset+c.byteOffset+h.byteOffset,x=t.componentType,_=Q.getSizeInBytes(x),C=new DataView(h.buffer),V=new Array(r),L=Vb(x);for(let R=0;R<p;R++){L(C,f,r,_,V);for(let G=0;G<r;G++){let I=V[G];s[G]=Math.min(s[G],I),a[G]=Math.max(a[G],I)}f+=g}return{min:s,max:a}}var Q_=DBe;var vXn=T(S(),1);var BBe=[ie.FUNC_ADD,ie.FUNC_ADD],OBe=[ie.ONE,ie.ZERO,ie.ONE,ie.ZERO];function ule(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var YBe=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function HBe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(YBe.indexOf(e[n])===-1)return t;return e}function zBe(e){let t={},n={},i=e.techniques;return l(i)&&(We.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(ule(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,BBe),blendFactors:HBe(c.blendFuncSeparate,OBe)})}ule(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Yu(e,"KHR_blend")),We.material(e,function(o){if(l(o.technique)){let r=n[o.technique];We.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var nW=zBe;var HXn=T(S(),1);var NXn=T(S(),1);function KBe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Zs(n,t,!0),Yu(e,t)}var iW=KBe;function JBe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,We.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(We.techniqueAttribute(a,function(h,p){u=a.parameters[h],d.attributes[p]={semantic:u.semantic}}),We.techniqueUniform(a,function(h,p){u=a.parameters[h],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))d.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=Zs(r.shaders,g,!0);let f=e.shaders[h.vertexShader];p.vertexShader=Zs(r.shaders,f,!0),d.program=Zs(r.programs,p),o[a.program]=d.program}i[c]=Zs(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Yu(e,"KHR_techniques_webgl"),iW(e,"KHR_techniques_webgl"))}return We.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};We.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var oW=JBe;var oWn=T(S(),1);var jXn=T(S(),1);function QBe(e,t){xo.typeOf.object("material",e),xo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=We.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var y1=QBe;var mle=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function jBe(e,t){return t=y(t,mle),mle.forEach(function(n){t.indexOf(n)>-1&&$Be(e,n)}),e}var qBe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function $Be(e,t){let n=qBe[t],i=e[n];if(l(i)){let o=0,r=Xf[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(If[t](e,a-o),o++)}}function If(){}If.accessor=function(e,t){e.accessors.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){We.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),We.meshPrimitiveTarget(o,function(a){We.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),We.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),We.animation(e,function(i){We.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};If.buffer=function(e,t){e.buffers.splice(t,1),We.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};If.bufferView=function(e,t){if(e.bufferViews.splice(t,1),We.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),lr(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),lr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(lr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];l(u.values)&&u.values>t&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};If.image=function(e,t){e.images.splice(t,1),We.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};If.mesh=function(e,t){e.meshes.splice(t,1),We.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};If.node=function(e,t){e.nodes.splice(t,1),We.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),We.animation(e,function(i){We.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),We.technique(e,function(i){We.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),We.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),We.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};If.material=function(e,t){e.materials.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};If.sampler=function(e,t){e.samplers.splice(t,1),We.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};If.texture=function(e,t){if(e.textures.splice(t,1),We.material(e,function(i){y1(i,function(o,r){r.index>t&&--r.index})}),lr(e,"EXT_feature_metadata")){We.mesh(e,function(r){We.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let h=0;h<u;++h){let g=d[h].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(lr(e,"EXT_mesh_features")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;d<c;++d){let u=a[d];l(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),lr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];u.index>t&&--u.index}}}}};function Xf(){}Xf.accessor=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(r){t[r]=!0}),We.meshPrimitiveTarget(i,function(r){We.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),We.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),We.animation(e,function(n){We.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),lr(e,"EXT_mesh_gpu_instancing")&&We.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),lr(e,"CESIUM_primitive_outline")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Xf.buffer=function(e){let t={};return We.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Xf.bufferView=function(e){let t={};if(We.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),lr(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),lr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(lr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.values)&&(t[d.values]=!0),l(d.arrayOffsets)&&(t[d.arrayOffsets]=!0),l(d.stringOffsets)&&(t[d.stringOffsets]=!0)}}}}return t};Xf.image=function(e){let t={};return We.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Xf.mesh=function(e){let t={};return We.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function hle(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!hle(e,o,n)}).length===0}Xf.node=function(e){let t={};return We.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),We.skinJoint(n,function(i){t[i]=!0})}),We.animation(e,function(n){We.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),We.technique(e,function(n){We.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),We.node(e,function(n,i){hle(e,i,t)||(t[i]=!0)}),t};Xf.material=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Xf.texture=function(e){let t={};if(We.material(e,function(n){y1(n,function(i){t[i]=!0})}),lr(e,"EXT_feature_metadata")){We.mesh(e,function(o){We.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u<d;++u){let p=c[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].texture;t[d.index]=!0}}}}if(lr(e,"EXT_mesh_features")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let d=s[c];l(d.texture)&&(t[d.texture.index]=!0)}}}})}),lr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];t[d.index]=!0}}}}return t};Xf.sampler=function(e){let t={};return We.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var rW=jBe;var TWn=T(S(),1);var aWn=T(S(),1);function eOe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Zs(e.buffers,n),byteOffset:0,byteLength:t.length};return Zs(e.bufferViews,o)}var sW=eOe;var fWn=T(S(),1);function tOe(e,t){let n=Ul(e,t),i=Q.getSizeInBytes(t.componentType),o=Id(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,d=t.byteOffset+a.byteOffset+c.byteOffset,u=new DataView(c.buffer),h=new Array(o),p=Vb(t.componentType);for(let g=0;g<r;++g){p(u,d,o,i,h);for(let f=0;f<o;++f)s[g*o+f]=h[f];d+=n}return s}var aW=tOe;function nOe(e){let t;return We.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?Ik(e,i,Q.UNSIGNED_BYTE):t!==ie.UNSIGNED_BYTE&&t!==ie.UNSIGNED_SHORT&&Ik(e,i,Q.UNSIGNED_SHORT)}),We.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?Ik(e,i,Q.UNSIGNED_BYTE):t===ie.SHORT&&Ik(e,i,Q.UNSIGNED_SHORT)}),e}function Ik(e,t,n){let i=Q.createTypedArray(n,aW(e,t)),o=new Uint8Array(i.buffer);t.bufferView=sW(e,o),t.componentType=n,t.byteOffset=0}var cW=nOe;var RWn=T(S(),1);function iOe(e,t){return J_(e,t),t==="CESIUM_RTC"&&oOe(e),MK(e,t)}function oOe(e){We.technique(e,function(t){We.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function MK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)MK(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&MK(e[o],t);return i}}var j_=iOe;var Xk={.8:dOe,"1.0":XOe,"2.0":void 0};function rOe(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(Xk,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(Xk,i)||(i="1.0"));let o=Xk[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=Xk[i];return t.keepLegacyExtensions||(vOe(e,t),wOe(e)),e}function ble(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function sOe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,ie.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function aOe(e){let t=e.nodes,n=new m,i=new ve;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;m.fromArray(a,0,n),ve.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function cOe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new m,a=new ve;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let d=t[c],u=d.channels,h=d.parameters,p=d.samplers;if(l(u)){let g=u.length;for(let f=0;f<g;++f){let x=u[f];if(x.target.path==="rotation"){let _=h[p[x.sampler].output];if(l(r[_]))continue;r[_]=!0;let C=n[_],V=i[C.bufferView],R=o[V.buffer].extras._pipeline.source,G=R.byteOffset+V.byteOffset+C.byteOffset,I=C.componentType,v=C.count,P=Id(C.type),w=C.count*P,M=Q.createArrayBufferView(I,R.buffer,G,w);for(let b=0;b<v;b++){let Z=b*P;m.unpack(M,Z,s);let E=M[Z+3];ve.fromAxisAngle(s,E,a),ve.pack(a,M,Z)}}}}}}function lOe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function dOe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,ble(e),sOe(e),aOe(e),cOe(e),lOe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Yu(e,"KHR_materials_common")}}function uOe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function fle(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function mOe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=fle(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),We.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),We.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),We.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),We.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),We.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),We.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),We.mesh(e,function(s){We.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),We.meshPrimitiveAttribute(a,function(c,d){a.attributes[d]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),We.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,d=c.length;if(d>0)for(s.mesh=n.meshes[c[0]],t=1;t<d;++t){let u={mesh:n.meshes[c[t]]},h=Zs(e.nodes,u);l(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),We.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t<d;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),We.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),We.animation(e,function(s){let a={};s.samplers=fle(s.samplers,a),We.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),We.animationChannel(s,function(c){c.sampler=a[c.sampler];let d=c.target;l(d)&&(d.node=n.nodes[d.id],delete d.id)})}),We.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),We.materialValue(s,function(c,d){typeof c=="string"&&(s.values[d]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&We.materialValue(c,function(d,u){typeof d=="string"&&(c.values[u]={index:n.textures[d]})})}}),We.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),We.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function hOe(e){We.animation(e,function(t){We.animationSampler(t,function(n){delete n.name})})}function fOe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}We.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function pOe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var bOe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function gOe(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(bOe[o])&&e.extensionsRequired.push(o)}}}function yOe(e){We.buffer(e,function(t){delete t.type})}function xOe(e){We.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function _Oe(e){We.mesh(e,function(t){We.meshPrimitive(t,function(n){We.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),We.technique(e,function(t){We.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var TOe={POSITION:!0,NORMAL:!0,TANGENT:!0},SOe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function COe(e){let t={};We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=SOe[a];l(u)?(d=u+c,t[r]=d):l(TOe[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),We.technique(e,function(n){We.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function VOe(e){We.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function kK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Ul(e,t)}function LOe(e){We.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),We.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=kK(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function ROe(e){let t,n,i,o=e.bufferViews,r={};We.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};We.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let d=0,u=0,h=c.length;for(t=0;t<h;++t){let p=c[t],g=kK(e,p),f=p.byteOffset,x=p.count*g;delete p.byteStride;let _=t<h-1,C=_?kK(e,c[t+1]):void 0;if(g!==C){let V=Ye(i,!0);r[a]&&(V.byteStride=g),V.byteOffset+=d,V.byteLength=f+x-d;let L=Zs(o,V);for(n=u;n<=t;++n)p=c[n],p.bufferView=L,p.byteOffset=p.byteOffset-d;d=_?c[t+1].byteOffset:void 0,u=t+1}}}rW(e,["accessor","bufferView","buffer"])}function ZOe(e){We.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Q_(e,n);n.min=i.min,n.max=i.max}})}function gle(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!l(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||A.fromColumnMajorArray(e.matrix).equals(A.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function yle(e,t){We.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),We.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),gle(n)&&yle(e,i))}}),delete e.nodes[t]}function GOe(e){return We.node(e,function(t,n){gle(t)&&yle(e,n)}),e}function EOe(e){We.animation(e,function(t){We.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=Q_(e,i);i.min=o.min,i.max=o.max}})})}function IOe(e){We.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Q_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function XOe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",ble(e),uOe(e),GOe(e),mOe(e),hOe(e),pOe(e),gOe(e),LOe(e),ROe(e),ZOe(e),EOe(e),IOe(e),yOe(e),xOe(e),_Oe(e),COe(e),cW(e),VOe(e),nW(e),oW(e),fOe(e)}var WOe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],POe=["u_diffuse","u_diffuse_mat"];function UK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function DK(e){return l(e.index)}function BK(e){return Array.isArray(e)&&e.length===4}function xle(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function vOe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,WOe),i=y(t.baseColorFactorNames,POe);We.material(e,function(o){We.materialValue(o,function(r,s){n.indexOf(s)!==-1&&DK(r)?(UK(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&BK(r)&&(UK(o),o.pbrMetallicRoughness.baseColorFactor=xle(r))})}),j_(e,"KHR_techniques_webgl"),j_(e,"KHR_blend")}function NK(e,t){l(t)&&(BK(t)?e.pbrMetallicRoughness.baseColorFactor=xle(t):DK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function ple(e,t){l(t)&&(BK(t)?e.emissiveFactor=t.slice(0,3):DK(t)&&(e.emissiveTexture=t))}function wOe(e){We.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;UK(t),n.technique==="CONSTANT"?(Yu(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},NK(t,s),NK(t,o)):(NK(t,r),ple(t,o),ple(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),j_(e,"KHR_materials_common")}var lW=rOe;var a2n=T(S(),1);function xc(){}xc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
${n.message}`);let o=new ae(i);return l(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};xc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:A.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:ve.IDENTITY,l(e.scale)?e.scale:m.ONE)};xc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};xc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};xc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};xc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};xc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=ft.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=on.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),d;return c&&(d=r?"vec4":on.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var FOe=new m,AOe=new m;xc.getPositionMinMax=function(e,t,n){let i=xc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=m.add(r,t,AOe),o=m.add(o,n,FOe)),{min:r,max:o}};xc.getAxisCorrectionMatrix=function(e,t,n){return n=A.clone(A.IDENTITY,n),e===Po.Y?n=A.clone(Po.Y_UP_TO_Z_UP,n):e===Po.X&&(n=A.clone(Po.X_UP_TO_Z_UP,n)),t===Po.Z&&(n=A.multiplyTransformation(n,Po.Z_UP_TO_X_UP,n)),n};var MOe=new $;xc.getCullFace=function(e,t){if(!we.isTriangles(t))return Ti.BACK;let n=A.getMatrix3(e,MOe);return $.determinant(n)<0?Ti.FRONT:Ti.BACK};xc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};xc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};xc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!xc.supportedExtensions[i])throw new ae(`Unsupported glTF Extension: ${i}`)}};var Qt=xc;function Mg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Mg.prototype=Object.create(Ki.prototype),Mg.prototype.constructor=Mg);Object.defineProperties(Mg.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Mg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,l(this._gltfJson)?(this._promise=_le(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Tle(this,this._typedArray),this._promise):(this._promise=NOe(this),this._promise))};async function NOe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;OK(e,n)}return Tle(e,t)}function OK(e,t){e.unload(),e._state=yt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function kOe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!lr(t,"KHR_techniques_webgl")&&!lr(t,"KHR_materials_common"))return Promise.resolve();let n=[];We.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),lW(t)}function UOe(e){let t=[];return We.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Cp(i)&&(delete n.uri,t.push(Ze.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function DOe(e,t){let n=[];return We.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function _le(e,t){try{Ag(t),await UOe(t),await kOe(e,t),qX(t),await DOe(e,t),tW(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new ae(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Qt.checkSupportedExtensions(i),e._gltf=t,e._state=yt.READY,e}catch(n){if(e.isDestroyed())return;OK(e,n)}}async function Tle(e,t){let n;try{zm(t)==="glTF"?n=eW(t):n=Jo(t)}catch(i){if(e.isDestroyed())return;OK(e,i)}return _le(e,n)}Mg.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Mg.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var x1=Mg;var sPn=T(S(),1);var H2n=T(S(),1);var w2n=T(S(),1);var G2n=T(S(),1),BOe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Wf=Object.freeze(BOe);var Lo={};function OOe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function YOe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function HOe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function zOe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function KOe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function JOe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function QOe(){this.attributes=[]}function jOe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function qOe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function $Oe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function e3e(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function t3e(){this.nodes=[]}var n3e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function i3e(){this.input=[],this.interpolation=void 0,this.output=[]}function o3e(){this.node=void 0,this.path=void 0}function r3e(){this.sampler=void 0,this.target=void 0}function s3e(){this.name=void 0,this.samplers=[],this.channels=[]}function a3e(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function c3e(){this.name=void 0,this.stages=[]}function Sle(){this.credits=[]}function l3e(){this.asset=new Sle,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=A.clone(A.IDENTITY),this.extensions={}}function d3e(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function Ng(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Ng.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Ng.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Ng.DEFAULT_ROUGHNESS_FACTOR}Ng.DEFAULT_BASE_COLOR_FACTOR=se.ONE;Ng.DEFAULT_METALLIC_FACTOR=1;Ng.DEFAULT_ROUGHNESS_FACTOR=1;function q_(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(q_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(q_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=q_.DEFAULT_GLOSSINESS_FACTOR}q_.DEFAULT_DIFFUSE_FACTOR=se.ONE;q_.DEFAULT_SPECULAR_FACTOR=m.ONE;q_.DEFAULT_GLOSSINESS_FACTOR=1;function dW(){this.specularFactor=dW.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=m.clone(dW.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}dW.DEFAULT_SPECULAR_FACTOR=1;dW.DEFAULT_SPECULAR_COLOR_FACTOR=m.ONE;function uW(){this.anisotropyStrength=uW.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=uW.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}uW.DEFAULT_ANISOTROPY_STRENGTH=0;uW.DEFAULT_ANISOTROPY_ROTATION=0;function mW(){this.clearcoatFactor=mW.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=mW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}mW.DEFAULT_CLEARCOAT_FACTOR=0;mW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function YK(){this.metallicRoughness=new Ng,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(YK.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Wf.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}YK.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Lo.Quantization=OOe;Lo.Attribute=YOe;Lo.Indices=HOe;Lo.FeatureIdAttribute=zOe;Lo.FeatureIdTexture=JOe;Lo.FeatureIdImplicitRange=KOe;Lo.MorphTarget=QOe;Lo.Primitive=jOe;Lo.Instances=qOe;Lo.Skin=$Oe;Lo.Node=e3e;Lo.Scene=t3e;Lo.AnimatedPropertyType=Object.freeze(n3e);Lo.AnimationSampler=i3e;Lo.AnimationTarget=o3e;Lo.AnimationChannel=r3e;Lo.Animation=s3e;Lo.ArticulationStage=a3e;Lo.Articulation=c3e;Lo.Asset=Sle;Lo.Components=l3e;Lo.TextureReader=d3e;Lo.MetallicRoughness=Ng;Lo.SpecularGlossiness=q_;Lo.Specular=dW;Lo.Anisotropy=uW;Lo.Clearcoat=mW;Lo.Material=YK;var Sn=Lo;var Wk={};Wk.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};Wk.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=Vn.REPEAT,r=Vn.REPEAT,s=jt.LINEAR,a=hi.LINEAR,c=n.index,u=t.textures[c].sampler;if(l(u)){let h=t.samplers[u];o=y(h.wrapS,o),r=y(h.wrapT,r),s=y(h.minFilter,s),a=y(h.magFilter,a)}return i&&s!==jt.LINEAR&&s!==jt.NEAREST&&(s===jt.NEAREST_MIPMAP_NEAREST||s===jt.NEAREST_MIPMAP_LINEAR?s=jt.NEAREST:s=jt.LINEAR),new qt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var u3e=new D(1,1);Wk.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?D.unpack(s.offset):D.ZERO,d=y(s.rotation,0),u=l(s.scale)?D.unpack(s.scale):u3e;d=-d,r=new $(Math.cos(d)*u.x,-Math.sin(d)*u.y,c.x,Math.sin(d)*u.x,Math.cos(d)*u.y,c.y,0,0,1)}let a=new Sn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var Dl=Wk;function kg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),d=i.index,u=Dl.getImageIdFromTexture({gltf:n,textureId:d,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(kg.prototype=Object.create(Ki.prototype),kg.prototype.constructor=kg);Object.defineProperties(kg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var m3e=new HK;async function h3e(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load texture",n)}}kg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=h3e(this),this._promise)};function HK(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}HK.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};HK.prototype.execute=function(){this.texture=Cle(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Cle(e,t,n,i,o,r){let s=i.internalFormat,a=!1;it.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=Dl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),d=c.minificationFilter,u=c.wrapS,h=c.wrapT,p=d===jt.NEAREST_MIPMAP_NEAREST||d===jt.NEAREST_MIPMAP_LINEAR||d===jt.LINEAR_MIPMAP_NEAREST||d===jt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,f=g||u===Vn.REPEAT||u===Vn.MIRRORED_REPEAT||h===Vn.REPEAT||h===Vn.MIRRORED_REPEAT,x=!W.isPowerOfTwo(i.width)||!W.isPowerOfTwo(i.height),_=f&&x,C;return l(s)?(!r.webgl2&&it.isCompressedFormat(s)&&x&&f&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),C=vt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(_&&(i=Rg(i)),C=vt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&C.generateMipmap(),C}kg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=yt.PROCESSING;let t;if(this._asynchronous){let n=m3e;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ma.TEXTURE))return;t=n.texture}else t=Cle(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=yt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};kg.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var _1=kg;var gPn=T(S(),1);function Ug(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,c=e.attributeSemantic,d=e.accessorId,u=e.cacheKey,h=y(e.asynchronous,!0),p=y(e.loadBuffer,!1),g=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._attributeSemantic=c,this._accessorId=d,this._cacheKey=u,this._asynchronous=h,this._loadBuffer=p,this._loadTypedArray=g,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ug.prototype=Object.create(Ki.prototype),Ug.prototype.constructor=Ug);Object.defineProperties(Ug.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function f3e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}Ug.prototype.load=async function(){return l(this._promise)?this._promise:f3e(this._draco,this._attributeSemantic)?(this._promise=b3e(this),this._promise):(this._promise=y3e(this),this._promise)};function p3e(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Sn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=on.VEC2,a.normalizationRange=r;else{let c=on.getMathType(i);if(c===Number){let d=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=d,a.normalizationRange=r,a.quantizedVolumeStepSize=d*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let d=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(d);let u=d.map(function(h){return h*s});a.quantizedVolumeStepSize=c.unpack(u)}}return a}async function b3e(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=yt.LOADED,e)}catch{if(e.isDestroyed())return;zK(e)}}function g3e(e){e._state=yt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,d=o.data.quantization;l(d)&&(e._quantization=p3e(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function y3e(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;zK(e,n)}}function zK(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load vertex buffer",t)}function KK(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}KK.prototype.set=function(e,t){this.typedArray=e,this.context=t};KK.prototype.execute=function(){this.buffer=Vle(this.typedArray,this.context)};function Vle(e,t){let n=xt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var x3e=new KK;Ug.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){zK(this,i)}g3e(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=x3e;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ma.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Vle(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Ug.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var T1=Ug;var zPn=T(S(),1);var kPn=T(S(),1);var CPn=T(S(),1);function hW(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}hW.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Ef.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new hW({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(hW.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});hW.BATCH_TABLE_CLASS_NAME="_batchTable";var oh=hW;var PPn=T(S(),1);var ZPn=T(S(),1);function Pk(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Pk.fromJson=function(e){return new Pk({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Pk.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var fW=Pk;function vk(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,Ft.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}vk.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return fW.fromJson(o)});return new vk({id:t,values:i,valueType:Ft[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(vk.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var pW=vk;function wk(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}wk.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=pW.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=oh.fromJson({id:i,class:e.classes[i],enums:t}));return new wk({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(wk.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Xd=wk;function $_(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Xd.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&($_.prototype=Object.create(Ki.prototype),$_.prototype.constructor=$_);Object.defineProperties($_.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});$_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=_3e(this),this._promise)};async function _3e(e){let t=e._resource;e._state=yt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Xd.fromJson(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}$_.prototype.unload=function(){this._schema=void 0};var S1=$_;var evn=T(S(),1);var rh={};function C1(e){return $h(e.url)}function Fk(e){let{byteOffset:t,byteLength:n}=e;if(si(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function T3e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Lle(e,t){return`${C1(e)}-buffer-id-${t}`}function bW(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return C1(o)}return Lle(n,t)}function JK(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=bW(a,s,n,i),d=Fk(r);return`${c}-range-${d}`}function Rle(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return C1(p)}let a=e.bufferViews[r],c=a.buffer,d=e.buffers[c],u=bW(d,c,n,i),h=Fk(a);return`${u}-range-${h}`}function S3e(e,t){let n=Dl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}rh.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${C1(n)}`};rh.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${C1(t)}`};rh.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Lle(t,n)}`};rh.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${C1(t)}`};rh.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];si(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=bW(a,s,i,o),d=Fk(r);return`buffer-view:${c}-range-${d}`};rh.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${JK(t,n,i,o)}`};rh.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:d=!1,loadTypedArray:u=!1}=e,h="";if(c&&(h+="-dequantize"),d&&(h+="-buffer",h+=`-context-${o.context.id}`),u&&(h+="-typed-array"),l(s))return`vertex-buffer:${JK(t,s,n,i)}-draco-${a}${h}`;let p=t.bufferViews[r],g=p.buffer,f=t.buffers[g],x=bW(f,g,n,i),_=Fk(p);return`vertex-buffer:${x}-range-${_}${h}`};rh.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),c&&(d+="-typed-array"),l(s))return`index-buffer:${JK(t,s,i,o)}-draco${d}`;let u=t.accessors[n],h=u.bufferView,p=t.bufferViews[h],g=p.buffer,f=t.buffers[g],x=bW(f,g,i,o),_=T3e(u,p);return`index-buffer:${x}-accessor-${_}${d}`};rh.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Rle(t,n,i,o)}`};rh.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=Dl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=Rle(t,c,i,o),u=S3e(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Bl=rh;var ivn=T(S(),1);function gW(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}gW.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};gW.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};gW.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};gW.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var yW=gW;function Mn(){}Mn.cacheEntries={};Mn.statistics=new yW;function C3e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Mn.get=function(e){let t=Mn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Mn.add=function(e){let t=e.cacheKey;return Mn.cacheEntries[t]=new C3e(e),e};Mn.unload=function(e){let t=e.cacheKey,n=Mn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Mn.statistics.removeLoader(e),e.destroy(),delete Mn.cacheEntries[t])};Mn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=Bl.getSchemaCacheKey({schema:t,resource:n}),o=Mn.get(i);return l(o)?o:(o=new S1({schema:t,resource:n,cacheKey:i}),Mn.add(o))};Mn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=Bl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Mn.get(o);return l(r)?r:(r=new Y_({typedArray:i,cacheKey:o}),Mn.add(r))};Mn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=Bl.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return l(i)?i:(i=new Y_({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Bl.getGltfCacheKey({gltfResource:t}),s=Mn.get(r);return l(s)?s:(s=new x1({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Bl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new f1({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,s=Bl.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Mn.get(s);return l(a)?a:(a=new p1({resourceCache:Mn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Mn.add(a))};Mn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:d,asynchronous:u=!0,dequantize:h=!1,loadBuffer:p=!1,loadTypedArray:g=!1}=e,f=Bl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:c,dequantize:h,loadBuffer:p,loadTypedArray:g}),x=Mn.get(f);return l(x)?x:(x=new T1({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:d,cacheKey:f,asynchronous:u,dequantize:h,loadBuffer:p,loadTypedArray:g}),Mn.add(x))};Mn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:d=!1,loadTypedArray:u=!1}=e,h=Bl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:d,loadTypedArray:u}),p=Mn.get(h);return l(p)?p:(p=new g1({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:c,loadBuffer:d,loadTypedArray:u}),Mn.add(p))};Mn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Bl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new b1({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Bl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=Mn.get(c);return l(d)?d:(d=new _1({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Mn.add(d))};Mn.clearForSpecs=function(){let e=[T1,g1,p1,_1,b1,f1,Y_,S1,x1],t,n=Mn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var Ri=Mn;function ha(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ha.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ha.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ha.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ha.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ha.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ha.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ha.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ha.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ha.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===ts.OCTREE&&(t=3),e>>t};ha.fromSubtreeJson=async function(e,t,n,i,o){let r=new ha(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=V3e(n);let a=s.json;r._subtreeJson=a;let c;if(si(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let d=[];if(l(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L<V;L++){let R=a.contentMetadata[L];d.push(a.propertyTables[R])}}let u,h=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let V=p.class,L=h.classes[V];u=new JX({subtreeMetadata:p,class:L})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let g={constant:0};a.contentAvailabilityHeaders=[],si(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let f=L3e(a.buffers),x=R3e(a.bufferViews,f);Z3e(a,x),l(c)&&Zle(c,x);for(let V=0;V<d.length;V++){let L=d[V];Zle(L,x)}let _=await G3e(r,f,s.binary),C=I3e(x,_);return X3e(r,a,i,C),l(c)&&(W3e(r,i,C),v3e(r)),P3e(r,i,C),w3e(r),r._ready=!0,r};function V3e(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Jo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function L3e(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function R3e(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function Z3e(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Zle(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function G3e(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=E3e(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function E3e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ri.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function I3e(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function X3e(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=si(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=QK(t.tileAvailability,i,s,u);let h=e._contentPropertyTableJsons.length>0;u=u||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=QK(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=QK(t.childSubtreeAvailability,i,a)}function QK(e,t,n,i){if(l(e.constant))return new m1({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new m1({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function W3e(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Ou({class:a,count:o,properties:i.properties,bufferViews:n})}function P3e(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,h=c.class,p=r.classes[h],g=new Ou({class:p,count:u,properties:c.properties,bufferViews:n});s.push(g)}}function Gle(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function v3e(e){let t=Gle(e._tileAvailability);e._tileJumpBuffer=t}function w3e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Gle(o);t.push(r)}}ha.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ae("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ha.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ae("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function F3e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function A3e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ha.prototype.getTileMetadataView=function(e){let t=F3e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new h1({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ha.prototype.getContentMetadataView=function(e,t){let n=A3e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new h1({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ha.prototype.isDestroyed=function(){return!1};ha.prototype.destroy=function(){return l(this._bufferLoader)&&Ri.unload(this._bufferLoader),me(this)};var eT=ha;var vvn=T(S(),1),M3e={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},tT=Object.freeze(M3e);var Avn=T(S(),1);var sh={};sh.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:sh.parseBoundingVolumeSemantic("TILE",e),minimumHeight:sh._parseMinimumHeight("TILE",e),maximumHeight:sh._parseMaximumHeight("TILE",e)},content:{boundingVolume:sh.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:sh._parseMinimumHeight("CONTENT",e),maximumHeight:sh._parseMaximumHeight("CONTENT",e)}}};sh.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};sh._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};sh._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var nT=sh;function ol(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(ol.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});ol.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,d=await eT.fromSubtreeJson(n,i,s,a,c),u=new ol(e,t,n);return u._implicitSubtree=d,N3e(u,d),u._ready=!0,u};function N3e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=U3e(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=k3e(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=Q3e(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function k3e(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function U3e(e,t,n,i){let s=Ele(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],d=[],u=e._implicitTileset;for(let h=1;h<u.subtreeLevels;h++){let p=t.getLevelOffset(h),g=u.branchingFactor*c.length;for(let f=0;f<g;f++){let x=p+f;if(!t.tileIsAvailableAtIndex(x)){d.push(void 0);continue}let _=t.getParentMortonIndex(f),C=c[_],V=f%u.branchingFactor,L=Ele(e,t,C,V,x);C.children.push(L),a.numberOfTilesTotal++,d.push(L)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function Ile(e,t,n){let i=tT.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Ele(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d,u;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let I=nT.parseAllBoundingVolumeSemantics(c);d=I.tile,u=I.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let I=0;I<p;I++)if(t.contentIsAvailableAtCoordinates(a,I)){g=!0;break}let f=O3e(s,a,i,r,n,d),x=[];for(let I=0;I<s.contentCount;I++){if(!t.contentIsAvailableAtIndex(o,I))continue;let w={uri:s.contentUriTemplates[I].getDerivedResource({templateValues:a.getTemplateValues()}).url},M=Y3e(f,u);l(M)&&(w.boundingVolume=M),x.push(St(w,s.contentHeaders[I]))}let _=Ile(c,s,a),C={boundingVolume:f,geometricError:_,refine:s.refine,contents:x},V=!0,L=Ye(s.tileHeader,V);delete L.boundingVolume,delete L.transform,delete L.metadata;let R=St(C,L,V),G=wle(e,s.baseResource,R,n);return G.implicitCoordinates=a,G.implicitSubtree=t,G.metadata=c,G.hasImplicitContentMetadata=g,G}function Ak(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(si(e,"3DTILES_bounding_volume_S2")||l(e.region))}function qK(e,t){l(t)&&(si(e,"3DTILES_bounding_volume_S2")?B3e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&D3e(e.region,t.minimumHeight,t.maximumHeight))}function D3e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function B3e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function O3e(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!Ak(r.boundingVolume,r)&&Ak(e.boundingVolume,r)?s=Xle(e,t,n,y(i,!1),o):s=r.boundingVolume,qK(s,r),s}function Y3e(e,t){let n;return l(t)&&(n=t.boundingVolume),Ak(n,t)?qK(n,t):Ak(e,t)&&(n=Ye(e,!0),qK(n,t)),n}function Xle(e,t,n,i,o){let r=e.boundingVolume;return si(r,"3DTILES_bounding_volume_S2")?Wle(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:vle(r.region,t.level,t.x,t.y,t.z)}:{box:Ple(r.box,t.level,t.x,t.y,t.z)}}function Wle(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:eb.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?FC.encode2D(i,o,r):FC.encode2D(i,r,o),u=eb.fromFacePositionLevel(c,BigInt(d),i),h,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:eb.getTokenFromId(u._cellId),minimumHeight:h,maximumHeight:p}}}}var H3e=new m,z3e=new m,jK=new m,K3e=new $;function Ple(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,z3e),s=$.unpack(e,3,K3e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,h=m.fromElements(a,a,1,H3e);l(o)&&(u=-1+(2*o+1)*a,h.z=a);let p=m.fromElements(c,d,u,jK);p=$.multiplyByVector(s,p,jK),p=m.add(p,r,jK);let g=$.clone(s);g=$.multiplyByScale(g,h,g);let f=new Array(12);return m.pack(p,f),$.pack(g,f,3),f}var J3e=new ce;function vle(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,J3e),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),h=W.negativePiToPi(u+d),p=c*r.height,g=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(g+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,g,h,f,x,_]}function Q3e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Xle(i,o,n,!1,t),s=Ile(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=wle(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function wle(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}ol.prototype.hasProperty=function(e,t){return!1};ol.prototype.getFeature=function(e){};ol.prototype.applyDebugSettings=function(e,t){};ol.prototype.applyStyle=function(e){};ol.prototype.update=function(e,t){};ol.prototype.pick=function(e,t,n){};ol.prototype.isDestroyed=function(){return!1};ol.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),me(this)};ol._deriveBoundingBox=Ple;ol._deriveBoundingRegion=vle;ol._deriveBoundingVolumeS2=Wle;var V1=ol;var Fjn=T(S(),1);var nwn=T(S(),1),j3e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Ol=Object.freeze(j3e);var Rjn=T(S(),1);var Rwn=T(S(),1);var swn=T(S(),1);function L1(e,t){this._distance=t,this._normal=new Fle(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(L1.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});L1.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new L1(e.normal,e.distance),t};L1.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new L1(e.normal,e.distance)};function Fle(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(Fle.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var iT=L1;function _c(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this.edgeColor=B.clone(y(e.edgeColor,B.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Ule:Dle,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function Ule(e){return e===Ht.OUTSIDE}function Dle(e){return e===Ht.INSIDE}Object.defineProperties(_c.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Ule:Dle)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function Ale(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}_c.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Ale(n,i)},e.index=t,Ale(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};_c.prototype.get=function(e){return this._planes[e]};function Ble(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}_c.prototype.contains=function(e){return Ble(this._planes,e)!==-1};_c.prototype.remove=function(e){let t=this._planes,n=Ble(t,e);if(n===-1)return!1;e instanceof iT&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof iT&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};_c.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof iT&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var q3e=new se,$3e=new se;function Mle(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=wn.octEncodeToCartesian4(a.normal,$3e);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let d=se.packFloat(a.distance,q3e);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function Nle(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function Ole(e,t){let n=At.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var eYe=new D;_c.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=_c.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Ole(o,eYe);s.y*=2,i?(t=new vt({context:n,width:s.x,height:s.y,pixelFormat:it.RGBA,pixelDatatype:je.FLOAT,sampler:qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new vt({context:n,width:s.x,height:s.y,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(Nle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Mle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),Nle(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),Mle(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var tYe=new A,kle=new sn(m.UNIT_X,0);_c.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=A.multiply(t,o,tYe));let r=Ht.INSIDE;!this.unionClippingRegions&&i>0&&(r=Ht.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,o,kle);let c=e.intersectPlane(kle);if(c===Ht.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};_c.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};_c.useFloatTexture=function(e){return e.floatingPointTexture};_c.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=_c.useFloatTexture(t)?e.length:e.length*2,r=Ole(o,n);return r.y*=2,r};_c.prototype.isDestroyed=function(){return!1};_c.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),me(this)};var fs=_c;var sFn=T(S(),1);var Fwn=T(S(),1);function oT(e){this._ellipsoid=y(e.ellipsoid,ne.default),this._positions=[...e.positions]}Object.defineProperties(oT.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});oT.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new oT({positions:e.positions,ellipsoid:e.ellipsoid})};oT.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};oT.prototype.computeRectangle=function(e){return qp.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var nYe=new ce,Yle=new m;oT.prototype.computeSphericalExtents=function(e){l(e)||(e=new ce);let t=this.computeRectangle(nYe),n=he.toCartesian(ce.southwest(t),this.ellipsoid,Yle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=W.fastApproximateAtan2(i,n.z),r=W.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ce.northeast(t),this.ellipsoid,Yle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=W.fastApproximateAtan2(i,n.z),r=W.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var R1=oT;var Mwn=T(S(),1),xW=`in vec2 v_textureCoordinates;

uniform int u_polygonsLength;
uniform int u_extentsLength;
uniform highp sampler2D u_polygonTexture;
uniform highp sampler2D u_extentsTexture;

int getPolygonIndex(float dimension, vec2 coord) {
   vec2 uv = coord.xy * dimension;
   return int(floor(uv.y) * dimension + floor(uv.x));
}

vec2 getLookupUv(ivec2 dimensions, int i) {
    int pixY = i / dimensions.x;
    int pixX = i - (pixY * dimensions.x);
    float pixelWidth = 1.0 / float(dimensions.x);
    float pixelHeight = 1.0 / float(dimensions.y);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    return vec2(u, v);
}

vec4 getExtents(int i) {
    return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
}

ivec2 getPositionsLengthAndExtentsIndex(int i) {
    vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
    vec4 value = texture(u_polygonTexture, uv);
    return ivec2(int(value.x), int(value.y));
}

vec2 getPolygonPosition(int i) {
    vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
    return texture(u_polygonTexture, uv).xy;
}

vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
    float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
    float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
    return vec2(latitude, longitude);
}

void main() {
    int lastPolygonIndex = 0;
    out_FragColor = vec4(1.0);

    // Get the relevant region of the texture
    float dimension = float(u_extentsLength);
    if (u_extentsLength > 2) {
        dimension = ceil(log2(float(u_extentsLength)));
    }
    int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);

    for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
        ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
        int positionsLength = positionsLengthAndExtents.x;
        int polygonExtentsIndex = positionsLengthAndExtents.y;
        lastPolygonIndex += 1;

         // Only compute signed distance for the relevant part of the atlas
         if (polygonExtentsIndex == regionIndex) {
            float clipAmount = czm_infinity;
            vec4 extents = getExtents(polygonExtentsIndex);
            vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
            vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);
            float s = 1.0;

            // Check each edge for absolute distance
            for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {
                vec2 a = getPolygonPosition(lastPolygonIndex + i);
                vec2 b = getPolygonPosition(lastPolygonIndex + j);
 
                vec2 ab = b - a;
                vec2 pa = p - a;
                float t = dot(pa, ab) / dot(ab, ab);
                t = clamp(t, 0.0, 1.0);

                vec2 pq = pa - t * ab;
                float d = length(pq);

                // Inside / outside computation to determine sign
                bvec3 cond = bvec3(p.y >= a.y, 
                            p.y < b.y, 
                            ab.x * pa.y > ab.y * pa.x);
                if (all(cond) || all(not(cond))) s = -s;
                if (abs(d) < abs(clipAmount)) {
                    clipAmount = d;
                }
            }

            // Normalize the range to [0,1]
            vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
            // In the case where we've iterated through multiple polygons, take the minimum
            out_FragColor = min(out_FragColor, result);
         }

        lastPolygonIndex += positionsLength;
    }
}`;function ns(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new be,this.polygonRemoved=new be,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(ns.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});ns.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};ns.prototype.get=function(e){return this._polygons[e]};ns.prototype.contains=function(e){return this._polygons.some(t=>R1.equals(t,e))};ns.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>R1.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var iYe=new ce;function oYe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ce.clone(a);u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(ce.simpleIntersection(g,u))&&!ce.equals(g,u)){let f=n[p];h.push(...f),f.reduce((x,_)=>ce.union(e[_].computeSphericalExtents(iYe),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ce.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}ns.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function rYe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=oYe(i),s=0;for(let[c,d]of i.entries()){let u=d.length;t[s++]=u,t[s++]=r.get(c);for(let h=0;h<u;++h){let p=d.positions[h],g=Math.hypot(p.x,p.y),f=W.fastApproximateAtan2(g,p.z),x=W.fastApproximateAtan2(p.x,p.y);t[s++]=f,t[s++]=x}}let a=0;for(let c of o){let d=1/(c.east-c.west),u=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=u,n[a++]=d}e._extentsCount=o.length}var $K=new D;ns.prototype.update=function(e){let t=e.context;if(!ns.isSupported(e))throw new ae("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=ns.getTextureResolution(i,this.pixelsNeededForPolygonPositions,$K);i=new vt({context:t,width:s.x,height:s.y,pixelFormat:it.RG,pixelDatatype:je.FLOAT,sampler:qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=ns.getTextureResolution(o,this.pixelsNeededForExtents,$K);o=new vt({context:t,width:s.x,height:s.y,pixelFormat:it.RGBA,pixelDatatype:je.FLOAT,sampler:qt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(rYe(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=ns.getClippingDistanceTextureResolution(this,$K);r=new vt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?it.RED:it.LUMINANCE,pixelDatatype:je.FLOAT,sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=sYe(this)};ns.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function sYe(e){let t=e._polygonsTexture,n=e._extentsTexture;return new wc({fragmentShaderSource:xW,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Hle=new ce,aYe=new ce;ns.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Ht.OUTSIDE;this.inverse&&(o=Ht.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let u=e.boundingVolume.computeCorners();c=ce.fromCartesianArray(u,t,Hle)}l(c)||(c=ce.fromBoundingSphere(e.boundingSphere,t,Hle));let d=ce.simpleIntersection(c,a,aYe);l(d)&&(o=Ht.INTERSECTING)}return o};ns.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ns.isSupported=function(e){return e?.context.webgl2};ns.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=At.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};ns.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(At.maximumTextureSize,4096),t.y=Math.min(At.maximumTextureSize,4096),t)};ns.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):ns.getTextureResolution(n,e.pixelsNeededForExtents,t)};ns.prototype.isDestroyed=function(){return!1};ns.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),me(this)};var ah=ns;var eAn=T(S(),1);var hFn=T(S(),1);var cFn=T(S(),1),_W={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};_W.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?_W.SUNLIGHT:_W.SCENE_LIGHT:_W.NONE};var Lb=Object.freeze(_W);function zle(){this.lightIntensity=10,this.rayleighCoefficient=new m(55e-7,13e-6,284e-7),this.mieCoefficient=new m(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=Lb.NONE}zle.requiresColorCorrect=function(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))};var rT=zle;var pFn=T(S(),1),ch=`uniform vec3 u_radiiAndDynamicAtmosphereColor;

uniform float u_atmosphereLightIntensity;
uniform float u_atmosphereRayleighScaleHeight;
uniform float u_atmosphereMieScaleHeight;
uniform float u_atmosphereMieAnisotropy;
uniform vec3 u_atmosphereRayleighCoefficient;
uniform vec3 u_atmosphereMieCoefficient;

const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

/**
 * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
 * the transmittance value for the ray.
 *
 * @param {czm_ray} primaryRay The ray from the camera to the position.
 * @param {float} primaryRayLength The length of the primary ray.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 * @glslFunction
 */
void computeScattering(
    czm_ray primaryRay,
    float primaryRayLength,
    vec3 lightDirection,
    float atmosphereInnerRadius,
    out vec3 rayleighColor,
    out vec3 mieColor,
    out float opacity
) {

    // Initialize the default scattering amounts to 0.
    rayleighColor = vec3(0.0);
    mieColor = vec3(0.0);
    opacity = 0.0;

    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;

    vec3 origin = vec3(0.0);

    // Calculate intersection from the camera to the outer ring of the atmosphere.
    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);

    // Return empty colors if no intersection with the atmosphere geometry.
    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
        return;
    }

    // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
    // we implement a split strategy: sky or horizon.
    // For performance reasons, instead of a if/else branch
    // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
    float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
    // Value close to 0.0: close to the horizon
    // Value close to 1.0: above in the sky
    float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));

    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
    float start_0 = primaryRayAtmosphereIntersect.start;
    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));

    // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
    // (1) from outer space we have to use more ray steps to get a realistic rendering
    // (2) within atmosphere we need fewer steps for faster rendering
    float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
    float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
    int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
    int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
    float rayPositionLength = primaryRayAtmosphereIntersect.start;
    // (1) Outside the atmosphere: constant rayStepLength
    // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
    float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
    float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
    float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));

    vec3 rayleighAccumulation = vec3(0.0);
    vec3 mieAccumulation = vec3(0.0);
    vec2 opticalDepth = vec2(0.0);
    vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);

    // Sample positions on the primary ray.
    for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {

        // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to break early instead
        if (i >= PRIMARY_STEPS) {
            break;
        }

        // Calculate sample position along viewpoint ray.
        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);

        // Calculate height of sample position above ellipsoid.
        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;

        // Calculate and accumulate density of particles at the sample position.
        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
        opticalDepth += sampleDensity;

        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
        czm_ray lightRay = czm_ray(samplePosition, lightDirection);
        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);

        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
        float lightPositionLength = 0.0;

        vec2 lightOpticalDepth = vec2(0.0);

        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
        for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {

            // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (j >= LIGHT_STEPS) {
                break;
            }

            // Calculate sample position along light ray.
            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);

            // Calculate height of the light sample position above ellipsoid.
            float lightHeight = length(lightPosition) - atmosphereInnerRadius;

            // Calculate density of photons at the light sample position.
            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;

            // Increment distance on light ray.
            lightPositionLength += lightStepLength;
        }

        // Compute attenuation via the primary ray and the light ray.
        vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));

        // Accumulate the scattering.
        rayleighAccumulation += sampleDensity.x * attenuation;
        mieAccumulation += sampleDensity.y * attenuation;

        // Increment distance on primary ray.
        rayPositionLength += (rayStepLength += rayStepLengthIncrease);
    }

    // Compute the scattering amount.
    rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
    mieColor = u_atmosphereMieCoefficient * mieAccumulation;

    // Compute the transmittance i.e. how much light is passing through the atmosphere.
    opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
}

vec4 computeAtmosphereColor(
    vec3 positionWC,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);

    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = u_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;

    return vec4(color, opacity);
}
`;var gFn=T(S(),1),TW=`uniform samplerCube u_radianceMap;

in vec2 v_textureCoordinates;


const float twoSqrtPi = 2.0 * sqrt(czm_pi);

// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
float computeShBasis(int index, vec3 s) {
    if (index == 0) { // l = 0, m = 0
        return 1.0 / twoSqrtPi;
    }
    
    if (index == 1) { // l = 1, m = -1
        return -sqrt(3.0) * s.y / twoSqrtPi;
    }

    if (index == 2) { // l = 1, m = 0
        return sqrt(3.0) * s.z / twoSqrtPi;
    }

    if (index == 3) { // l = 1, m = 1
        return -sqrt(3.0) * s.x / twoSqrtPi;
    }

    if (index == 4) { // l = 2, m = -2
        return sqrt(15.0) * s.y * s.x / twoSqrtPi;
    }

    if (index == 5) { // l = 2, m = -1
        return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
    }

    if (index == 6) { // l = 2, m = 0
        return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
    }

    if (index == 7) { // l = 2, m = 1
        return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
    }

    if (index == 8) { // l = 2, m = 2
        return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
    }

    return 0.0;
}

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
const int samples = 256; 
const float solidAngle = 1.0 / float(samples);

void main() {
    // Get the current coefficient based on the uv
   vec2 uv = v_textureCoordinates.xy * 3.0;
   int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));

    for (int i = 0; i < samples; ++i) {
        vec2 xi = hammersley2D(i, samples);
        float phi = czm_twoPi * xi.x;
        float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
        float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
        vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));

        // Generate the spherical harmonics basis from the direction
        float Ylm = computeShBasis(coefficientIndex, direction);

        vec3 lookupDirection = -direction.xyz;
        lookupDirection.z = -lookupDirection.z;

        vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);

        // Use the relevant function for this coefficient
        out_FragColor += Ylm * color * solidAngle * sinTheta;
    }
    
}
`;var xFn=T(S(),1),SW=`precision highp float;

in vec2 v_textureCoordinates;

uniform vec3 u_faceDirection; // Current cubemap face
uniform vec3 u_positionWC;
uniform mat4 u_enuToFixedFrame;
uniform vec4 u_brightnessSaturationGammaIntensity;
uniform vec4 u_groundColor; // alpha component represent albedo

vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
    vec2 scaledUV = uv * 2.0 - 1.0;

    if (faceDir.x != 0.0) {
        return vec4(faceDir.x,  scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
    } else if (faceDir.y != 0.0) {
        return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
    } else {
        return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); 
    }
}

void main() {    
    float height = length(u_positionWC);
    float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
    float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);

    // Scale the position to ensure the sky color is present, even when underground.
    vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);

    float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
    float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;

    vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
    vec3 normalizedDirection = normalize(direction);

    czm_ray ray = czm_ray(positionWC, normalizedDirection);
    czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
    if (!czm_isEmpty(intersection)) {
        intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
    }

    bool onEllipsoid = intersection.start >= 0.0;
    float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);

    // Compute sky color for each position on a sphere at radius centered around the provided position's origin
    vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;

    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
    vec3 mieColor;
    vec3 rayleighColor;
    float opacity;
    czm_computeScattering(
        ray,
        rayLength,
        lightDirectionWC,
        atmosphereInnerRadius, 
        rayleighColor,
        mieColor,
        opacity
    );

    vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);

#ifdef ATMOSPHERE_COLOR_CORRECT
    const bool ignoreBlackPixels = true;
    atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
#endif

    vec3 lookupDirection = -normalizedDirection;
     // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
    lookupDirection.x = -lookupDirection.x;
    lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
    lookupDirection.x = -lookupDirection.x;

    // Values outside the atmopshere are rendered as black, when they should be treated as transparent
    float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
    skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent

    // Blend starmap with atmopshere scattering
    float intensity = u_brightnessSaturationGammaIntensity.w;
    vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
    vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
    vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);

    // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
    vec3 up = normalize(positionWC);
    float occlusion = max(dot(lightDirectionWC, up), 0.05);
    vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
    vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));

    vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);

    float brightness = u_brightnessSaturationGammaIntensity.x;
    float saturation = u_brightnessSaturationGammaIntensity.y;
    float gamma = u_brightnessSaturationGammaIntensity.z;

#ifdef ENVIRONMENT_COLOR_CORRECT
    color.rgb = mix(vec3(0.0), color.rgb, brightness);
    color.rgb = czm_saturation(color.rgb, saturation);
#endif
    color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0.
    color.rgb = czm_gammaCorrect(color.rgb);

    out_FragColor = color;
}
`;var TFn=T(S(),1),CW=`precision highp float;

in vec3 v_textureCoordinates;

uniform float u_roughness;
uniform samplerCube u_radianceTexture;
uniform vec3 u_faceDirection;

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float phi = czm_twoPi * xi.x;
    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
    vec3 tangentX = normalize(cross(upVector, N));
    vec3 tangentY = cross(N, tangentX);
    return tangentX * H.x + tangentY * H.y + N * H.z;
}

// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
const int samples = 128;

void main() {
    vec3 normal = u_faceDirection;
    vec3 V = normalize(v_textureCoordinates);
    float roughness = u_roughness;

    vec4 color = vec4(0.0);
    float weight = 0.0;
    for (int i = 0; i < samples; ++i) {
            vec2 xi = hammersley2D(i, samples);
            vec3 H = importanceSampleGGX(xi, roughness, V);
            vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector

            float NdotL = max(dot(V, L), 0.0);
            if (NdotL > 0.0) {
                color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL;
                weight += NdotL;
            }
        }
    out_FragColor = color / weight;
}
`;var CFn=T(S(),1),VW=`in vec3 position;
out vec3 v_textureCoordinates;

uniform vec3 u_faceDirection;

vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
    vec2 scaledUV = uv;

    if (faceDir.x != 0.0) {
        return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
    } else if (faceDir.y != 0.0) {
        return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
    } else {
        return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); 
    }
}

void main() 
{
    v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
    v_textureCoordinates.y = -v_textureCoordinates.y;
    v_textureCoordinates.z = -v_textureCoordinates.z;
    gl_Position = vec4(position, 1.0);
}
`;function $n(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=y(e,y.EMPTY_OBJECT);let t=Math.min(y(e.mipmapLevels,7),Math.log2(At.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=$n.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new q;let n=Math.pow(2,t-1);this._textureDimensions=new D(n,n),this._radiiAndDynamicAtmosphereColor=new m,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,$n.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties($n.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){m.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=m.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});$n._maximumComputeCommandCount=8;$n._activeComputeCommandCount=0;$n._nextFrameCommandQueue=[];$n._queueCommand=(e,t)=>{if($n._activeComputeCommandCount>=$n._maximumComputeCommandCount){$n._nextFrameCommandQueue.push(e);return}t.commandList.push(e),$n._activeComputeCommandCount++};$n._updateCommandQueue=e=>{if($n._maximumComputeCommandCount=Math.log2(At.maximumCubeMapSize),$n._nextFrameCommandQueue.length>0&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount){let t=$n._nextFrameCommandQueue.shift();for(;l(t)&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=$n._nextFrameCommandQueue.shift();continue}e.commandList.push(t),$n._activeComputeCommandCount++,t=$n._nextFrameCommandQueue.shift()}l(t)&&$n._nextFrameCommandQueue.push(t)}};$n.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};$n.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var cYe=new m,lYe=new m;function dYe(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,lYe),s=1.025,a=cYe,c=l(r)?m.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!m.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(m.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Kle=new m,uYe=new A,mYe=new se,hYe=new B;function fYe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new xr({context:n,width:i.x,height:i.y,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:it.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new De({sources:[ch,SW]}),e._radianceMapFS=o),rT.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Pt.eastNorthUpToFixedFrame(r,a,uYe),d=mYe;d.x=e.brightness,d.y=e.saturation,d.z=e.gamma,d.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let u=0;for(let h of xr.faceNames()){let p=e._radianceMapTextures[u];l(p)&&!p.isDestroyed()&&p.destroy(),p=new vt({context:n,width:i.x,height:i.y,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:it.RGBA}),e._radianceMapTextures[u]=p;let g=u,f=new wc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>xr.getDirection(h,Kle),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,hYe)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){$n._activeComputeCommandCount--;return}let x=e._radianceMapComputeCommands;x[g]=void 0;let _=new Wr({context:n,colorTextures:[e._radianceMapTextures[g]]});_._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),_._unBind(),_.destroy(),$n._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,$n._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function pYe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=(h,p,g,f,x)=>()=>{if(e.isDestroyed()||h.canceled){$n._activeComputeCommandCount--;return}let _=e._convolutionComputeCommands;_[p]=void 0,n.copyFace(t,g,f,x),c++,$n._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let C=e._specularMapTextures.length;c>=C&&(e._irradianceCommandDirty=!0,n.sampler=new qt({minificationFilter:jt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},u=0;for(let h=1;h<i;++h){for(let p of xr.faceNames()){l(e._specularMapTextures[u])&&e._specularMapTextures[u].destroy();let g=e._specularMapTextures[u]=new vt({context:a,width:r,height:s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:it.RGBA}),f=e._va;l(f)||(f=xr.createVertexArray(a,p),e._va=f);let x=e._convolveSP;l(x)||(x=$t.fromCache({context:a,vertexShaderSource:VW,fragmentShaderSource:CW,attributeLocations:{positions:0}}),e._convolveSP=x);let _=new wc({shaderProgram:x,vertexArray:f,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>xr.getDirection(p,Kle)}});_.postExecute=d(_,u,g,p,h),e._convolutionComputeCommands[u]=_,$n._queueCommand(_,t),++u}r/=2,s/=2}}var Jle=new D(3,3);function bYe(e,t){let n=t.context,i=Jle,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new vt({context:n,width:i.x,height:i.y,pixelDatatype:je.FLOAT,pixelFormat:it.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new De({sources:[TW]}),e._irradianceMapFS=r);let s=new wc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){$n._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,$n._activeComputeCommandCount--},e._irradianceComputeCommand=s,$n._queueCommand(s,t),e._irradianceTextureDirty=!0}function gYe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Wr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Jle,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=m.unpack(r,s*4),m.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}$n.prototype.update=function(e){let t=e.mode;if(!$n.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}$n._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=dYe(this,e)||i===Lb.SUNLIGHT&&!q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(fYe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(pYe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(bYe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){gYe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};$n.prototype.isDestroyed=function(){return!1};$n.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),me(this)};$n.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};$n.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(B.fromCssColorString("#717145"));$n.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new m(.35449,.35449,.35449)),m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO]);var Rb=$n;var iAn=T(S(),1);var LW={HIGHLIGHT:0,REPLACE:1,MIX:2};LW.getColorBlend=function(e,t){if(e===LW.HIGHLIGHT)return 0;if(e===LW.REPLACE)return 1;if(e===LW.MIX)return W.clamp(t,W.EPSILON4,1)};var Tc=Object.freeze(LW);var aNn=T(S(),1);var m9n=T(S(),1);var KAn=T(S(),1);var hAn=T(S(),1);var cAn=T(S(),1);var Qle={};function RW(e){this._count=e.count,this._properties=Ye(e.properties,!0)}RW.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,Qle)};RW.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,Qle,e)};RW.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};RW.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var Zb=RW;function Sc(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Sc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Sc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Sc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Sc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Sc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var eJ=[];Sc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(eJ)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,eJ)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(eJ)),t};Sc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};Sc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new Zb({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Sc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Sc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Sc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Sc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Sc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Sc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Sc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var rl=Sc;var RAn=T(S(),1);var TAn=T(S(),1);function ZW(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Dl.createModelTextureReader({textureInfo:r,channels:_Ye(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,d=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(ZW.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});ZW.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(_t(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(_t(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==ct.SCALAR?(_t(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Ft.UINT8?(_t(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:ct.isVectorType(t)||t===ct.SCALAR?n!==Ft.UINT8?(_t(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(_t(`Property texture property ${e.id} has an unsupported type`),!1)};var yYe=[void 0,"float","vec2","vec3","vec4"],xYe=[void 0,"int","ivec2","ivec3","ivec4"];ZW.prototype.getGlslType=function(){let e=this._classProperty,t=ct.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?yYe[t]:xYe[t]};ZW.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function _Ye(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var GW=ZW;function tJ(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new GW({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(tJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});tJ.prototype.getProperty=function(e){return this._properties[e]};var Gb=tJ;var wAn=T(S(),1);var IAn=T(S(),1);function jle(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(jle.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var EW=jle;function nJ(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new EW({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(nJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});nJ.prototype.getProperty=function(e){return this._properties[e]};var sT=nJ;var NAn=T(S(),1);function IW(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(IW.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});IW.prototype.getPropertyTable=function(e){return this._propertyTables[e]};IW.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};IW.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Hs=IW;function TYe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],d=new Ou({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new rl({id:s,name:a.name,count:a.count,metadataTable:d,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new Gb({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new sT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Hs({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var XW=TYe;var i9n=T(S(),1);function SYe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],d=n.classes[c.class],u=new Ou({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new rl({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new Gb({id:a,propertyTexture:CYe(c),class:n.classes[c.class],textures:e.textures}))}return new Hs({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function CYe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:VYe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=St(o.texture,r,!0)}return t}function VYe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var WW=SYe;function Dg(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:d=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=d,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Dg.prototype=Object.create(Ki.prototype),Dg.prototype.constructor=Dg);Object.defineProperties(Dg.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function LYe(e){try{let t=IYe(e),n=wYe(e),i=FYe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=yt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load structural metadata",t)}}Dg.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=LYe(this),this._promise)};function RYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function ZYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function GYe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];RYe(o.properties,n)}return n}function EYe(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&ZYe(r,n)}}return n}async function IYe(e){let t;l(e._extension)?t=GYe(e._extension):t=EYe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ri.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function XYe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&WYe(r,t)}return t}function WYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function PYe(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&vYe(r,t)}}return t}function vYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function wYe(e){let t;l(e._extension)?t=XYe(e._extension):t=PYe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Ri.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),c.push(u.load())}return Promise.all(c)}async function FYe(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ri.getSchemaLoader({resource:i})}else n=Ri.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Dg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let d=t[a].process(e);i=i&&d}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],d=this._bufferViewLoaders[a];if(!d.isDestroyed()){let u=new Uint8Array(d.typedArray);r[c]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],d=t[a];d.isDestroyed()||(s[c]=d.texture)}return l(this._extension)?this._structuralMetadata=XW({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=WW({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),qle(this),this._state=yt.READY,!0};function qle(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function AYe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Dg.prototype.unload=function(){qle(this),AYe(this),l(this._schemaLoader)&&Ri.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var PW=Dg;var f9n=T(S(),1);var Z1={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};Z1.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return Z1.TRANSLATION;case"ROTATION":return Z1.ROTATION;case"SCALE":return Z1.SCALE;case"_FEATURE_ID":return Z1.FEATURE_ID}};var is=Object.freeze(Z1);var w9n=T(S(),1);var L9n=T(S(),1);var MYe=65534,NYe=255;function Mk(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new tde(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],kYe(this)}Object.defineProperties(Mk.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function kYe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],d=t[a+1],u=t[a+2],h=!1,p=h||n.hasEdge(c,d),g=h||n.hasEdge(d,u),f=h||n.hasEdge(u,c),x=$le(i,c,d,u,p,g,f);for(;l(x);){let _=s[x];if(!l(_)){_=r+o.length;let C=x;for(;C>=r;)C=o[C-r];o.push(C),s[x]=_}_>MYe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>NYe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),x=$le(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function $le(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=iJ(e,t,a,c,d);if(u===0)return t;let h=0,p=o?1:0,g=r?1:0,f=iJ(e,n,h,p,g);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=iJ(e,i,x,_,C);if(V===0)return i;let L=u&f&V,R,G,I;if(L&1)R=0,G=1,I=2;else if(L&2)R=0,I=1,G=2;else if(L&4)G=0,R=1,I=2;else if(L&8)G=0,I=1,R=2;else if(L&16)I=0,R=1,G=2;else if(L&32)I=0,G=1,R=2;else{let M=oJ(u),b=oJ(f),Z=oJ(V);return M<b&&M<Z?t:b<Z?n:i}let v=t*3;e[v+R]=a,e[v+G]=c,e[v+I]=d;let P=n*3;e[P+R]=h,e[P+G]=p,e[P+I]=g;let w=i*3;e[w+R]=x,e[w+G]=_,e[w+I]=C}function iJ(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function oJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}Mk.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[c+u]}return s};Mk.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,At.maximumTextureSize),i=n,o=ede(i),r=[];for(;i>1;)i>>=1,r.push(ede(i));let s=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:it.LUMINANCE,sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR_MIPMAP_LINEAR,magnificationFilter:hi.LINEAR})});return t.outlineTexture=s,s};function ede(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function tde(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}tde.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var aT=Mk;function nde(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function UYe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function Nk(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}Nk.prototype.postProcess=function(e){this.needsOutlines&&(DYe(this),OYe(this,e))};function DYe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new aT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ae.fromTypedArray(n.typedArray);let r=BYe(o.outlineCoordinates),s=new nde(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let d=0;d<c;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function BYe(e){let t=new Sn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Q.FLOAT,t.type=on.VEC3,t.normalized=!1,t.count=e.length/3,t}function OYe(e,t){YYe(e.attributePlans,t),l(e.indicesPlan)&&HYe(e.indicesPlan,t)}function YYe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=xt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function HYe(e,t){let n=e.indices;if(e.loadBuffer){let i=xt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}Nk.AttributeLoadPlan=nde;Nk.IndicesLoadPlan=UYe;var cT=Nk;var M9n=T(S(),1);function zYe(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var vW=zYe;var aMn=T(S(),1);var k9n=T(S(),1);function ide(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(ide.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var wW=ide;var D9n=T(S(),1);function ode(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(ode.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var FW=ode;var O9n=T(S(),1);function rde(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(rde.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var AW=rde;var K9n=T(S(),1);var H9n=T(S(),1),KYe={Direct:"Direct",Indirect:"Indirect"},Bg=Object.freeze(KYe);function sde(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(sde.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var G1=sde;var Q9n=T(S(),1);function ade(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(ade.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var MW=ade;function E1(){}function cde(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function JYe(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m);return new wW({position:t,adjustmentParams:n})}function QYe(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m),i=cde(e.covarianceMatrix);return new FW({position:t,adjustmentParams:n,covarianceMatrix:i})}function jYe(e){let t=e.groupFlags,n=m.fromArray(e.rotationThetas,0,new m),i=[];for(let r of e.params){let s=new MW({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new AW({groupFlags:t,rotationThetas:n,params:i})}E1.load=function(e){let t=e.storageType;if(t===Bg.Direct)return E1.loadDirect(e);if(t===Bg.Indirect)return E1.loadIndirect(e);throw new ae(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};E1.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=JYe(r);t.push(s)}let i=cde(e.covarianceDirectUpperTriangle);return new G1({storageType:Bg.Direct,anchorPointsDirect:t,covarianceDirect:i})};E1.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=QYe(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=jYe(s);o.push(a)}return new G1({storageType:Bg.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var NW=E1;var RMn=T(S(),1);var lMn=T(S(),1);function lde(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(lde.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var kW=lde;var uMn=T(S(),1);function dde(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(dde.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var UW=dde;var hMn=T(S(),1);function ude(e){this._ppeTextures=e}Object.defineProperties(ude.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var DW=ude;function Vr(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Vr.prototype=Object.create(Ki.prototype),Vr.prototype.constructor=Vr);Object.defineProperties(Vr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Vr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=yt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=yt.FAILED,this.getError("Failed to load GPM data",e)}};Vr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=this._loadResources(this),this._promise)};function qYe(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}Vr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=qYe(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let d=Ri.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(d),this._textureIds.push(c),a.push(d.load())}return Promise.all(a)};Vr.ppeTexturesMetadataSchemaCache=new Map;Vr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};Vr._obtainPpeTexturesMetadataSchema=function(e){let n=Vr._collectPpeTexturePropertyIdentifiers(e).toString(),i=Vr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Vr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],d=`ppeTexture_${a}`,u=Vr._createPpeTextureClassJson(c,a);r.classes[d]=u}return i=Xd.fromJson(r),Vr.ppeTexturesMetadataSchemaCache.set(n,i),i};Vr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Vr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Vr._convertToStructuralMetadata=function(e,t){let n=[],i=Vr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,u=a.traits.source,h=i.classes[c],p={class:c,properties:{[u]:{index:a.index,texCoord:a.texCoord}}};n.push(new Gb({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new Hs({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Vr.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let d=0;d<n;++d){let h=t[d].process(e);i=i&&h}if(!i)return!1;let o={};for(let d=0;d<this._textureIds.length;++d){let u=this._textureIds[d],h=t[d];h.isDestroyed()||(o[u]=h.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let d=s.ppeTextures;for(let u of d){let h=u.traits,p=new UW({min:h.min,max:h.max,source:h.source}),g=new kW({traits:p,noData:u.noData,offset:u.offset,scale:u.scale,index:u.index,texCoord:u.texCoord});r.push(g)}}let a=new DW(r);this._meshPrimitiveGpmLocal=a;let c=Vr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=yt.READY,!0};Vr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ri.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Vr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var BW=Vr;var{Attribute:$Ye,Indices:eHe,FeatureIdAttribute:mde,FeatureIdTexture:hde,FeatureIdImplicitRange:fde,MorphTarget:tHe,Primitive:nHe,Instances:iHe,Skin:oHe,Node:rHe,AnimatedPropertyType:sHe,AnimationSampler:aHe,AnimationTarget:cHe,AnimationChannel:lHe,Animation:dHe,ArticulationStage:uHe,Articulation:mHe,Asset:hHe,Scene:fHe,Components:pHe,MetallicRoughness:bHe,SpecularGlossiness:gHe,Specular:yHe,Anisotropy:rJ,Clearcoat:sJ,Material:xHe}=Sn,vo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function lh(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Po.Y,forwardAxis:a=Po.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:d=!1,enablePick:u=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:f=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=d,this._enablePick=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=f,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=vo.NOT_LOADED,this._textureState=vo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(lh.prototype=Object.create(Ki.prototype),lh.prototype.constructor=lh);Object.defineProperties(lh.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function _He(e){e._state=vo.LOADING,e._textureState=vo.LOADING;try{let t=Ri.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=vo.LOADED,e._textureState=vo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=vo.FAILED,e._textureState=vo.FAILED,kk(e,t)}}async function THe(e,t){Bt.supportsWebP.initialized||await Bt.supportsWebP.initialize(),e._supportedImageFormats=new vW({webp:Bt.supportsWebP(),basis:t.context.supportsBasis});let n=Vze(e,t);return e._state=vo.PROCESSING,e._textureState=vo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ri.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}lh.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=_He(this),this._promise)};function kk(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function SHe(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&_t("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=vo.POST_PROCESSING)}function CHe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&VHe(e,o)}}function VHe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}lh.prototype._process=function(e){return this._state===vo.READY?!0:(this._state===vo.PROCESSING&&SHe(this,e),this._resourcesLoaded&&this._state===vo.POST_PROCESSING&&(CHe(this,e.context),this._state=vo.PROCESSED),this._resourcesLoaded&&this._state===vo.PROCESSED?(Cde(this),this._typedArray=void 0,this._state=vo.READY,!0):!1)};lh.prototype._processTextures=function(e){if(this._textureState===vo.READY)return!0;if(this._textureState!==vo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=vo.READY,this._texturesLoaded=!0,!0):!1};lh.prototype.process=function(e){if(this._state===vo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=THe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=vo.FAILED;let o=this._processError;this._processError=void 0,kk(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===vo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=vo.FAILED,kk(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=vo.FAILED,kk(this,o)}return this._incrementallyLoadTextures?n:n&&i};function LHe(e,t,n,i,o,r,s,a){let c=e.gltfJson,u=c.accessors[t].bufferView;return Ri.getVertexBufferLoader({gltf:c,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function RHe(e,t,n,i,o,r,s){return Ri.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function ZHe(e,t){let n=Ri.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function pde(e,t,n){let i=t.byteOffset,o=Ul(e,t),r=t.count,s=Id(t.type),a=t.componentType,c=Q.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let h=Q.createTypedArray(a,u),p=new DataView(n.buffer),g=new Array(s),f=Vb(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){f(p,i,s,c,g);for(let _=0;_<s;++_)h[x*s+_]=g[_];i+=o}return h}function GHe(e,t){let n=e.type;if(n===on.SCALAR)return t.fill(0);let i=on.getMathType(n);return t.fill(i.clone(i.ZERO))}function EHe(e,t,n,i){let o=e.type,r=e.count;if(o===on.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===on.VEC4&&i)for(let s=0;s<r;s++)n[s]=ve.unpack(t,s*4);else{let s=on.getMathType(o),a=on.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function IHe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=pde(r,n,t.typedArray);i=y(i,!1),EHe(n,s,o,i)}function Uk(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=ZHe(e,o),s=IHe(e,r,t,n,i);return e._loaderPromises.push(s),i}return GHe(t,i)}function Wd(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function XHe(e){return e===Number?0:new e}function WHe(e){switch(e){case Q.BYTE:return 127;case Q.UNSIGNED_BYTE:return 255;case Q.SHORT:return 32767;case Q.UNSIGNED_SHORT:return 65535;default:return 1}}var PHe={VEC2:new D(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function vHe(e,t){let n=WHe(e.componentDatatype),i=PHe[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function wHe(e,t,n){let i=e.decodeMatrix,o=Wd(n,e.decodedMin),r=Wd(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Sn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new D(i[6],i[7]),s.quantizedVolumeStepSize=new D(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function FHe(e,t,n,i,o){let r=e.accessors[t],s=on.getMathType(r.type),a=y(r.normalized,!1),c=new $Ye;c.name=n,c.semantic=i,c.setIndex=o,c.constant=XHe(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=Wd(s,r.min),c.max=Wd(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Ul(e,r),si(r,"WEB3D_quantized_attributes")&&wHe(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===ft.POSITION||c.semantic===ft.NORMAL||c.semantic===ft.TANGENT||c.semantic===ft.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&vHe(c,s),c}function bde(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var AHe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function aJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=AHe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function MHe(e){let t=e===ft.POSITION,n=e===ft.FEATURE_ID,i=e===ft.TEXCOORD;return t||n||i}function NHe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Q.createArrayBufferView(o,t.typedArray.buffer)}}function kHe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=pde(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function gde(e,t,n,i,o,r,s,a){let c=e.gltfJson,d=c.accessors[t],u=d.bufferView,h=n.gltfSemantic,p=n.renamedSemantic,g=n.modelSemantic,f=l(g)?bde(p):void 0,_=FHe(c,t,h,g,f);if(!l(o)&&!l(u))return _;let C=LHe(e,t,h,i,o,r,s,a),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();return e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[h])?NHe(_,C,r,s):kHe(c,d,_,C,r,s)},_}function yde(e,t,n,i,o,r,s,a){let c=n.modelSemantic,d=c===ft.POSITION,u=c===ft.FEATURE_ID,h=d&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=d&&e._enablePick&&!a.context.webgl2,g=e._loadForClassification&&u,f=e._loadAttributesAsTypedArray,x=!f,_=f||h||p||g,L=gde(e,t,n,i,o,s?!1:x,s?!0:_,a),R=new cT.AttributeLoadPlan(L);return R.loadBuffer=x,R.loadTypedArray=_,R}function UHe(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=aJ(e,is,i),d=c.modelSemantic,u=d===is.TRANSLATION||d===is.ROTATION||d===is.SCALE,h=d===is.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return gde(e,t,c,void 0,void 0,f,p||h&&(!a||x||g),o)}function DHe(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],c=a.bufferView;if(!l(i)&&!l(c))return;let d=new eHe;d.count=a.count;let u=e._loadAttributesAsTypedArray,h=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,f=!u,x=u||h||p,V=RHe(e,t,n,i,r?!1:f,r?!0:x,s),L=e._geometryLoaders.length;e._geometryLoaders.push(V);let R=V.load();e._loaderPromises.push(R),e._geometryCallbacks[L]=()=>{d.indexDatatype=V.indexDatatype,d.buffer=V.buffer,d.typedArray=V.typedArray};let G=new cT.IndicesLoadPlan(d);return G.loadBuffer=f,G.loadTypedArray=x,G}function sl(e,t,n,i){let o=e.gltfJson,r=Dl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Ri.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Dl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=vo.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function BHe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new gHe;return l(i)&&(c.diffuseTexture=sl(e,i,n)),l(o)&&(c.specularGlossinessTexture=sl(e,o,n)),c.diffuseFactor=Wd(se,r),c.specularFactor=Wd(m,s),c.glossinessFactor=a,c}function OHe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new bHe;return l(i)&&(c.baseColorTexture=sl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=sl(e,o,n)),c.baseColorFactor=Wd(se,r),c.metallicFactor=s,c.roughnessFactor=a,c}function YHe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new yHe;return l(o)&&(a.specularTexture=sl(e,o,n)),l(s)&&(a.specularColorTexture=sl(e,s,n)),a.specularFactor=i,a.specularColorFactor=Wd(m,r),a}function HHe(e,t,n){let{anisotropyStrength:i=rJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=rJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new rJ;return l(r)&&(s.anisotropyTexture=sl(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function zHe(e,t,n){let{clearcoatFactor:i=sJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=sJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new sJ;return l(o)&&(c.clearcoatTexture=sl(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=sl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=sl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function KHe(e,t,n){let i=new xHe,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=BHe(e,r,n):(l(d)&&(i.metallicRoughness=OHe(e,d,n)),l(s)&&!i.unlit&&(i.specular=YHe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=HHe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=zHe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=sl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=sl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=sl(e,t.occlusionTexture,n)),i.emissiveFactor=Wd(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function xde(e,t){let n=new mde;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function _de(e,t,n,i){let o=new mde,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=bde(r.attribute),o.positionalLabel=i,o}function Tde(e,t){let n=new fde;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Sde(e,t,n,i){let o=new fde,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function JHe(e,t,n,i){let o=new hde;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=sl(e,r,n,qt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function QHe(e,t,n,i,o,r){let s=new hde,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=sl(e,c,i,qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function jHe(e,t,n,i,o){let r=new tHe,s=void 0,a=void 0,c=!1;for(let d in t){if(!t.hasOwnProperty(d))continue;let u=t[d],h=aJ(e,ft,d),p=yde(e,u,h,s,a,c,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function qHe(e,t,n,i){let o=new nHe,r=new cT(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=KHe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=$He(e,d,r));let u=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let G in g){if(!g.hasOwnProperty(G))continue;let I=g[G],v=aJ(e,ft,G),P=v.modelSemantic;if(u&&!MHe(P))continue;P===ft.FEATURE_ID&&(p=!0);let w=yde(e,I,v,t,h,n,c,i);r.attributePlans.push(w),o.attributes.push(w.attribute)}let f=t.targets;if(l(f)&&!u)for(let G=0;G<f.length;++G)o.morphTargets.push(jHe(e,f[G],c,r,i));let x=t.indices;if(l(x)){let G=DHe(e,x,t,h,p,c,i);l(G)&&(r.indicesPlan=G,o.indices=G.indices)}let _=a.EXT_structural_metadata,C=a.EXT_mesh_features,V=a.EXT_feature_metadata,L=l(V);l(C)?eze(e,o,C,i):L&&tze(e,o,V,i),l(_)?nze(o,_):L&&ize(e,o,V);let R=t.mode;if(u&&R!==we.TRIANGLES)throw new ae("Only triangle meshes can be used for classification.");return o.primitiveType=R,o}function $He(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return Uk(e,i,!1)}function eze(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=JHe(e,s,i,a):l(s.attribute)?c=xde(s,a):c=Tde(s,a),t.featureIds.push(c)}}function tze(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let d=s[c],u=d.featureTable,h=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f;l(d.featureIds.attribute)?f=_de(d,h,p,g):f=Sde(d,h,p,g),t.featureIds.push(f)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let d=a[c],u=d.featureTable,h=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f=QHe(e,d,h,i,p,g);t.featureIds.push(f)}}function nze(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function ize(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function oze(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new iHe,r=i.attributes;if(l(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(UHe(e,u,r,d,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?rze(o,a):l(c)&&sze(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function rze(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=xde(o,r):s=Tde(o,r),e.featureIds.push(s)}}function sze(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,d=i.indexOf(c),u=o[c].count,h=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=_de(a,d,u,h):p=Sde(a,d,u,h),t.featureIds.push(p)}}function aze(e,t,n){let i=new rHe;i.name=t.name,i.matrix=Wd(A,t.matrix),i.translation=Wd(m,t.translation),i.rotation=Wd(ve,t.rotation),i.scale=Wd(m,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new ae("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=oze(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],d=c.primitives;for(let p=0;p<d.length;++p)i.primitives.push(qHe(e,d[p],l(i.instances),n));let u=y(t.weights,c.weights),h=i.primitives[0].morphTargets;i.morphWeights=l(u)?u.slice():new Array(h.length).fill(0)}return i}function cze(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=aze(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function lze(e,t,n){let i=new oHe,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=Uk(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(A.IDENTITY);return i}function dze(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=lze(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function uze(e,t,n,i){let o=new PW({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function mze(e,t,n,i){let o=new BW({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function hze(e,t){let n=new aHe,i=e.gltfJson.accessors,o=i[t.input];n.input=Uk(e,o);let r=t.interpolation;n.interpolation=y(Ym[r],Ym.LINEAR);let s=i[t.output];return n.output=Uk(e,s,!0),n}function fze(e,t){let n=new cHe,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=sHe[o],n}function pze(e,t,n){let i=new lHe,o=e.sampler;return i.sampler=t[o],i.target=fze(e.target,n),i}function bze(e,t,n){let i=new dHe;i.name=t.name;let o=t.samplers.map(function(s,a){let c=hze(e,s);return c.index=a,c}),r=t.channels.map(function(s){return pze(s,o,n)});return i.samplers=o,i.channels=r,i}function gze(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=bze(e,o,t);return s.index=r,s})}function yze(e){let t=new uHe;t.name=e.name;let n=e.type.toUpperCase();return t.type=ac[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function xze(e){let t=new mHe;return t.name=e.name,t.stages=e.stages.map(yze),t}function _ze(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(xze):[]}function Tze(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function Sze(e,t){let n=new fHe,i=Tze(e);return n.nodes=i.map(function(o){return t[o]}),n}var Cze=new m;function Vze(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let V=r.featureTables,L=r.featureTextures,R=l(V)?V:[],G=l(L)?L:[];e._sortedPropertyTableIds=Object.keys(R).sort(),e._sortedFeatureTextureIds=Object.keys(G).sort()}let a=cze(e,t),c=dze(e,a),d=gze(e,a),u=_ze(n),h=Sze(n,a),p=new pHe,g=new hHe,f=n.asset.copyright;if(l(f)){let V=f.split(";").map(function(L){return new Ct(L.trim())});g.credits=V}if(p.asset=g,p.scene=h,p.nodes=a,p.skins=c,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let V=m.fromArray(s.center,0,Cze);p.transform=A.fromTranslation(V,p.transform)}if(e._components=p,l(o)||l(r)){let V=uze(e,o,r,t);e._loaderPromises.push(V)}let x=i.NGA_gpm_local;if(l(x)){let V=NW.load(x);e._components.extensions.NGA_gpm_local=V}let _=n.meshes;if(l(_))for(let V of _){let L=V.primitives;if(l(L))for(let R of L){let G=R.extensions;if(l(G)){let I=G.NGA_gpm_local;if(l(I)){let v=mze(e,n,I,t);e._loaderPromises.push(v)}}}}let C=[];return C.push.apply(C,e._loaderPromises),e._incrementallyLoadTextures||C.push.apply(C,e._texturesPromises),Promise.all(C)}function Lze(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._textureLoaders.length=0}function Cde(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._bufferViewLoaders.length=0}function Rze(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._geometryLoaders.length=0}function Zze(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function Gze(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Eze(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}lh.prototype.isUnloaded=function(){return this._state===vo.UNLOADED};lh.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ri.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Lze(this),Cde(this),Rze(this),Zze(this),Gze(this),Eze(this),this._components=void 0,this._typedArray=void 0,this._state=vo.UNLOADED};var dh=lh;var ENn=T(S(),1);var LNn=T(S(),1);var lNn=T(S(),1),OW=`uniform sampler2D u_pointCloud_colorGBuffer;
uniform sampler2D u_pointCloud_depthGBuffer;
uniform vec2 u_distanceAndEdlStrength;
in vec2 v_textureCoordinates;

vec2 neighborContribution(float log2Depth, vec2 offset)
{
    float dist = u_distanceAndEdlStrength.x;
    vec2 texCoordOrig = v_textureCoordinates + offset * dist;
    vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
    vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);

    float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
    float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));

    // ignore depth values that are the clear depth
    if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
        return vec2(0.0);
    }

    // interpolate the two adjacent depth values
    float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
    return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
}

void main()
{
    float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float log2Depth = log2(-eyeCoordinate.z);

    if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
    {
        discard;
    }

    vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);

    // sample from neighbors left, right, down, up
    vec2 texelSize = 1.0 / czm_viewport.zw;

    vec2 responseAndCount = vec2(0.0);

    responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
    responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
    responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
    responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));

    float response = responseAndCount.x / responseAndCount.y;
    float strength = u_distanceAndEdlStrength.y;
    float shade = exp(-response * 300.0 * strength);
    color.rgb *= shade;
    out_FragColor = vec4(color);

    // Input and output depth are the same.
    gl_FragDepth = depthOrLogDepth;
}
`;function I1(){this._framebuffer=new fi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(I1.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function Ize(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var cJ=new D;function Xze(e,t){let n=new De({defines:["LOG_DEPTH_WRITE"],sources:[OW]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return cJ.x=e._radius,cJ.y=e._strength,cJ}},o=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Ee.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ti({framebuffer:e.framebuffer,color:new B(0,0,0,0),depth:1,renderState:Ue.fromCache(),pass:Ee.CESIUM_3D_TILE,owner:e})}function Wze(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Xze(e,t)}function Vde(e){return e.drawBuffers&&e.fragmentDepth}I1.isSupported=Vde;function Pze(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=De.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() 
{ 
    czm_point_cloud_post_process_main(); 
#ifdef LOG_DEPTH
    czm_writeLogDepth();
    out_FragData_1 = czm_packDepth(gl_FragDepth); 
#else
    out_FragData_1 = czm_packDepth(gl_FragCoord.z);
#endif
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}I1.prototype.update=function(e,t,n,i){if(!Vde(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Wze(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==we.POINTS||d.pass===Ee.TRANSLUCENT)continue;let u,h,p=d.derivedCommands.pointCloudProcessor;l(p)&&(u=p.command,h=p.originalShaderProgram),(!l(u)||d.dirty||h!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=$e.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=Pze(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,l(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};I1.prototype.isDestroyed=function(){return!1};I1.prototype.destroy=function(){return Ize(this),me(this)};var Eb=I1;function Lde(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Lde.isSupported=function(e){return Eb.isSupported(e.context)};var Pf=Lde;var BNn=T(S(),1);var Na={},vze=new se(0,0,0,1),Cc=new se,wze=new Ke,lJ=new D,dJ=new D;Na.worldToWindowCoordinates=function(e,t,n){return Na.worldWithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var Rde=new se,Zde=new m;function YW(e,t,n,i){let o=n.viewMatrix,r=A.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,Rde),Rde),s=m.multiplyComponents(t,m.normalize(r,Zde),Zde);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,A.multiplyByVector(n.frustum.projectionMatrix,r,i)}var Fze=new he(Math.PI,W.PI_OVER_TWO),Aze=new m,Mze=new m;Na.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Na.computeActualEllipsoidPosition(o,t,vze);if(!l(r))return;let s=e.canvas,a=wze;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===oe.SCENE2D){let u=e.mapProjection,h=Fze,p=u.project(h,Aze),g=m.clone(c.position,Mze),f=c.frustum.clone(),x=A.computeViewportTransformation(a,0,1,new A),_=c.frustum.projectionMatrix,C=c.positionWC.y,V=m.fromElements(W.sign(C)*p.x-C,0,-c.positionWC.x),L=Pt.pointToGLWindowCoordinates(_,x,V);if(C===0||L.x<=0||L.x>=s.clientWidth)d=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,Cc=YW(r,n,c,Cc),Na.clipToGLWindowCoordinates(a,Cc,lJ),a.x+=L.x,c.position.x=-c.position.x;let R=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-R,Cc=YW(r,n,c,Cc),Na.clipToGLWindowCoordinates(a,Cc,dJ)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,Cc=YW(r,n,c,Cc),Na.clipToGLWindowCoordinates(a,Cc,lJ),a.x=a.x-a.width,c.position.x=-c.position.x;let R=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-R,Cc=YW(r,n,c,Cc),Na.clipToGLWindowCoordinates(a,Cc,dJ)}m.clone(g,c.position),c.frustum=f.clone(),i=D.clone(lJ,i),(i.x<0||i.x>s.clientWidth)&&(i.x=dJ.x)}}if(o.mode!==oe.SCENE2D||d){if(Cc=YW(r,n,c,Cc),Cc.z<0&&!(c.frustum instanceof an)&&!(c.frustum instanceof Pr))return;i=Na.clipToGLWindowCoordinates(a,Cc,i)}return i.y=s.clientHeight-i.y,i};Na.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Na.worldToWindowCoordinates(e,t,n),!!l(n))return Na.transformWindowToDrawingBuffer(e,n,n)};var Ib=new m,Nze=new he;Na.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,Nze);if(!l(r))return;if(o.project(r,Ib),i===oe.COLUMBUS_VIEW)return m.fromElements(Ib.z,Ib.x,Ib.y,n);if(i===oe.SCENE2D)return m.fromElements(0,Ib.x,Ib.y,n);let s=e.morphTime;return m.fromElements(W.lerp(Ib.z,t.x,s),W.lerp(Ib.x,t.y,s),W.lerp(Ib.y,t.z,s),n)};var Gde=new m,Ede=new m,Ide=new A;Na.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Gde),A.computeViewportTransformation(e,0,1,Ide),A.multiplyByPoint(Ide,Gde,Ede),D.fromCartesian3(Ede,n)};Na.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var kze=new se,Xde=new se;Na.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=se.clone(se.UNIT_W,kze);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=A.multiplyByVector(r.inverseViewProjection,u,Xde);let g=1/h.w;m.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;l(g)&&(p=g),h=Xde,h.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(u.z*(a-c)-a-c)*.5,h.w=1,h=A.multiplyByVector(r.inverseView,h,h)}return m.fromCartesian4(h,i)};var Di=Na;var M5n=T(S(),1);var JNn=T(S(),1);var X1={};X1._deprecationWarning=wa;var Xb=Uint32Array.BYTES_PER_ELEMENT;X1.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Xb;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Batched 3D Model version 1 is supported.  Version ${r} is not.`);t+=Xb;let s=o.getUint32(t,!0);t+=Xb;let a=o.getUint32(t,!0);t+=Xb;let c=o.getUint32(t,!0);t+=Xb;let d=o.getUint32(t,!0);t+=Xb;let u=o.getUint32(t,!0);t+=Xb;let h;d>=570425344?(t-=Xb*2,h=a,d=c,u=0,a=0,c=0,X1._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=Xb,h=d,d=a,u=c,a=0,c=0,X1._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(h,0)}:(p=Jo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Jo(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(X1._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var HW=X1;var e5n=T(S(),1);function zW(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Wde(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function Uze(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}zW.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,Q.UNSIGNED_INT),n=y(n,1),Wde(this,e,t,n,1,i.byteOffset)):i};zW.prototype.hasProperty=function(e){return l(this.json[e])};zW.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Q.fromName(i.componentType)),Wde(this,e,t,n,this.featuresLength,i.byteOffset)):Uze(this,e,t,i)};zW.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var uh=zW;var x5n=T(S(),1);function KW(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=Dze(n),a;l(s.jsonProperties)&&(a=new Zb({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new k_({extension:s.hierarchy,binaryBody:i}));let d=oh.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,h,p,g;if(o){let _=Oze(t,d,u,i,r);g=_.transcodedSchema,p=[new sT({propertyAttribute:_.propertyAttributeJson,class:_.transcodedClass})]}else{let _=Bze(t,d,u,i);g=_.transcodedSchema;let C=_.featureTableJson;h=new Ou({count:C.count,properties:C.properties,class:_.transcodedClass,bufferViews:_.bufferViewsTypedArrays}),p=[]}let f=[];if(l(h)||l(a)||l(c)){let _=new rl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:c});f.push(_)}let x={schema:g,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Hs(x)}function Dze(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(KW._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function Bze(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new ae(`Property ${h} requires a batch table binary.`);let p=n[h],g=Gd(p);r[h]={bufferView:a},o[h]=Pde(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=Xd.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function Oze(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new ae(`Property ${h} requires a batch table binary.`);let g=Qt.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let f=Pde(p);f.name=h,r[g]=f;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let _=p.typedArray;l(_)||(_=Gd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Sn.Attribute;C.name=x,C.count=e,C.type=p.type;let V=Q.fromTypedArray(_);(V===Q.INT||V===Q.UNSIGNED_INT||V===Q.DOUBLE)&&(KW._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),_=new Float32Array(_)),C.componentDatatype=Q.fromTypedArray(_),C.typedArray=_,o.push(C),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let d=Xd.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function Pde(e){let t=Yze(e.componentType);return{type:e.type,componentType:t}}function Yze(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}KW._deprecationWarning=wa;KW._oneTimeWarning=_t;var Wb=KW;var lT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},Hze=Sn.FeatureIdAttribute;function Og(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Po.Y),d=y(e.forwardAxis,Po.X),u=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),g=y(e.loadIndicesForWireframe,!1),f=y(e.loadPrimitiveOutline,!0),x=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=f,this._loadForClassification=x,this._state=lT.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=A.IDENTITY}l(Object.create)&&(Og.prototype=Object.create(Ki.prototype),Og.prototype.constructor=Og);Object.defineProperties(Og.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Og.prototype.load=function(){if(l(this._promise))return this._promise;let e=HW.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new uh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(a)&&(this._transform=A.fromTranslation(m.fromArray(a))),this._batchTable={json:o,binary:r};let c=new dh({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=lT.LOADING;let d=this;return this._promise=c.load().then(function(){if(!d.isDestroyed())return d._state=lT.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return zze(d,u)}),this._promise};function zze(e,t){return e.unload(),e._state=lT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Og.prototype.process=function(e){if(this._state===lT.READY)return!0;if(this._state!==lT.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=A.multiplyTransformation(this._transform,n.transform,n.transform),Kze(this,n),this._components=n,this._arrayBuffer=void 0,this._state=lT.READY,!0};function Kze(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=Wb({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new rl({name:oh.BATCH_TABLE_CLASS_NAME,count:i});o=new Hs({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)vde(r[a]);t.structuralMetadata=o}function vde(e){let t=e.children.length;for(let i=0;i<t;i++)vde(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Qt.getAttributeBySemantic(o,ft.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new Hze;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Og.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var JW=Og;var skn=T(S(),1);function Yg(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(Yg.prototype=Object.create(Ki.prototype),Yg.prototype.constructor=Yg);Object.defineProperties(Yg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Yg.prototype.load=function(){return Promise.resolve(this)};Yg.prototype.process=function(e){return l(this._components)||(this._components=aKe(this._geoJson,e),this._geoJson=void 0),!0};function Jze(){this.lines=void 0,this.points=void 0,this.properties=void 0}function Qze(){this.features=[]}function uJ(e){let t=e[0],n=e[1],i=y(e[2],0);return new m(t,n,i)}function mJ(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=uJ(e[o]);return[n]}function jze(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=mJ(e[i])[0];return n}function wde(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=mJ(e[i])[0];return n}function qze(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,wde(e[i]));return n}function $ze(e){return[uJ(e)]}function eKe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=uJ(e[i]);return n}var tKe={LineString:mJ,MultiLineString:jze,MultiPolygon:qze,Polygon:wde,MultiPoint:eKe,Point:$ze},nKe={LineString:we.LINES,MultiLineString:we.LINES,MultiPolygon:we.LINES,Polygon:we.LINES,MultiPoint:we.POINTS,Point:we.POINTS};function Fde(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=tKe[n],o=nKe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new Jze;o===we.LINES?s.lines=i(r):o===we.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function iKe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Fde(n[o],t)}var oKe={FeatureCollection:iKe,Feature:Fde},Dk=new m;function rKe(e,t,n){let i=0,o=0,r=e.length;for(let w=0;w<r;w++){let M=e[w];if(l(M.lines)){let b=M.lines.length;for(let Z=0;Z<b;Z++){let E=M.lines[Z];i+=E.length,o+=(E.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ae.createTypedArray(i,o),d=Ae.fromTypedArray(c),u=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let w=0;w<r;w++){let M=e[w];if(!l(M.lines))continue;let b=M.lines.length;for(let Z=0;Z<b;Z++){let E=M.lines[Z],X=E.length;for(let F=0;F<X;F++){let N=E[F],O=m.fromDegrees(N.x,N.y,N.z,ne.WGS84,Dk),U=A.multiplyByPoint(t,O,Dk);m.minimumByComponent(u,U,u),m.maximumByComponent(h,U,h),m.pack(U,s,p*3),a[p]=w,F<X-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let f=xt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let x=xt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});x.vertexArrayDestroyable=!1;let _=xt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:d});_.vertexArrayDestroyable=!1;let C=new Sn.Attribute;C.semantic=ft.POSITION,C.componentDatatype=Q.FLOAT,C.type=on.VEC3,C.count=i,C.min=u,C.max=h,C.buffer=f;let V=new Sn.Attribute;V.semantic=ft.FEATURE_ID,V.setIndex=0,V.componentDatatype=Q.FLOAT,V.type=on.SCALAR,V.count=i,V.buffer=x;let L=[C,V],R=new Sn.Material;R.unlit=!0;let G=new Sn.Indices;G.indexDatatype=d,G.count=c.length,G.buffer=_;let I=new Sn.FeatureIdAttribute;I.featureCount=r,I.propertyTableId=0,I.setIndex=0,I.positionalLabel="featureId_0";let v=[I],P=new Sn.Primitive;return P.attributes=L,P.indices=G,P.featureIds=v,P.primitiveType=we.LINES,P.material=R,P}function sKe(e,t,n){let i=0,o=e.length;for(let L=0;L<o;L++){let R=e[L];l(R.points)&&(i+=R.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0;for(let L=0;L<o;L++){let R=e[L];if(!l(R.points))continue;let G=R.points.length;for(let I=0;I<G;I++){let v=R.points[I],P=m.fromDegrees(v.x,v.y,v.z,ne.WGS84,Dk),w=A.multiplyByPoint(t,P,Dk);m.minimumByComponent(a,w,a),m.maximumByComponent(c,w,c),m.pack(w,r,d*3),s[d]=L,d++}}let u=xt.createVertexBuffer({typedArray:r,context:n.context,usage:Me.STATIC_DRAW});u.vertexArrayDestroyable=!1;let h=xt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new Sn.Attribute;p.semantic=ft.POSITION,p.componentDatatype=Q.FLOAT,p.type=on.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let g=new Sn.Attribute;g.semantic=ft.FEATURE_ID,g.setIndex=0,g.componentDatatype=Q.FLOAT,g.type=on.SCALAR,g.count=i,g.buffer=h;let f=[p,g],x=new Sn.Material;x.unlit=!0;let _=new Sn.FeatureIdAttribute;_.featureCount=o,_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0";let C=[_],V=new Sn.Primitive;return V.attributes=f,V.featureIds=C,V.primitiveType=we.POINTS,V.material=x,V}function aKe(e,t){let n=new Qze,i=oKe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ae("GeoJSON must have at least one feature");let s={};for(let w=0;w<r;w++){let M=o[w],b=y(M.properties,y.EMPTY_OBJECT);for(let Z in b)b.hasOwnProperty(Z)&&(l(s[Z])||(s[Z]=new Array(r)))}for(let w=0;w<r;w++){let M=o[w];for(let b in s)if(s.hasOwnProperty(b)){let Z=y(M.properties[b],"");s[b][w]=Z}}let a=new Zb({count:r,properties:s}),d=[new rl({id:0,count:r,jsonMetadataTable:a})],u=Xd.fromJson({}),h=new Hs({schema:u,propertyTables:d}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,x=!1;for(let w=0;w<r;w++){let M=o[w];if(l(M.lines)){f=!0;let b=M.lines.length;for(let Z=0;Z<b;Z++){let E=M.lines[Z],X=E.length;for(let F=0;F<X;F++)m.minimumByComponent(p,E[F],p),m.maximumByComponent(g,E[F],g)}}if(l(M.points)){x=!0;let b=M.points.length;for(let Z=0;Z<b;Z++){let E=M.points[Z];m.minimumByComponent(p,E,p),m.maximumByComponent(g,E,g)}}}let _=m.midpoint(p,g,new m),C=m.fromDegrees(_.x,_.y,_.z,ne.WGS84,new m),V=Pt.eastNorthUpToFixedFrame(C,ne.WGS84,new A),L=A.inverseTransformation(V,new A),R=[];f&&R.push(rKe(o,L,t)),x&&R.push(sKe(o,L,t));let G=new Sn.Node;G.index=0,G.primitives=R;let I=[G],v=new Sn.Scene;v.nodes=I;let P=new Sn.Components;return P.scene=v,P.nodes=I,P.transform=V,P.structuralMetadata=h,P}Yg.prototype.unload=function(){this._components=void 0};var QW=Yg;var Dkn=T(S(),1);var mkn=T(S(),1);var Bk={};Bk._deprecationWarning=wa;var Hg=Uint32Array.BYTES_PER_ELEMENT;Bk.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Hg;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Hg;let s=o.getUint32(t,!0);t+=Hg;let a=o.getUint32(t,!0);if(a===0)throw new ae("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Hg;let c=o.getUint32(t,!0);t+=Hg;let d=o.getUint32(t,!0);t+=Hg;let u=o.getUint32(t,!0);t+=Hg;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new ae(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=Hg;let p=Jo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Jo(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(Bk._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var jW=Bk;var Pb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Ok=Sn.Attribute,cKe=Sn.FeatureIdAttribute,Mde=Sn.Instances;function vb(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Po.Y),d=y(e.forwardAxis,Po.X),u=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=Pb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=A.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(vb.prototype=Object.create(Ki.prototype),vb.prototype.constructor=vb);Object.defineProperties(vb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});vb.prototype.load=function(){if(l(this._promise))return this._promise;let e=jW.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new uh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=A.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=Pl(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new dh(d);return this._gltfLoader=u,this._state=Pb.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=Pb.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw lKe(this,h)}),this._promise};function lKe(e,t){return e.unload(),e._state=Pb.FAILED,e.getError("Failed to load i3dm",t)}vb.prototype.process=function(e){if(this._state===Pb.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Pb.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=A.multiplyTransformation(this._transform,i.transform,i.transform),mKe(this,i,e),dKe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Pb.READY,!0};function dKe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Wb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new rl({name:oh.BATCH_TABLE_CLASS_NAME,count:i});o=new Hs({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var Yk=new m,hJ=new Array(4),uKe=new A;function mKe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=fKe(o,r),h;c&&(h=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=m.unpackArray(u),x=new m,_=new m,C=new m,V=new m,L=new $,R=new ve,G=new Array(4),I=new m,v=new Array(3),P=new A;if(!l(s)||m.equals(m.unpack(s),m.ZERO)){let U=le.fromPoints(f);for(i=0;i<f.length;i++)m.subtract(f[i],U.center,Yk),u[3*i+0]=Yk.x,u[3*i+1]=Yk.y,u[3*i+2]=Yk.z;let Y=A.fromTranslation(U.center,uKe);t.transform=A.multiplyTransformation(Y,t.transform,t.transform)}for(i=0;i<r;i++){x=m.clone(f[i]),l(s)&&m.add(x,m.unpack(s),x),c&&(pKe(o,a,i,R,x,C,_,V,L,P),ve.pack(R,G,0),h[4*i+0]=G[0],h[4*i+1]=G[1],h[4*i+2]=G[2],h[4*i+3]=G[3]),d&&(bKe(o,i,I),m.pack(I,v,0),p[3*i+0]=v[0],p[3*i+1]=v[1],p[3*i+2]=v[2]);let U=o.getProperty("BATCH_ID",Q.UNSIGNED_SHORT,1,i);l(U)||(U=i),g[i]=U}let w=new Mde;w.transformInWorldSpace=!0;let M=e._buffers,b=new Ok;if(b.name="Instance Translation",b.semantic=is.TRANSLATION,b.componentDatatype=Q.FLOAT,b.type=on.VEC3,b.count=r,b.typedArray=u,!c){let U=xt.createVertexBuffer({context:n.context,typedArray:u,usage:Me.STATIC_DRAW});U.vertexArrayDestroyable=!1,M.push(U),b.buffer=U}if(w.attributes.push(b),c){let U=new Ok;U.name="Instance Rotation",U.semantic=is.ROTATION,U.componentDatatype=Q.FLOAT,U.type=on.VEC4,U.count=r,U.typedArray=h,w.attributes.push(U)}if(d){let U=new Ok;if(U.name="Instance Scale",U.semantic=is.SCALE,U.componentDatatype=Q.FLOAT,U.type=on.VEC3,U.count=r,c)U.typedArray=p;else{let Y=xt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});Y.vertexArrayDestroyable=!1,M.push(Y),U.buffer=Y}w.attributes.push(U)}let Z=new Ok;Z.name="Instance Feature ID",Z.setIndex=0,Z.semantic=is.FEATURE_ID,Z.componentDatatype=Q.FLOAT,Z.type=on.SCALAR,Z.count=r;let E=xt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});E.vertexArrayDestroyable=!1,M.push(E),Z.buffer=E,w.attributes.push(Z);let X=new cKe;X.propertyTableId=0,X.setIndex=0,X.positionalLabel="instanceFeatureId_0",w.featureIds.push(X);let F=t.nodes,N=F.length,O=!1;for(i=0;i<N;i++){let U=F[i];U.primitives.length>0&&(U.instances=O?hKe(w):w,O=!0)}}function hKe(e){let t=new Mde;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ye(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function fKe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Q.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(o))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new ae("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Ade=new Array(4);function pKe(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",Q.FLOAT,3,n,hJ),h=e.getProperty("NORMAL_RIGHT",Q.FLOAT,3,n,Ade),p=!1;if(l(u)){if(!l(h))throw new ae("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(u,0,r),m.unpack(h,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Q.UNSIGNED_SHORT,2,n,hJ),f=e.getProperty("NORMAL_RIGHT_OCT32P",Q.UNSIGNED_SHORT,2,n,Ade);if(l(g)){if(!l(f))throw new ae("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");wn.octDecodeInRange(g[0],g[1],65535,r),wn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(Pt.eastNorthUpToFixedFrame(o,ne.WGS84,d),A.getMatrix3(d,c)):$.clone($.IDENTITY,c)}p&&(m.cross(s,r,a),m.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),ve.fromRotationMatrix(c,i)}function bKe(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Q.FLOAT,1,t);l(i)&&m.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",Q.FLOAT,3,t,hJ);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function gKe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}vb.prototype.isUnloaded=function(){return this._state===Pb.UNLOADED};vb.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),gKe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Pb.UNLOADED};var qW=vb;var SUn=T(S(),1);var mUn=T(S(),1);var Okn=T(S(),1),yKe={STOPPED:0,ANIMATING:1},mh=Object.freeze(yKe);var iUn=T(S(),1);var W1=Sn.AnimatedPropertyType;function fJ(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,CKe(this)}Object.defineProperties(fJ.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function xKe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new q0({times:e,points:n,inTangents:i,outTangents:o})}function Nde(e,t,n,i){if(e.length===1&&t.length===1)return new TE(t[0]);switch(n){case Ym.STEP:return new SI({times:e,points:t});case Ym.CUBICSPLINE:return xKe(e,t);case Ym.LINEAR:return i===W1.ROTATION?new gI({times:e,points:t}):new j0({times:e,points:t})}}function _Ke(e,t,n,i,o){let r=[];if(i===W1.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),h=c;if(n===Ym.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[h],u[d+1]=t[h+o],u[d+2]=t[h+2*o],h+=o*3;else for(d=0;d<a;d++)u[d]=t[h],h+=o;r.push(Nde(e,u,n,i))}}else r.push(Nde(e,t,n,i));return r}var TKe=new m,SKe=new ve;function CKe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,d=l(c.morphWeights)?c.morphWeights.length:1,u=_Ke(i,o,r,a,d);e._splines=u,e._path=a}fJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===W1.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],d=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===W1.TRANSLATION||n===W1.SCALE?o[n]=r.evaluate(s,TKe):n===W1.ROTATION&&(o[n]=r.evaluate(s,SKe))}}};var $W=fJ;function pJ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=q.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=q.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,Ol.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=mh.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,VKe(this)}Object.defineProperties(pJ.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function VKe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let d=r[c],u=d.target;if(!l(u))continue;let h=u.node.index,p=i._runtimeNodes[h],g=new $W({channel:d,runtimeAnimation:e,runtimeNode:p}),f=d.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}pJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var e2=pJ;function wb(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(wb.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function bJ(e,t,n){let i=e._model,o=new e2(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}wb.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return bJ(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return bJ(this,n[i],e)};wb.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=bJ(this,n[r],e);i.push(s)}return i};wb.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};wb.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};wb.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};wb.prototype.get=function(e){return this._runtimeAnimations[e]};var Hk=[];function LKe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}wb.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&q.equals(e.time,this._previousTime))return!1;this._previousTime=q.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=q.addSeconds(y(a.startTime,o),a.delay,new q)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,h=q.lessThanOrEquals(c,o),p=l(u)&&q.greaterThan(o,u),g=0;if(d!==0){let _=q.secondsDifference(p?u:o,c);g=l(a._animationTime)?a._animationTime(d,_):_/d}let f=a.loop===Ol.REPEAT||a.loop===Ol.MIRRORED_REPEAT,x=(h||f&&!l(a.startTime))&&(g<=1||f)&&!p;if(g===a._prevAnimationDelta){let _=a._state===mh.STOPPED;if(x!==_)continue}if(a._prevAnimationDelta=g,x||a._state===mh.ANIMATING){if(x&&a._state===mh.STOPPED&&(a._state=mh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Ol.REPEAT)g=g-Math.floor(g);else if(a.loop===Ol.MIRRORED_REPEAT){let C=Math.floor(g),V=g-C;g=C%2===1?1-V:V}a.reverse&&(g=1-g);let _=g*d*a.multiplier;_=W.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=mh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&Hk.push(a))}}n=Hk.length;for(let s=0;s<n;++s){let a=Hk[s];t.splice(t.indexOf(a),1),e.afterRender.push(LKe(this,r,a))}return Hk.length=0,i};var t2=wb;var UUn=T(S(),1);var RUn=T(S(),1);function dT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(dT.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new B),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});dT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};dT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};dT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};dT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};dT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var n2=dT;var GUn=T(S(),1),i2={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};i2.getStyleCommandsNeeded=function(e,t){return t===0?i2.ALL_OPAQUE:t===e?i2.ALL_TRANSLUCENT:i2.OPAQUE_AND_TRANSLUCENT};var hh=Object.freeze(i2);var IUn=T(S(),1);var zg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};zg.is3DTiles=function(e){switch(e){case zg.TILE_GLTF:case zg.TILE_B3DM:case zg.TILE_I3DM:case zg.TILE_PNTS:case zg.TILE_GEOJSON:return!0;case zg.GLTF:return!1}};var dr=Object.freeze(zg);function Dr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=hh.ALL_OPAQUE,RKe(this)}Object.defineProperties(Dr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function RKe(e){let t=e._model,n=dr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Os(s,o)}else for(o=0;o<i;o++)r[o]=new n2({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new il({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Dr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=hh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Dr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Dr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Dr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Dr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Dr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Dr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Dr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Dr.prototype.getFeature=function(e){return this._features[e]};Dr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Dr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Dr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Dr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Dr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Dr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Dr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Dr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Dr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var ZKe=new B;Dr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(il.DEFAULT_COLOR_VALUE),this.setAllShow(il.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,ZKe),il.DEFAULT_COLOR_VALUE):il.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),il.DEFAULT_SHOW_VALUE):il.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Dr.prototype.isDestroyed=function(){return!1};Dr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var o2=Dr;var XQn=T(S(),1);var zUn=T(S(),1);var kde={name:"TilesetPipelineStage"};kde.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ye.FRAGMENT);let r={u_polygonOffset:function(){return D.ZERO}};e.uniformMap=St(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK};var r2=kde;var oDn=T(S(),1);var JUn=T(S(),1),s2=`// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
//
// This version uses only a single iteration for best performance. For fog
// rendering, the difference is negligible.
vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
    vec2 p = abs(pos);
    vec2 inverseRadii = 1.0 / radii;
    vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;

    // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
    // but store the cos and sin of t in a vec2 for efficiency.
    // Initial guess: t = cos(pi/4)
    vec2 tTrigs = vec2(0.70710678118);
    vec2 v = radii * tTrigs;

    // Find the evolute of the ellipse (center of curvature) at v.
    vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
    // Find the (approximate) intersection of p - evolute with the ellipsoid.
    vec2 q = normalize(p - evolute) * length(v - evolute);
    // Update the estimate of t.
    tTrigs = (q + evolute) * inverseRadii;
    tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
    v = radii * tTrigs;

    return v * sign(pos);
}

vec3 computeEllipsoidPositionWC(vec3 positionMC) {
    // Get the world-space position and project onto a meridian plane of
    // the ellipsoid
    vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;

    vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
    vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);

    // Reconstruct a 3D point in world space
    return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
}

void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {

    vec3 fogColor = groundAtmosphereColor.rgb;

    // If there is dynamic lighting, apply that to the fog.
    const float NONE = 0.0;
    if (czm_atmosphereDynamicLighting != NONE) {
        float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
        fogColor *= darken;
    }

    // Tonemap if HDR rendering is disabled
    #ifndef HDR
        fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
        fogColor.rgb = czm_inverseGamma(fogColor.rgb);
    #endif

    vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
    color = vec4(withFog, color.a);
}

void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
    vec3 rayleighColor;
    vec3 mieColor;
    float opacity;

    vec3 positionWC;
    vec3 lightDirection;

    // When the camera is in space, compute the position per-fragment for
    // more accurate ground atmosphere. All other cases will use
    //
    // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
    if (false) {
        positionWC = computeEllipsoidPositionWC(attributes.positionMC);
        lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);

        // The fog color is derived from the ground atmosphere color
        czm_computeGroundAtmosphereScattering(
            positionWC,
            lightDirection,
            rayleighColor,
            mieColor,
            opacity
        );
    } else {
        positionWC = attributes.positionWC;
        lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
        rayleighColor = v_atmosphereRayleighColor;
        mieColor = v_atmosphereMieColor;
        opacity = v_atmosphereOpacity;
    }

    //color correct rayleigh and mie colors
    const bool ignoreBlackPixels = true;
    rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
    mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);

    vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);

    if (u_isInFog) {
        float distanceToCamera = length(attributes.positionEC);
        applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
    } else {
        // Ground atmosphere
    }
}
`;var jUn=T(S(),1),a2=`void atmosphereStage(ProcessedAttributes attributes) {
    vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);

    czm_computeGroundAtmosphereScattering(
        // This assumes the geometry stage came before this.
        v_positionWC,
        lightDirection,
        v_atmosphereRayleighColor,
        v_atmosphereMieColor,
        v_atmosphereOpacity
    );
}
`;var Ude={name:"AtmospherePipelineStage"};Ude.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ye.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ye.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([a2]),i.addFragmentLines([s2]),i.addUniform("bool","u_isInFog",ye.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=m.distance(n.camera.positionWC,t.boundingSphere.center);return W.fog(o,n.fog.density)>W.EPSILON3}};var c2=Ude;var fDn=T(S(),1);var sDn=T(S(),1),l2=`#ifdef DIFFUSE_IBL
vec3 sampleDiffuseEnvironment(vec3 cubeDir)
{
    #ifdef CUSTOM_SPHERICAL_HARMONICS
        return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); 
    #else
        return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); 
    #endif
}
#endif

#ifdef SPECULAR_IBL
vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
{
    #ifdef CUSTOM_SPECULAR_IBL
        float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
        return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
    #else
        float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
        return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
    #endif
}
vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
{
    // see https://bruop.github.io/ibl/ at Single Scattering Results
    // Roughness dependent fresnel, from Fdez-Aguera
    vec3 f90 = max(vec3(1.0 - roughness), f0);
    vec3 F = fresnelSchlick2(f0, f90, NdotV);

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);

    return specularSample * (F * brdfLut.x + brdfLut.y);
}
#endif

#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
/**
 * Compute the light contributions from environment maps and spherical harmonic coefficients.
 * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
 * of the single- and multi-scattering terms.
 *
 * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color.
 */
vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
    vec3 f0 = material.specular;
    float roughness = material.roughness;
    float specularWeight = 1.0;
    #ifdef USE_SPECULAR
        specularWeight = material.specularWeight;
    #endif
    float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);

    // see https://bruop.github.io/ibl/ at Single Scattering Results
    // Roughness dependent fresnel, from Fdez-Aguera
    vec3 f90 = max(vec3(1.0 - roughness), f0);
    vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);

    #ifdef DIFFUSE_IBL
        vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
        vec3 irradiance = sampleDiffuseEnvironment(normalMC);

        vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
        float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
        vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
        vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
        vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;
    #else
        vec3 diffuseContribution = vec3(0.0);
    #endif

    #ifdef USE_ANISOTROPY
        // Bend normal to account for anisotropic distortion of specular reflection
        vec3 anisotropyDirection = material.anisotropicB;
        vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
        vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
        float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
        float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
        vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
        vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
    #else
        vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
    #endif

    #ifdef SPECULAR_IBL
        vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
        vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
        vec3 specularContribution = radiance * FssEss * model_iblFactor.y;
    #else
        vec3 specularContribution = vec3(0.0);
    #endif

    return diffuseContribution + specularContribution;
}
#endif
`;var Dde={name:"ImageBasedLightingPipelineStage"},GKe=new D;Dde.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ye.FRAGMENT),r.addUniform("vec2","model_iblFactor",ye.FRAGMENT),th.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ye.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ye.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ye.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ye.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ye.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ye.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,ye.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ye.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ye.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ye.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ye.FRAGMENT)),r.addFragmentLines(l2);let c={model_iblFactor:function(){return D.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,GKe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=St(c,e.uniformMap)};var d2=Dde;var GDn=T(S(),1);var SDn=T(S(),1);var EKe=W.EPSILON16;function yJ(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(yJ.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,EKe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var IKe=new m,gJ=new $;yJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=IKe,o;switch(t){case ac.XROTATE:o=$.fromRotationX(W.toRadians(n),gJ),e=A.multiplyByMatrix3(e,o,e);break;case ac.YROTATE:o=$.fromRotationY(W.toRadians(n),gJ),e=A.multiplyByMatrix3(e,o,e);break;case ac.ZROTATE:o=$.fromRotationZ(W.toRadians(n),gJ),e=A.multiplyByMatrix3(e,o,e);break;case ac.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=A.multiplyByTranslation(e,i,e);break;case ac.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=A.multiplyByTranslation(e,i,e);break;case ac.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=A.multiplyByTranslation(e,i,e);break;case ac.XSCALE:i.x=n,i.y=1,i.z=1,e=A.multiplyByScale(e,i,e);break;case ac.YSCALE:i.x=1,i.y=n,i.z=1,e=A.multiplyByScale(e,i,e);break;case ac.ZSCALE:i.x=1,i.y=1,i.z=n,e=A.multiplyByScale(e,i,e);break;case ac.UNIFORMSCALE:e=A.multiplyByUniformScale(e,n,e);break;default:break}return e};var u2=yJ;function zk(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,XKe(this)}Object.defineProperties(zk.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function XKe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new u2({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}zk.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var WKe=new A,PKe=new A;zk.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=A.clone(A.IDENTITY,WKe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=A.multiplyTransformation(s.originalTransform,e,PKe);s.transform=a}};var m2=zk;var ADn=T(S(),1);var IDn=T(S(),1),h2=`void modelColorStage(inout czm_modelMaterial material)
{
    material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
    float highlight = ceil(model_colorBlend);
    material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
    material.alpha *= model_color.a;
}
`;var P1={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};P1.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ye.FRAGMENT),i.addFragmentLines(h2);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=Ee.TRANSLUCENT),i.addUniform("vec4",P1.COLOR_UNIFORM_NAME,ye.FRAGMENT),o[P1.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",P1.COLOR_BLEND_UNIFORM_NAME,ye.FRAGMENT),o[P1.COLOR_BLEND_UNIFORM_NAME]=function(){return Tc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=St(o,e.uniformMap)};var Kg=P1;var zDn=T(S(),1);var NDn=T(S(),1),f2=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
vec4 getClippingPlane(
    highp sampler2D packedClippingPlanes,
    int clippingPlaneNumber,
    mat4 transform
) {
    int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
    int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    vec4 plane = texture(packedClippingPlanes, vec2(u, v));
    return czm_transformPlane(plane, transform);
}
#else
// Handle uint8 clipping texture instead
vec4 getClippingPlane(
    highp sampler2D packedClippingPlanes,
    int clippingPlaneNumber,
    mat4 transform
) {
    int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
    int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
    int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
    vec4 plane;
    plane.xyz = czm_octDecode(oct, 65535.0);
    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
    return czm_transformPlane(plane, transform);
}
#endif

float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float pixelWidth = czm_metersPerPixel(position);
    
    #ifdef UNION_CLIPPING_REGIONS
    float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
    #else
    float clipAmount = 0.0;
    bool clipped = true;
    #endif

    for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        
        #ifdef UNION_CLIPPING_REGIONS
        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
        if (amount <= 0.0) {
            discard;
        }
        #else
        clipAmount = max(amount, clipAmount);
        clipped = clipped && (amount <= 0.0);
        #endif
    }

    #ifndef UNION_CLIPPING_REGIONS
    if (clipped) {
        discard;
    }
    #endif
    
    return clipAmount;
}

void modelClippingPlanesStage(inout vec4 color)
{
    float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
    vec4 clippingPlanesEdgeColor = vec4(1.0);
    clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
    float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
    
    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
        color = clippingPlanesEdgeColor;
    }
}
`;var Bde={name:"ModelClippingPlanesPipelineStage"},vKe=new D;Bde.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ye.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ye.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ye.FRAGMENT),fs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ye.FRAGMENT);let s=fs.getTextureResolution(i,o,vKe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ye.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ye.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ye.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ye.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ye.FRAGMENT),r.addFragmentLines(f2);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=B.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=St(a,e.uniformMap)};var p2=Bde;var iBn=T(S(),1);var JDn=T(S(),1),b2=`void modelClippingPolygonsStage(ProcessedAttributes attributes)
{
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);

    vec2 minDistance = vec2(czm_infinity);
    v_regionIndex = -1;
    v_clippingPosition = vec2(czm_infinity);

    for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
        vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
        vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;

        vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
        vec2 distance = abs(rectUv - clamped) * extents.wz;
        
        if (minDistance.x > distance.x || minDistance.y > distance.y) {
            minDistance = distance;
            v_clippingPosition = rectUv;
        }

        float threshold = 0.01;
        if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
            v_regionIndex = regionIndex;
        }
    }
}
`;var jDn=T(S(),1),g2=`void modelClippingPolygonsStage()
{
    vec2 clippingPosition = v_clippingPosition;
    int regionIndex = v_regionIndex;
    czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var Ode={name:"ModelClippingPolygonsPipelineStage"};Ode.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ye.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ye.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ye.BOTH),o.addUniform("sampler2D","model_clippingDistance",ye.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ye.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(b2),o.addFragmentLines(g2);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=St(r,e.uniformMap)};var y2=Ode;var sBn=T(S(),1);function Yde(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Yde.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var x2=Yde;var $Bn=T(S(),1);var vBn=T(S(),1);var cBn=T(S(),1),_2=`mat4 getInstancingTransform()
{
    mat4 instancingTransform;

    #ifdef HAS_INSTANCE_MATRICES
    instancingTransform = mat4(
        a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
        a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
        a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
        a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0  // Column 4
    );
    #else
    vec3 translation = vec3(0.0, 0.0, 0.0);
    vec3 scale = vec3(1.0, 1.0, 1.0);
    
        #ifdef HAS_INSTANCE_TRANSLATION
        translation = a_instanceTranslation;
        #endif
        #ifdef HAS_INSTANCE_SCALE
        scale = a_instanceScale;
        #endif

    instancingTransform = mat4(
        scale.x, 0.0, 0.0, 0.0,
        0.0, scale.y, 0.0, 0.0,
        0.0, 0.0, scale.z, 0.0,
        translation.x, translation.y, translation.z, 1.0
    ); 
    #endif

    return instancingTransform;
}

#ifdef USE_2D_INSTANCING
mat4 getInstancingTransform2D()
{
    mat4 instancingTransform2D;

    #ifdef HAS_INSTANCE_MATRICES
    instancingTransform2D = mat4(
        a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
        a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
        a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
        a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0  // Column 4
    );
    #else
    vec3 translation2D = vec3(0.0, 0.0, 0.0);
    vec3 scale = vec3(1.0, 1.0, 1.0);
    
        #ifdef HAS_INSTANCE_TRANSLATION
        translation2D = a_instanceTranslation2D;
        #endif
        #ifdef HAS_INSTANCE_SCALE
        scale = a_instanceScale;
        #endif

    instancingTransform2D = mat4(
        scale.x, 0.0, 0.0, 0.0,
        0.0, scale.y, 0.0, 0.0,
        0.0, 0.0, scale.z, 0.0,
        translation2D.x, translation2D.y, translation2D.z, 1.0
    ); 
    #endif

    return instancingTransform2D;
}
#endif
`;var dBn=T(S(),1),T2=`void instancingStage(inout ProcessedAttributes attributes) 
{
    vec3 positionMC = attributes.positionMC;
    
    mat4 instancingTransform = getInstancingTransform();
    
    attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
    #endif

    #ifdef USE_2D_INSTANCING
    mat4 instancingTransform2D = getInstancingTransform2D();
    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
    #endif
}
`;var mBn=T(S(),1),S2=`void legacyInstancingStage(
    inout ProcessedAttributes attributes,
    out mat4 instanceModelView,
    out mat3 instanceModelViewInverseTranspose)
{
    vec3 positionMC = attributes.positionMC;

    mat4 instancingTransform = getInstancingTransform();
 
    mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
    instanceModelView = u_instance_modifiedModelView;
    instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);

    attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
    
    #ifdef USE_2D_INSTANCING
    mat4 instancingTransform2D = getInstancingTransform2D();
    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
    #endif
}
`;var Kk=new A,wKe=new A,FKe=new A,zde={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:qde,_transformsToTypedArray:_J};zde.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(_2);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,h=[];jKe(e,n,i,h,d,u),eJe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ye.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ye.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ye.VERTEX),p.u_instance_modifiedModelView=function(){let g=A.multiplyTransformation(s.modelMatrix,a.components.transform,Kk);return d?A.multiplyTransformation(n.context.uniformState.view3D,g,Kk):(n.mode!==oe.SCENE3D&&(g=Pt.basisTo2D(n.mapProjection,g,Kk)),A.multiplyTransformation(n.context.uniformState.view,g,Kk))},p.u_instance_nodeTransform=function(){return A.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,wKe)},r.addVertexLines(S2)):r.addVertexLines(T2),d){r.addDefine("USE_2D_INSTANCING",void 0,ye.VERTEX),r.addUniform("mat4","u_modelView2D",ye.VERTEX);let g=n.context,f=A.fromTranslation(c.instancingReferencePoint2D,new A);p.u_modelView2D=function(){return A.multiplyTransformation(g.uniformState.view,f,FKe)}}e.uniformMap=St(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var C2=new A,AKe=new m;function MKe(e,t,n,i,o){let r=A.multiplyTransformation(t,e,C2);return r=A.multiplyTransformation(r,n,C2),o=Pt.basisTo2D(i.mapProjection,r,o),o}function NKe(e,t,n,i,o){let r=A.fromTranslation(e,C2),s=A.multiplyTransformation(t,r,C2);s=A.multiplyTransformation(s,n,C2);let a=A.getTranslation(s,AKe);return o=Di.computeActualEllipsoidPosition(i,a,o),o}function Kde(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=A.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=A.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=A.clone(o.computedModelMatrix,t),t=A.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=A.clone(A.IDENTITY,n))}var Jde=new A,Qde=new A,kKe=new A,UKe=new m;function DKe(e,t,n,i){let o=Jde,r=Qde;Kde(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],h=MKe(u,o,r,n,kKe),p=A.getTranslation(h,UKe),g=m.subtract(p,a,p);i[d]=A.setTranslation(h,g,i[d])}return i}function BKe(e,t,n,i){let o=Jde,r=Qde;Kde(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],h=NKe(u,o,r,n,u);i[d]=m.subtract(h,a,i[d])}return i}var OKe=new m,YKe=new m;function jde(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=A.multiplyByPoint(i,n.instancingTranslationMin,OKe),r=Di.computeActualEllipsoidPosition(t,o,o),s=A.multiplyByPoint(i,n.instancingTranslationMax,YKe),a=Di.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=m.lerp(r,a,.5,new m)}function _J(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function HKe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var zKe=new m,KKe=new ve,JKe=new m;function qde(e,t,n){let i=new Array(t),o=Qt.getAttributeBySemantic(e,is.TRANSLATION),r=Qt.getAttributeBySemantic(e,is.ROTATION),s=Qt.getAttributeBySemantic(e,is.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=l(o),u=l(r),h=l(s),p=d?o.typedArray:new Float32Array(t*3),g=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(g=wn.dequantize(g,r.componentDatatype,r.type,t));let f;h?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let _=0;_<t;_++){let C=new m(p[_*3],p[_*3+1],p[_*3+2],zKe);m.maximumByComponent(a,C,a),m.minimumByComponent(c,C,c);let V=new ve(g[_*4],g[_*4+1],g[_*4+2],u?g[_*4+3]:1,KKe),L=new m(f[_*3],f[_*3+1],f[_*3+2],JKe),R=A.fromTranslationQuaternionRotationScale(C,V,L,new A);i[_]=R}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function QKe(e,t,n){let i=new Array(t),o=e.typedArray,r=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let d=new m(o[c*3],o[c*3+1],o[c*3+2]);i[c]=d,m.minimumByComponent(r,d,r),m.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function TJ(e,t){let n=xt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function jKe(e,t,n,i,o,r){let s=Qt.getAttributeBySemantic(n,is.ROTATION);l(s)?qKe(e,n,i,t,o,r):$Ke(e,n,i,t,o)}function qKe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",h,p=d.instancingTransformsBuffer;if(!l(p)){h=qde(t,a,e);let _=_J(h);p=TJ(_,i),c._modelResources.push(p),r&&(d.transformsTypedArray=_),d.instancingTransformsBuffer=p}if(Hde(e,p,n,u),!o)return;let g=Ye(i);g.mode=oe.COLUMBUS_VIEW,jde(e,g);let f=d.instancingTransformsBuffer2D;if(!l(f)){let _=DKe(h,e,g,h),C=_J(_);f=TJ(C,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}Hde(e,f,n,"Transform2D")}function $Ke(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Qt.getAttributeBySemantic(t,is.TRANSLATION),d=Qt.getAttributeBySemantic(t,is.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),xJ(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,h=c.typedArray;if(l(h)?u=QKe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),xJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Ye(i);g.mode=oe.COLUMBUS_VIEW,jde(e,g);let f=a.instancingTranslationBuffer2D;if(!l(f)){let V=BKe(u,e,g,u),L=HKe(V);r&&(a.transformsTypedArray=L),f=TJ(L,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;xJ(e,f,0,void 0,n,"Translation2D")}function Hde(e,t,n,i){let r=Q.getSizeInBytes(Q.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function xJ(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function eJe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===is.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:on.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var V2=zde;var NBn=T(S(),1);var SJ={};SJ.name="ModelMatrixUpdateStage";SJ.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;$de(e,t,o,e.transformToRoot),e._transformDirty=!1}};function tJe(e,t,n){e.modelMatrix=A.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Qt.getCullFace(e.modelMatrix,e.primitiveType)}function $de(e,t,n,i){let o;i=A.multiplyTransformation(i,e.transform,new A),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];tJe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=A.clone(i,a._transformToRoot),$de(a,t,n,i),a._transformDirty=!1}}var L2=SJ;var DBn=T(S(),1);var eue={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:tue,_countGeneratedBuffers:nue};eue.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;tue(i,o),nue(i,r)};function tue(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function nue(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var R2=eue;function v1(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=A.clone(n,this._originalTransform),this._transform=A.clone(n,this._transform),this._transformToRoot=A.clone(i,this._transformToRoot),this._computedTransform=new A,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,nJe(this)}Object.defineProperties(v1.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=A.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),CJ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;ve.equals(n,e)||(t.rotation=ve.clone(e,t.rotation),CJ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),CJ(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function nJe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=A.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Vg(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function CJ(e,t){e._transformDirty=!0,e._transform=A.fromTranslationRotationScale(t,e._transform)}v1.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};v1.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(V2),t.push(R2),n.push(L2)};v1.prototype.updateComputedTransform=function(){this._computedTransform=A.multiply(this._transformToRoot,this._transform,this._computedTransform)};v1.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new A);let r=A.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=A.inverseTransformation(r,t[o]);t[o]=A.multiplyTransformation(s,n[o],t[o])}};var Z2=v1;var dKn=T(S(),1);var sOn=T(S(),1);var iue={name:"AlphaPipelineStage"};iue.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===Ee.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ye.FRAGMENT),s.addUniform("float","u_alphaCutoff",ye.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var G2=iue;var dOn=T(S(),1);var oue={name:"BatchTexturePipelineStage"};oue.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=St(o,e.uniformMap)};var E2=oue;var gOn=T(S(),1);var rue={name:"ClassificationPipelineStage"};rue.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ye.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||iJe(t,o)};function iJe(e,t){let n=Qt.getAttributeBySemantic(e,ft.POSITION);if(!l(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Qt.getAttributeBySemantic(e,ft.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],h=r?i[0]:0,p=c[h],g=0;for(let x=1;x<s;x++){let _=r?i[x]:x,C=c[_];if(C!==p){let V=x-g,L=x;d.push(V),u.push(L),g=L,p=C}}let f=s-g;d.push(f),t.batchLengths=d,t.batchOffsets=u}var I2=rue;var IOn=T(S(),1);var xOn=T(S(),1),X2=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {
        // If the model has a translucent silhouette, it needs to render during the silhouette color command,
        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
        #ifdef HAS_SILHOUETTE
        positionMC *= float(model_silhouettePass);
        #else
        positionMC *= 0.0;
        #endif
    }
    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        positionMC *= 0.0;
    }
}

void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
{
    float show = ceil(feature.color.a);
    positionMC *= show;

    #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
    filterByPassType(positionMC, feature.color);
    #endif
}
`;var TOn=T(S(),1),W2=`void filterByPassType(vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {   
        // If the model has a translucent silhouette, it needs to render during the silhouette color command,
        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
        #ifdef HAS_SILHOUETTE
        if(!model_silhouettePass) {
            discard;
        }
        #else
        discard;
        #endif
    }
    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        discard;
    }
}

void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
{
    vec4 featureColor = feature.color;
    if (featureColor.a == 0.0)
    {
        discard;
    }

    // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
    // So, we only apply in in the fragment shader if the feature ID texture is used.
    #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
    filterByPassType(featureColor);
    #endif

    featureColor = czm_gammaCorrect(featureColor);

    // Classification models compute the diffuse differently.
    #ifdef HAS_CLASSIFICATION
    material.diffuse = featureColor.rgb * featureColor.a;
    #else
    float highlight = ceil(model_colorBlend);
    material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
    #endif
    
    material.alpha *= featureColor.a;
}
`;var sue={name:"CPUStylingPipelineStage"};sue.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(X2),o.addFragmentLines(W2),o.addDefine("USE_CPU_STYLING",void 0,ye.BOTH),l(i.color)||(o.addUniform("float",Kg.COLOR_BLEND_UNIFORM_NAME,ye.FRAGMENT),e.uniformMap[Kg.COLOR_BLEND_UNIFORM_NAME]=function(){return Tc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ye.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ee.TRANSLUCENT}};var P2=sue;var WOn=T(S(),1),aue={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};aue.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Fb=Object.freeze(aue);var E3n=T(S(),1);var vOn=T(S(),1),v2=`void customShaderStage(
    inout czm_modelVertexOutput vsOutput, 
    inout ProcessedAttributes attributes, 
    FeatureIds featureIds,
    Metadata metadata,
    MetadataClass metadataClass,
    MetadataStatistics metadataStatistics
) {
    // VertexInput and initializeInputStruct() are dynamically generated in JS, 
    // see CustomShaderPipelineStage.js
    VertexInput vsInput;
    initializeInputStruct(vsInput, attributes);
    vsInput.featureIds = featureIds;
    vsInput.metadata = metadata;
    vsInput.metadataClass = metadataClass;
    vsInput.metadataStatistics = metadataStatistics;
    vertexMain(vsInput, vsOutput);
    attributes.positionMC = vsOutput.positionMC;
}
`;var FOn=T(S(),1),w2=`void customShaderStage(
    inout czm_modelMaterial material,
    ProcessedAttributes attributes,
    FeatureIds featureIds,
    Metadata metadata,
    MetadataClass metadataClass,
    MetadataStatistics metadataStatistics
) {
    // FragmentInput and initializeInputStruct() are dynamically generated in JS, 
    // see CustomShaderPipelineStage.js
    FragmentInput fsInput;
    initializeInputStruct(fsInput, attributes);
    fsInput.featureIds = featureIds;
    fsInput.metadata = metadata;
    fsInput.metadataClass = metadataClass;
    fsInput.metadataStatistics = metadataStatistics;
    fragmentMain(fsInput, material);
}
`;var e3n=T(S(),1);var MOn=T(S(),1),F2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
}
`;var kOn=T(S(),1),A2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) 
{
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
  setFeatureIdVaryings();
}
`;var Bi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Bi.process=function(e,t,n){let i=e.shaderBuilder;oJe(i);let o=e.runtimeNode.node.instances;l(o)&&rJe(e,o,n),sJe(e,t,n),i.addVertexLines(A2),i.addFragmentLines(F2)};function oJe(e){e.addStruct(Bi.STRUCT_ID_FEATURE_IDS_VS,Bi.STRUCT_NAME_FEATURE_IDS,ye.VERTEX),e.addStruct(Bi.STRUCT_ID_FEATURE_IDS_FS,Bi.STRUCT_NAME_FEATURE_IDS,ye.FRAGMENT),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ye.VERTEX),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ye.FRAGMENT),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ye.VERTEX),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ye.FRAGMENT),e.addFunction(Bi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Bi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ye.VERTEX)}function rJe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Sn.FeatureIdAttribute?aJe(e,s,a):cue(e,s,a,o,1,n);let c=s.label;l(c)&&lue(e,a,c,ye.BOTH)}}function sJe(e,t,n){let i=t.featureIds,r=Qt.getAttributeBySemantic(t,ft.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=ye.BOTH;a instanceof Sn.FeatureIdAttribute?cJe(e,a,c):a instanceof Sn.FeatureIdImplicitRange?cue(e,a,c,r,void 0,n):(lJe(e,a,c,s,n),d=ye.FRAGMENT);let u=a.label;l(u)&&lue(e,c,u,d)}}function aJe(e,t,n){let i=e.shaderBuilder;i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(Bi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function cJe(e,t,n){let i=e.shaderBuilder;i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function cue(e,t,n,i,o,r){dJe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Bi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function lJe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,d=e.shaderBuilder;d.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,ye.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let _=`${r}Transform`;d.addUniform("mat3",_,ye.FRAGMENT),s[_]=function(){return g},p=`vec2(${_} * vec3(${h}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function lue(e,t,n,i){let o=e.shaderBuilder,r=ye.includesVertexShader(i);r&&o.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function dJe(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=uJe(t,n);s=xt.createVertexBuffer({context:o.context,typedArray:d,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Q.FLOAT,strideInBytes:Q.getSizeInBytes(Q.FLOAT),offsetInBytes:0};e.attributes.push(c)}function uJe(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var Jg=Bi;var h3n=T(S(),1);var n3n=T(S(),1),M2=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var o3n=T(S(),1),N2=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
  setMetadataVaryings();
}
`;var Zi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Zi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=mJe(r.propertyAttributes,t,a),d=fJe(r.propertyTextures,a),u=c.concat(d);bJe(i,u),xJe(i),i.addVertexLines(N2),i.addFragmentLines(M2);for(let h=0;h<c.length;h++){let p=c[h];_Je(e,p)}for(let h=0;h<d.length;h++){let p=d[h];SJe(e,p)}};function mJe(e,t,n){return l(e)?e.flatMap(i=>hJe(i,t,n)):[]}function hJe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;u<c.length;u++){let[h,p]=c[u],g=i(t,p.attribute),{glslType:f,variableName:x}=o(g);d[u]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:f,variableName:x,propertyStatistics:a?.properties[h],shaderDestination:ye.BOTH}}return d}function fJe(e,t){return l(e)?e.flatMap(n=>pJe(n,t)):[]}function pJe(e,t){let{sanitizeGlslIdentifier:n}=Qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,d]=r[a];s[a]={metadataVariable:n(c),property:d,type:d.classProperty.type,glslType:d.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:ye.FRAGMENT}}return s}function bJe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:d,propertyStatistics:u}=t[a];n.add(d),l(u)&&c!==ct.ENUM&&i.add(d)}let o=Zi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Zi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,d){e.addStruct(a,a,ye.BOTH);for(let u=0;u<d.length;u++){let{shaderName:h}=d[u],p=d[u].type==="float"?yJe(c):c;e.addStructField(a,p,h)}}}var gJe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function yJe(e){let t=gJe[e];return l(t)?t:e}function xJe(e){e.addStruct(Zi.STRUCT_ID_METADATA_VS,Zi.STRUCT_NAME_METADATA,ye.VERTEX),e.addStruct(Zi.STRUCT_ID_METADATA_FS,Zi.STRUCT_NAME_METADATA,ye.FRAGMENT),e.addStruct(Zi.STRUCT_ID_METADATA_CLASS_VS,Zi.STRUCT_NAME_METADATA_CLASS,ye.VERTEX),e.addStruct(Zi.STRUCT_ID_METADATA_CLASS_FS,Zi.STRUCT_NAME_METADATA_CLASS,ye.FRAGMENT),e.addStruct(Zi.STRUCT_ID_METADATA_STATISTICS_VS,Zi.STRUCT_NAME_METADATA_STATISTICS,ye.VERTEX),e.addStruct(Zi.STRUCT_ID_METADATA_STATISTICS_FS,Zi.STRUCT_NAME_METADATA_STATISTICS,ye.FRAGMENT),e.addFunction(Zi.FUNCTION_ID_INITIALIZE_METADATA_VS,Zi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ye.VERTEX),e.addFunction(Zi.FUNCTION_ID_INITIALIZE_METADATA_FS,Zi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ye.FRAGMENT),e.addFunction(Zi.FUNCTION_ID_SET_METADATA_VARYINGS,Zi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ye.VERTEX)}function _Je(e,t){TJe(e,t),due(e.shaderBuilder,t),uue(e.shaderBuilder,t)}function TJe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=hue({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ye.BOTH,property:o});n.addStructField(Zi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Zi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function SJe(e,t){CJe(e,t),due(e.shaderBuilder,t),uue(e.shaderBuilder,t)}function CJe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:d,texture:u,transform:h}=s.textureReader,p=`u_propertyTexture_${d}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ye.FRAGMENT),i[p]=()=>u),n.addStructField(Zi.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(h)&&!$.equals(h,$.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,ye.FRAGMENT),i[L]=function(){return h},f=`vec2(${L} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${f}).${c}`,_=s.unpackInShader(x),C=hue({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ye.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function due(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=mue(Zi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Zi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ye.includesVertexShader(r)&&(e.addStructField(Zi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function uue(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===ct.ENUM)return;let s=Zi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=mue(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Zi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),ye.includesVertexShader(t.shaderDestination)&&(e.addStructField(Zi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Zi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function mue(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function hue(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:h}=n;return a[o]=()=>u,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Hu=Zi;var p3n=T(S(),1),VJe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Qg=Object.freeze(VJe);var fa={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:_t};fa.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Qg.TRANSLUCENT?r.pass=Ee.TRANSLUCENT:c===Qg.OPAQUE&&(r.pass=void 0);let d=WJe(s,t);if(!d.customShaderEnabled)return;if(FJe(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ye.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ye.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ye.FRAGMENT);let p=Fb.getDefineName(s.mode);i.addDefine(p,void 0,ye.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];i.addUniform(g.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let g=h[p];i.addVarying(g,p)}e.uniformMap=St(e.uniformMap,s.uniformMap)};function LJe(e){let t={};for(let n=0;n<e.length;n++){let i=Qt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var RJe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},ZJe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function fue(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=RJe[t],i=ZJe[t];if(l(n))return{attributeField:[n,e],value:i}}function GJe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=pue(t,n,!1),o=bue(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let u=[i[c].glslType,c];s.push(u),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let d=o[c],u=fue(d);if(!l(u))return fa._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${d} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function EJe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function IJe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=pue(t,n,!0),o=bue(t,n,!0),r,s=[],a=[];for(let d in i){if(!i.hasOwnProperty(d))continue;let h=[i[d].glslType,d];s.push(h),r=`fsInput.attributes.${d} = attributes.${d};`,a.push(r)}for(let d=0;d<o.length;d++){let u=o[d],h=fue(u);if(!l(h))return fa._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${u} = ${h.value};`,a.push(r)}let c=EJe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var XJe={positionWC:!0,positionEC:!0};function pue(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function bue(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||XJe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function WJe(e,t){let n=LJe(t.attributes),i=GJe(e,n),o=IJe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function PJe(e,t){let n=fa.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,fa.STRUCT_NAME_ATTRIBUTES,ye.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=fa.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,fa.STRUCT_NAME_VERTEX_INPUT,ye.VERTEX),e.addStructField(n,fa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Jg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Hu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Hu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Hu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=fa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,fa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ye.VERTEX),e.addFunctionLines(r,o)}function vJe(e,t){let n=fa.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,fa.STRUCT_NAME_ATTRIBUTES,ye.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=fa.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,fa.STRUCT_NAME_FRAGMENT_INPUT,ye.FRAGMENT),e.addStructField(n,fa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Jg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Hu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Hu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Hu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=fa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,fa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ye.FRAGMENT),e.addFunctionLines(r,o)}var wJe=[];function FJe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=wJe;i.enabled&&(PJe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,v2),e.addVertexLines(r)),o.enabled&&(vJe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,w2),e.addFragmentLines(r))}var k2=fa;var F3n=T(S(),1);var U2={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};U2.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ye.VERTEX),i.addFunction(U2.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,U2.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ye.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],d=c.quantization;if(!l(d))continue;let u=c.semantic===ft.POSITION,h=c.semantic===ft.TEXCOORD;if(r&&!u&&!h)continue;let p=Qt.getAttributeInfo(c);MJe(i,p),AJe(e,p)}};function AJe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,ye.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,ye.VERTEX),n.addUniform(c,a,ye.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=gue(d,0),u=gue(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function gue(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function MJe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=NJe(n,i):o=kJe(n),e.addFunctionLines(U2.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function NJe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function kJe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var D2=U2;var dYn=T(S(),1);var M3n=T(S(),1),B2=`void geometryStage(out ProcessedAttributes attributes)
{
  attributes.positionMC = v_positionMC;
  attributes.positionEC = v_positionEC;

  #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
  attributes.positionWC = v_positionWC;
  #endif

  #ifdef HAS_NORMALS
  // renormalize after interpolation
  attributes.normalEC = normalize(v_normalEC);
  #endif

  #ifdef HAS_TANGENTS
  attributes.tangentEC = normalize(v_tangentEC);
  #endif

  #ifdef HAS_BITANGENTS
  attributes.bitangentEC = normalize(v_bitangentEC);
  #endif

  // Everything else is dynamically generated in GeometryPipelineStage
  setDynamicVaryings(attributes);
}
`;var k3n=T(S(),1),O2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
{
    vec4 computedPosition;

    // Compute positions in different coordinate systems
    vec3 positionMC = attributes.positionMC;
    v_positionMC = positionMC;
    v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;

    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
    vec3 position2D = attributes.position2D;
    vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
    computedPosition = czm_projection * vec4(positionEC, 1.0);
    #else
    computedPosition = czm_projection * vec4(v_positionEC, 1.0);
    #endif

    // Sometimes the custom shader and/or style needs this
    #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
    // Note that this is a 32-bit position which may result in jitter on small
    // scales.
    v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
    #endif

    #ifdef HAS_NORMALS
    v_normalEC = normalize(normal * attributes.normalMC);
    #endif

    #ifdef HAS_TANGENTS
    v_tangentEC = normalize(normal * attributes.tangentMC);
    #endif

    #ifdef HAS_BITANGENTS
    v_bitangentEC = normalize(normal * attributes.bitangentMC);
    #endif

    // All other varyings need to be dynamically generated in
    // GeometryPipelineStage
    setDynamicVaryings(attributes);

    return computedPosition;
}
`;var Q3n=T(S(),1);var D3n=T(S(),1),w1=`vec2 computeSt(float featureId)
{
    float stepX = model_textureStep.x;
    float centerX = model_textureStep.y;

    #ifdef MULTILINE_BATCH_TEXTURE
    float stepY = model_textureStep.z;
    float centerY = model_textureStep.w;

    float xId = mod(featureId, model_textureDimensions.x); 
    float yId = floor(featureId / model_textureDimensions.x);
    
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
    #else
    return vec2(centerX + (featureId * stepX), 0.5);
    #endif
}

void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
{   
    int featureId = featureIds.SELECTED_FEATURE_ID;


    if (featureId < model_featuresLength)
    {
        vec2 featureSt = computeSt(float(featureId));

        feature.id = featureId;
        feature.st = featureSt;
        feature.color = texture(model_batchTexture, featureSt);
    }
    // Floating point comparisons can be unreliable in GLSL, so we
    // increment the feature ID to make sure it's always greater
    // then the model_featuresLength - a condition we check for in the
    // pick ID, to avoid sampling the pick texture if the feature ID is
    // greater than the number of features.
    else
    {
        feature.id = model_featuresLength + 1;
        feature.st = vec2(0.0);
        feature.color = vec4(1.0);
    }

    #ifdef HAS_NULL_FEATURE_ID
    if (featureId == model_nullFeatureId) {
        feature.id = featureId;
        feature.st = vec2(0.0);
        feature.color = vec4(1.0);
    }
    #endif
}
`;var Y2={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};Y2.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=UJe(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),DJe(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===ye.BOTH&&i.addVertexLines(w1),i.addFragmentLines(w1)};function yue(e){return e instanceof Sn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function xue(e){return e instanceof Sn.FeatureIdTexture?ye.FRAGMENT:ye.BOTH}function UJe(e,t,n){let i,o;return l(t.instances)&&(o=Qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:xue(o),featureIdDefine:yue(o)}):(o=Qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:xue(o),featureIdDefine:yue(o)})}function DJe(e){e.addStructField(Y2.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(Y2.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(Y2.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var jg=Y2;var zs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};zs.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ye.VERTEX),i.addStruct(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ye.FRAGMENT),i.addStruct(jg.STRUCT_ID_SELECTED_FEATURE,jg.STRUCT_NAME_SELECTED_FEATURE,ye.BOTH),i.addFunction(zs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,zs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ye.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,zs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ye.VERTEX),i.addFunction(zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,zs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ye.FRAGMENT),o.type===dr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ye.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],h=on.getAttributeLocationCount(u.type),p=u.semantic===ft.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,BJe(e,u,g,h,r,s)}qJe(i,t.attributes),t.primitiveType===we.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(O2),i.addFragmentLines(B2)};function BJe(e,t,n,i,o,r){let s=e.shaderBuilder,a=Qt.getAttributeInfo(t),c=o&&!r;i>1?HJe(e,t,n,i):YJe(e,t,n,c),KJe(s,a,c),zJe(s,a),l(t.semantic)&&OJe(s,t),JJe(s,a,o),QJe(s,a,c),jJe(s,a)}function OJe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ft.NORMAL:e.addDefine("HAS_NORMALS");break;case ft.TANGENT:e.addDefine("HAS_TANGENTS");break;case ft.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ft.TEXCOORD:case ft.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function YJe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===ft.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===ft.POSITION,u=d?0:n,h=on.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function HJe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=on.getNumberOfComponents(s)/i,u=Q.getSizeInBytes(a),h=d*u,p=t.byteStride;for(let g=0;g<i;g++){let f=t.byteOffset+g*h,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(x)}}function zJe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function KJe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===ft.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function JJe(e,t,n){let i=zs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function QJe(e,t,n){let i=zs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function jJe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function qJe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===ft.NORMAL?n=!0:r.semantic===ft.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var H2=zs;var _Yn=T(S(),1);var mYn=T(S(),1),z2=`#ifdef USE_IBL_LIGHTING
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
    #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
        // Environment maps were provided, use them for IBL
        vec3 viewDirection = -normalize(position);
        vec3 iblColor = textureIBL(viewDirection, normal, material);
        return iblColor;
    #endif
    
    return vec3(0.0);
}
#endif

#ifdef USE_CLEARCOAT
vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
    vec3 viewDirection = -normalize(position);
    vec3 halfwayDirection = normalize(viewDirection + lightDirection);
    vec3 normal = material.clearcoatNormal;
    float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);

    // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
    vec3 f0 = vec3(0.04);
    vec3 f90 = vec3(1.0);
    // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
    // This is to make it energy conserving with a simple layering function.
    float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
    vec3 F = fresnelSchlick2(f0, f90, NdotV);

    // compute specular reflection from direct lighting
    float roughness = material.clearcoatRoughness;
    float alphaRoughness = roughness * roughness;
    float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
    vec3 directReflection = F * directStrength * NdotL;
    vec3 color = lightColorHdr * directReflection;

    #ifdef SPECULAR_IBL
        // Find the direction in which to sample the environment map
        vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
        vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
        color += iblColor * material.occlusion;
    #endif

    float clearcoatFactor = material.clearcoatFactor;
    vec3 clearcoatColor = color * clearcoatFactor;

    // Dim base layer based on transmission loss through clearcoat
    return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
}
#endif

#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
{
    #ifdef USE_CUSTOM_LIGHT_COLOR
        vec3 lightColorHdr = model_lightColorHdr;
    #else
        vec3 lightColorHdr = czm_lightColorHdr;
    #endif

    vec3 viewDirection = -normalize(position);
    vec3 normal = material.normalEC;
    vec3 lightDirection = normalize(czm_lightDirectionEC);

    vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
    vec3 directColor = lightColorHdr * directLighting;

    // Accumulate colors from base layer
    vec3 color = directColor + material.emissive;
    #ifdef USE_IBL_LIGHTING
        color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
    #endif

    #ifdef USE_CLEARCOAT
        color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
    #endif

    return color;
}
#endif

/**
 * Compute the material color under the current lighting conditions.
 * All other material properties are passed through so further stages
 * have access to them.
 *
 * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
 * @param {ProcessedAttributes} attributes
 */
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
{
    #ifdef LIGHTING_PBR
        #ifdef HAS_NORMALS
            vec3 color = computePbrLighting(material, attributes.positionEC);
        #else
            vec3 color = material.diffuse * material.occlusion + material.emissive;
        #endif
        // In HDR mode, the frame buffer is in linear color space. The
        // post-processing stages (see PostProcessStageCollection) will handle
        // tonemapping. However, if HDR is not enabled, we must tonemap else large
        // values may be clamped to 1.0
        #ifndef HDR
            color = czm_pbrNeutralTonemapping(color);
        #endif
    #else // unlit
        vec3 color = material.diffuse;
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
        // The colors resulting from point cloud styles are adjusted differently.
        color = czm_gammaCorrect(color);
    #elif !defined(HDR)
        // If HDR is not enabled, the frame buffer stores sRGB colors rather than
        // linear colors so the linear value must be converted.
        color = czm_linearToSrgb(color);
    #endif

    material.diffuse = color;
}
`;var fYn=T(S(),1),$Je={UNLIT:0,PBR:1},vf=Object.freeze($Je);var _ue={name:"LightingPipelineStage"};_ue.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ye.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ye.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===vf.PBR?o.addDefine("LIGHTING_PBR",void 0,ye.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ye.FRAGMENT),o.addFragmentLines(z2)};var K2=_ue;var AYn=T(S(),1);var SYn=T(S(),1),J2=`// If the style color is white, it implies the feature has not been styled.
bool isDefaultStyleColor(vec3 color)
{
    return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}

vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
{
    vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
    vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
    return color;
}

vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
{
    return vec2(textureTransform * vec3(texCoord, 1.0));
}

#ifdef HAS_NORMAL_TEXTURE
vec2 getNormalTexCoords()
{
    vec2 texCoord = TEXCOORD_NORMAL;
    #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
        texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));
    #endif
    return texCoord;
}
#endif

#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
{
    vec2 tex_dx = dFdx(normalTexCoords);
    vec2 tex_dy = dFdy(normalTexCoords);
    float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
    vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
    return tangent / determinant;
}
#endif

#ifdef USE_ANISOTROPY
struct NormalInfo {
    vec3 tangent;
    vec3 bitangent;
    vec3 normal;
    vec3 geometryNormal;
};

NormalInfo getNormalInfo(ProcessedAttributes attributes)
{
    vec3 geometryNormal = attributes.normalEC;
    #ifdef HAS_NORMAL_TEXTURE
        vec2 normalTexCoords = getNormalTexCoords();
    #endif

    #ifdef HAS_BITANGENTS
        vec3 tangent = attributes.tangentEC;
        vec3 bitangent = attributes.bitangentEC;
    #else // Assume HAS_NORMAL_TEXTURE
        vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
        tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
        vec3 bitangent = normalize(cross(geometryNormal, tangent));
    #endif

    #ifdef HAS_NORMAL_TEXTURE
        mat3 tbn = mat3(tangent, bitangent, geometryNormal);
        vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
        normalSample = 2.0 * normalSample - 1.0;
        #ifdef HAS_NORMAL_TEXTURE_SCALE
            normalSample.xy *= u_normalTextureScale;
        #endif
        vec3 normal = normalize(tbn * normalSample);
    #else
        vec3 normal = geometryNormal;
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
        if (czm_backFacing()) {
            tangent *= -1.0;
            bitangent *= -1.0;
            normal *= -1.0;
            geometryNormal *= -1.0;
        }
    #endif

    NormalInfo normalInfo;
    normalInfo.tangent = tangent;
    normalInfo.bitangent = bitangent;
    normalInfo.normal = normal;
    normalInfo.geometryNormal = geometryNormal;

    return normalInfo;
}
#endif

#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
    vec2 normalTexCoords = getNormalTexCoords();

    // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
    #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
    #else
        vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
        t = normalize(t - geometryNormal * dot(geometryNormal, t));
        vec3 b = normalize(cross(geometryNormal, t));
    #endif

    mat3 tbn = mat3(t, b, geometryNormal);
    vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
    normalSample = 2.0 * normalSample - 1.0;
    #ifdef HAS_NORMAL_TEXTURE_SCALE
        normalSample.xy *= u_normalTextureScale;
    #endif
    return normalize(tbn * normalSample);
}
#endif

#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
    vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
        normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
    #endif

    // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
    #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
    #else
        vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
        t = normalize(t - geometryNormal * dot(geometryNormal, t));
        vec3 b = normalize(cross(geometryNormal, t));
    #endif

    mat3 tbn = mat3(t, b, geometryNormal);
    vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
    normalSample = 2.0 * normalSample - 1.0;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
        normalSample.xy *= u_clearcoatNormalTextureScale;
    #endif
    return normalize(tbn * normalSample);
}
#endif

#ifdef HAS_NORMALS
vec3 computeNormal(ProcessedAttributes attributes)
{
    // Geometry normal. This is already normalized 
    vec3 normal = attributes.normalEC;

    #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
        normal = getNormalFromTexture(attributes, normal);
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
        if (czm_backFacing()) {
            normal = -normal;
        }
    #endif

    return normal;
}
#endif

#ifdef HAS_BASE_COLOR_TEXTURE
vec4 getBaseColorFromTexture()
{
    vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
    #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
        baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
    #endif

    vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));

    #ifdef HAS_BASE_COLOR_FACTOR
        baseColorWithAlpha *= u_baseColorFactor;
    #endif

    return baseColorWithAlpha;
}
#endif

#ifdef HAS_EMISSIVE_TEXTURE
vec3 getEmissiveFromTexture()
{
    vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
    #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
        emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
    #endif

    vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
    #ifdef HAS_EMISSIVE_FACTOR
        emissive *= u_emissiveFactor;
    #endif

    return emissive;
}
#endif

#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
void setSpecularGlossiness(inout czm_modelMaterial material)
{
    #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
        vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
        #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
            specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
        #endif

        vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
        vec3 specular = specularGlossiness.rgb;
        float glossiness = specularGlossiness.a;
        #ifdef HAS_LEGACY_SPECULAR_FACTOR
            specular *= u_legacySpecularFactor;
        #endif

        #ifdef HAS_GLOSSINESS_FACTOR
            glossiness *= u_glossinessFactor;
        #endif
    #else
        #ifdef HAS_LEGACY_SPECULAR_FACTOR
            vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
        #else
            vec3 specular = vec3(1.0);
        #endif

        #ifdef HAS_GLOSSINESS_FACTOR
            float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
        #else
            float glossiness = 1.0;
        #endif
    #endif

    #ifdef HAS_DIFFUSE_TEXTURE
        vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
        #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
            diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
        #endif

        vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
        #ifdef HAS_DIFFUSE_FACTOR
            diffuse *= u_diffuseFactor;
        #endif
    #elif defined(HAS_DIFFUSE_FACTOR)
        vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
    #else
        vec4 diffuse = vec4(1.0);
    #endif

    material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
    // the specular glossiness extension's alpha overrides anything set
    // by the base material.
    material.alpha = diffuse.a;

    material.specular = specular;

    // glossiness is the opposite of roughness, but easier for artists to use.
    material.roughness = 1.0 - glossiness;
}
#elif defined(LIGHTING_PBR)
float setMetallicRoughness(inout czm_modelMaterial material)
{
    #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
        vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
        #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
            metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
        #endif

        vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
        float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
        float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
        #ifdef HAS_METALLIC_FACTOR
            metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
        #endif

        #ifdef HAS_ROUGHNESS_FACTOR
            roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
        #endif
    #else
        #ifdef HAS_METALLIC_FACTOR
            float metalness = clamp(u_metallicFactor, 0.0, 1.0);
        #else
            float metalness = 1.0;
        #endif

        #ifdef HAS_ROUGHNESS_FACTOR
            float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
        #else
            float roughness = 1.0;
        #endif
    #endif

    // dielectrics use f0 = 0.04, metals use albedo as f0
    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
    vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);

    material.specular = f0;

    // diffuse only applies to dielectrics.
    material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);

    // This is perceptual roughness. The square of this value is used for direct lighting
    material.roughness = roughness;

    return metalness;
}
#ifdef USE_SPECULAR
void setSpecular(inout czm_modelMaterial material, in float metalness)
{
    #ifdef HAS_SPECULAR_TEXTURE
        vec2 specularTexCoords = TEXCOORD_SPECULAR;
        #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
            specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);
        #endif
        float specularWeight = texture(u_specularTexture, specularTexCoords).a;
        #ifdef HAS_SPECULAR_FACTOR
            specularWeight *= u_specularFactor;
        #endif
    #else
        #ifdef HAS_SPECULAR_FACTOR
            float specularWeight = u_specularFactor;
        #else
            float specularWeight = 1.0;
        #endif
    #endif

    #ifdef HAS_SPECULAR_COLOR_TEXTURE
        vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
        #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
            specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
        #endif
        vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
        vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
        #ifdef HAS_SPECULAR_COLOR_FACTOR
            specularColorFactor *= u_specularColorFactor;
        #endif
    #else
        #ifdef HAS_SPECULAR_COLOR_FACTOR
            vec3 specularColorFactor = u_specularColorFactor;
        #else
            vec3 specularColorFactor = vec3(1.0);
        #endif
    #endif
    material.specularWeight = specularWeight;
    vec3 f0 = material.specular;
    vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
    material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
}
#endif
#ifdef USE_ANISOTROPY
void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
{
    mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
    float anisotropyStrength = u_anisotropy.z;

    vec2 direction = vec2(1.0, 0.0);
    #ifdef HAS_ANISOTROPY_TEXTURE
        vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
        #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
            anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
        #endif
        vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
        direction = anisotropySample.rg * 2.0 - vec2(1.0);
        anisotropyStrength *= anisotropySample.b;
    #endif

    direction = rotation * direction;
    mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
    vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
    vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);

    material.anisotropicT = anisotropicT;
    material.anisotropicB = anisotropicB;
    material.anisotropyStrength = anisotropyStrength;
}
#endif
#ifdef USE_CLEARCOAT
void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
{
    #ifdef HAS_CLEARCOAT_TEXTURE
        vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
        #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
            clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
        #endif
        float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
        #ifdef HAS_CLEARCOAT_FACTOR
            clearcoatFactor *= u_clearcoatFactor;
        #endif
    #else
        #ifdef HAS_CLEARCOAT_FACTOR
            float clearcoatFactor = u_clearcoatFactor;
        #else
            // PERFORMANCE_IDEA: this case should turn the whole extension off
            float clearcoatFactor = 0.0;
        #endif
    #endif

    #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
        vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
        #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
            clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
        #endif
        float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
        #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
            clearcoatRoughness *= u_clearcoatRoughnessFactor;
        #endif
    #else
        #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
            float clearcoatRoughness = u_clearcoatRoughnessFactor;
        #else
            float clearcoatRoughness = 0.0;
        #endif
    #endif

    material.clearcoatFactor = clearcoatFactor;
    // This is perceptual roughness. The square of this value is used for direct lighting
    material.clearcoatRoughness = clearcoatRoughness;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
        material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
    #else
        material.clearcoatNormal = attributes.normalEC;
    #endif
}
#endif
#endif

void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
{
    #ifdef USE_ANISOTROPY
        NormalInfo normalInfo = getNormalInfo(attributes);
        material.normalEC = normalInfo.normal;
    #elif defined(HAS_NORMALS)
        material.normalEC = computeNormal(attributes);
    #endif

    vec4 baseColorWithAlpha = vec4(1.0);
    // Regardless of whether we use PBR, set a base color
    #ifdef HAS_BASE_COLOR_TEXTURE
        baseColorWithAlpha = getBaseColorFromTexture();
    #elif defined(HAS_BASE_COLOR_FACTOR)
        baseColorWithAlpha = u_baseColorFactor;
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
        baseColorWithAlpha = v_pointCloudColor;
    #elif defined(HAS_COLOR_0)
        vec4 color = attributes.color_0;
        // .pnts files store colors in the sRGB color space
        #ifdef HAS_SRGB_COLOR
            color = czm_srgbToLinear(color);
        #endif
        baseColorWithAlpha *= color;
    #endif

    #ifdef USE_CPU_STYLING
        baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
    #endif
    material.baseColor = baseColorWithAlpha;
    material.diffuse = baseColorWithAlpha.rgb;
    material.alpha = baseColorWithAlpha.a;

    #ifdef HAS_OCCLUSION_TEXTURE
        vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
        #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
            occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
        #endif
        material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
    #endif

    #ifdef HAS_EMISSIVE_TEXTURE
        material.emissive = getEmissiveFromTexture();
    #elif defined(HAS_EMISSIVE_FACTOR)
        material.emissive = u_emissiveFactor;
    #endif

    #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
        setSpecularGlossiness(material);
    #elif defined(LIGHTING_PBR)
        float metalness = setMetallicRoughness(material);
        #ifdef USE_SPECULAR
            setSpecular(material, metalness);
        #endif
        #ifdef USE_ANISOTROPY
            setAnisotropy(material, normalInfo);
        #endif
        #ifdef USE_CLEARCOAT
            setClearcoat(material, attributes);
        #endif
    #endif
}
`;var{Material:eQe,MetallicRoughness:VJ,SpecularGlossiness:LJ,Specular:Tue,Clearcoat:Sue}=Sn,Cue={name:"MaterialPipelineStage",_processTexture:Yl,_processTextureTransform:Vue};Cue.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:h}=n.context;nQe(i,r,s,d,u,h,c),l(i.specularGlossiness)?iQe(i.specularGlossiness,r,s,d,c):(l(i.specular)&&Qt.supportedExtensions.KHR_materials_specular&&oQe(i.specular,r,s,d,c),l(i.anisotropy)&&Qt.supportedExtensions.KHR_materials_anisotropy&&sQe(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Qt.supportedExtensions.KHR_materials_clearcoat&&aQe(i.clearcoat,r,s,d,c),cQe(i.metallicRoughness,r,s,d,c));let p=Qt.getAttributeBySemantic(t,ft.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=vf.UNLIT:g.lightingModel=vf.PBR;let f=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=f;let x=e.alphaOptions;i.alphaMode===Wf.BLEND?x.pass=Ee.TRANSLUCENT:i.alphaMode===Wf.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(J2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ye.BOTH)};function Vue(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ye.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ye.FRAGMENT),t[s]=function(){return n.transform}}function tQe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ye.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ye.FRAGMENT),t[s]=function(){return n.scale}}function Yl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ye.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ye.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,c,ye.FRAGMENT);let u=n.transform;l(u)&&!$.equals(u,$.IDENTITY)&&Vue(e,t,n,i,o);let{scale:h}=n;l(h)&&h!==1&&tQe(e,t,n,i,o)}function nQe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:d,occlusionTexture:u}=e;l(a)&&!m.equals(a,eQe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ye.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ye.FRAGMENT),l(c)&&!s&&Yl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(d)&&!s&&Yl(n,t,d,"u_normalTexture","NORMAL",o),l(u)&&!s&&Yl(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function iQe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ye.FRAGMENT),l(r)&&!o&&Yl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!se.equals(s,LJ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ye.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ye.FRAGMENT)),l(a)&&!o&&Yl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!m.equals(c,LJ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ye.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ye.FRAGMENT)),l(d)&&d!==LJ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ye.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ye.FRAGMENT))}function oQe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,ye.FRAGMENT),l(r)&&!o&&Yl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Tue.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ye.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ye.FRAGMENT)),l(a)&&!o&&Yl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!m.equals(c,Tue.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ye.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ye.FRAGMENT))}var rQe=new m;function sQe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ye.FRAGMENT),l(a)&&!o&&Yl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",ye.FRAGMENT),t.u_anisotropy=function(){return m.fromElements(c,d,r,rQe)}}function aQe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,ye.FRAGMENT),l(r)&&r!==Sue.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ye.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ye.FRAGMENT)),l(s)&&!o&&Yl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Sue.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ye.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ye.FRAGMENT)),l(c)&&!o&&Yl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Yl(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function cQe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ye.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Yl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!se.equals(s,VJ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ye.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ye.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Yl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==VJ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ye.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ye.FRAGMENT));let d=e.roughnessFactor;l(d)&&d!==VJ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ye.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ye.FRAGMENT))}var Q2=Cue;var kYn=T(S(),1);var al={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};al.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(al.METADATA_PICKING_VALUE_TYPE,"float",ye.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_STRING,"0.0",ye.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ye.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ye.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ye.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ye.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ye.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${al.METADATA_PICKING_VALUE_TYPE} value = ${al.METADATA_PICKING_VALUE_TYPE}(${al.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${al.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${al.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${al.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${al.METADATA_PICKING_VALUE_COMPONENT_W};`],ye.FRAGMENT)};var Pd=al;var QYn=T(S(),1);var DYn=T(S(),1),j2=`void morphTargetsStage(inout ProcessedAttributes attributes) 
{
    vec3 positionMC = attributes.positionMC;
    attributes.positionMC = getMorphedPosition(positionMC);

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = getMorphedNormal(normalMC);
    #endif

    #ifdef HAS_TANGENTS
    vec3 tangentMC = attributes.tangentMC;
    attributes.tangentMC = getMorphedTangent(tangentMC);
    #endif
}`;var ka={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};ka.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ye.VERTEX),fQe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let h=c[u],p=h.semantic;p!==ft.POSITION&&p!==ft.NORMAL&&p!==ft.TANGENT||(dQe(e,h,e.attributeIndex,a),e.attributeIndex++)}}pQe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ye.VERTEX),n.addVertexLines(j2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=St(s,e.uniformMap)};var lQe={attributeString:void 0,functionId:void 0};function dQe(e,t,n,i){let o=e.shaderBuilder;uQe(e,t,n);let r=mQe(t,lQe);hQe(o,r,i)}function uQe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:on.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function mQe(e,t){switch(e.semantic){case ft.POSITION:t.attributeString="Position",t.functionId=ka.FUNCTION_ID_GET_MORPHED_POSITION;break;case ft.NORMAL:t.attributeString="Normal",t.functionId=ka.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ft.TANGENT:t.attributeString="Tangent",t.functionId=ka.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function hQe(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function fQe(e){e.addFunction(ka.FUNCTION_ID_GET_MORPHED_POSITION,ka.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ye.VERTEX),e.addFunctionLines(ka.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(ka.FUNCTION_ID_GET_MORPHED_NORMAL,ka.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ye.VERTEX),e.addFunctionLines(ka.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(ka.FUNCTION_ID_GET_MORPHED_TANGENT,ka.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ye.VERTEX),e.addFunctionLines(ka.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function pQe(e){e.addFunctionLines(ka.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(ka.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(ka.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var q2=ka;var aHn=T(S(),1);var Lue={name:"PickingPipelineStage"};Lue.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)bQe(e,t,a,i);else if(l(a))gQe(e,i);else{let c=Rue(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",ye.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function Rue(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(dr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function bQe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Qt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Qt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ye.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(u.pickTexture,u.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function gQe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let h=0;h<n;h++){let p=Rue(e,h),g=t.createPickId(p);s.push(g),i[h]=g;let f=g.color;o[h*4+0]=B.floatToByte(f.red),o[h*4+1]=B.floatToByte(f.green),o[h*4+2]=B.floatToByte(f.blue),o[h*4+3]=B.floatToByte(f.alpha)}r._pickIds=i;let a=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,ye.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var $2=Lue;var IHn=T(S(),1);var lHn=T(S(),1),yQe={ADD:0,REPLACE:1},Uo=Object.freeze(yQe);var uHn=T(S(),1),eP=`float getPointSizeFromAttenuation(vec3 positionEC) {
  // Variables are packed into a single vector to minimize gl.uniformXXX() calls
  float pointSize = model_pointCloudParameters.x;
  float geometricError = model_pointCloudParameters.y;
  float depthMultiplier = model_pointCloudParameters.z;

  float depth = -positionEC.z;
  return min((geometricError / depth) * depthMultiplier, pointSize);
}

#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#endif

#ifdef HAS_POINT_CLOUD_COLOR_STYLE
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
}
#endif

#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  return getPointSizeFromAttenuation(v_positionEC);
}
#endif

#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
float pointCloudBackFaceCullingStage() {
  #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
  // This needs to be computed in eye coordinates so we can't use attributes.normalMC
  return step(-v_normalEC.z, 0.0);
  #else
  return 1.0;
  #endif
}
#endif`;var xQe=new se,Gue={name:"PointCloudStylingPipelineStage"};Gue.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let x=CQe(a),_=VQe(r,x);LQe(i,_);let V=RQe(_).indexOf("normalMC")>=0,L=Qt.getAttributeBySemantic(t,ft.NORMAL);if(V&&!L)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ye.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Ee.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ye.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ye.VERTEX);let h,p,g;dr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===Uo.ADD),i.addUniform("vec4","model_pointCloudParameters",ye.VERTEX),i.addVertexLines(eP);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=xQe,_=1;p&&(_=g?5:h.tileset.memoryAdjustedScreenSpaceError),x.x=y(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=_Qe(e,t,u,h);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,R;return n.mode===oe.SCENE2D||L instanceof an?R=Number.POSITIVE_INFINITY:R=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=R,p&&(x.w=h.tileset.timeSinceLoad),x}};var Zue=new m;function _Qe(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=Qt.getAttributeBySemantic(t,ft.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,Zue);a=A.multiplyByPointAsVector(s,a,Zue);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var TQe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},SQe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function CQe(e){let t=Ye(SQe);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var RJ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function VQe(e,t){let n=TQe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${RJ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${RJ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${RJ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function LQe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ye.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ye.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ye.VERTEX),e.addVertexLines(o))}function ZJ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function RQe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&ZJ(t,o),l(n)&&ZJ(n,o),l(i)&&ZJ(i,o),o}var tP=Gue;var UHn=T(S(),1);var WHn=T(S(),1),nP=`void primitiveOutlineStage() {
    v_outlineCoordinates = a_outlineCoordinates;
}
`;var vHn=T(S(),1),iP=`void primitiveOutlineStage(inout czm_modelMaterial material) {
    if (!model_showOutline) {
        return;
    }

    float outlineX = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
    float outlineY = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
    float outlineZ = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
    float outlineness = max(outlineX, max(outlineY, outlineZ));

    material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
}

`;var Eue={name:"PrimitiveOutlinePipelineStage"};Eue.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ye.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:on.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ye.FRAGMENT);let a=aT.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",ye.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",ye.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(nP),i.addFragmentLines(iP)};var oP=Eue;var zHn=T(S(),1);var Iue={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Xue,_count2DPositions:Wue,_countMorphTargetAttributes:Pue,_countMaterialTextures:vue,_countFeatureIdTextures:wue,_countBinaryMetadata:Fue};Iue.process=function(e,t,n){let i=e.model,o=i.statistics;Xue(o,t),Wue(o,e.runtimePrimitive),Pue(o,t),vue(o,t.material),wue(o,t.featureIds),Fue(o,i)};function Xue(e,t){let n=l(t.indices)?t.indices.count:Qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===we.POINTS?e.pointsLength+=n:we.isTriangles(i)&&(e.trianglesLength+=ZQe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function ZQe(e,t){switch(e){case we.TRIANGLES:return t/3;case we.TRIANGLE_STRIP:case we.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Wue(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Pue(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function vue(e,t){let n=GQe(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function GQe(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function wue(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Sn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Fue(e,t){let n=t.structuralMetadata;l(n)&&(EQe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function EQe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var rP=Iue;var czn=T(S(),1);var IQe=new A,XQe=new A,Aue={name:"SceneMode2DPipelineStage"};Aue.process=function(e,t,n){let i=Qt.getAttributeBySemantic(t,ft.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=A.multiplyTransformation(s,a,IQe),d=vQe(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let x=AQe(i,c,d,n);u.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ye.VERTEX),o.addUniform("mat4","u_modelView2D",ye.VERTEX);let p=A.fromTranslation(d.center,new A),g=n.context,f={u_modelView2D:function(){return A.multiplyTransformation(g.uniformState.view,p,XQe)}};e.uniformMap=St(f,e.uniformMap)};var WQe=new m,PQe=new m;function vQe(e,t,n){let i=A.multiplyByPoint(t,e.positionMin,WQe),o=Di.computeActualEllipsoidPosition(n,i,i),r=A.multiplyByPoint(t,e.positionMax,PQe),s=Di.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,s,new le)}var Mue=new m;function wQe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,Mue),c=m.multiplyComponents(a,r,a),d=m.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function FQe(e,t,n,i){let o;l(e.quantization)?o=wQe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=m.fromArray(o,c,Mue);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=A.multiplyByPoint(t,d,d),h=Di.computeActualEllipsoidPosition(i,u,u),p=m.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function AQe(e,t,n,i){let o=Ye(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=FQe(e,t,r,o),a=xt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var sP=Aue;var bzn=T(S(),1);var dzn=T(S(),1),aP=`void skinningStage(inout ProcessedAttributes attributes) 
{
    mat4 skinningMatrix = getSkinningMatrix();
    mat3 skinningMatrixMat3 = mat3(skinningMatrix);

    vec4 positionMC = vec4(attributes.positionMC, 1.0);
    attributes.positionMC = vec3(skinningMatrix * positionMC);

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = skinningMatrixMat3 * normalMC;
    #endif

    #ifdef HAS_TANGENTS
    vec3 tangentMC = attributes.tangentMC;
    attributes.tangentMC = skinningMatrixMat3 * tangentMC;
    #endif
}`;var uT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};uT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ye.VERTEX),NQe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ye.VERTEX),n.addVertexLines(aP);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=St(r,e.uniformMap)};function MQe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===ft.JOINTS||r.semantic===ft.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function NQe(e,t){e.addFunction(uT.FUNCTION_ID_GET_SKINNING_MATRIX,uT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ye.VERTEX),e.addFunctionLines(uT.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=MQe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(uT.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(uT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var cP=uT;var Czn=T(S(),1);var yzn=T(S(),1),lP=`void verticalExaggerationStage(
  inout ProcessedAttributes attributes
) {
  // Compute the distance from the camera to the local center of curvature.
  vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
  vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
  // Curvature = 1 / radius of curvature.
  float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
  float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;

  // Compute the approximate ellipsoid normal at the vertex position.
  // Uses a circular approximation for the Earth curvature along the geodesic.
  vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
  vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
  vec3 vertexNormal = normalize(centerToVertex);

  // Estimate the (sine of the) angle between the camera direction and the vertex normal
  float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
  float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
  float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
  bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;

  // Approximate the change in height above the ellipsoid, from camera to vertex position.
  float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
  float smallAngleVersine = 0.5 * sinTheta * sinTheta;
  float versine = isSmallAngle ? smallAngleVersine : exactVersine;
  float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
  float vertexHeight = czm_eyeHeight + dHeight;

  // Transform the approximate vertex normal to model coordinates.
  vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
  vertexNormalMC = normalize(vertexNormalMC);

  // Compute the exaggeration and apply it along the approximate vertex normal.
  float stretch = u_verticalExaggerationAndRelativeHeight.x;
  float shift = u_verticalExaggerationAndRelativeHeight.y;
  float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
  attributes.positionMC += exaggeration * vertexNormalMC;
}
`;var Nue={name:"VerticalExaggerationPipelineStage"},kQe=new D;Nue.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(lP),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ye.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ye.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return D.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,kQe)}};var dP=Nue;var vzn=T(S(),1);var kue={name:"WireframePipelineStage"};kue.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ye.FRAGMENT);let o=e.model,r=UQe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=we.LINES,e.count=qC.getWireframeIndicesCount(a,c)};function UQe(e,t,n){let o=Qt.getAttributeBySemantic(e,ft.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,h=t.count;l(u)&&r?(s=u.sizeInBytes===h?new Uint8Array(h):Ae.createTypedArray(o,h),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=qC.createWireframeIndices(a,o,s),d=Ae.fromSizeInBytes(c.BYTES_PER_ELEMENT);return xt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:d})}var uP=kue;function Uue(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Uue.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==Fb.REPLACE_MATERIAL,_=Qt.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&we.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,R=l(V)&&V.backFaceCulling,G=n.primitiveType===we.POINTS&&(l(s)||L||R),I=o._enableShowOutline&&l(n.outlineCoordinates),v=DQe(o,i,n),P=l(o.classificationType);d&&t.push(sP),t.push(H2),C&&t.push(uP),P&&t.push(I2),h&&t.push(q2),p&&t.push(cP),G&&t.push(tP),_&&t.push(D2),x&&t.push(Q2),t.push(Jg),t.push(Hu),t.push(Pd),v.hasPropertyTable&&(t.push(jg),t.push(E2),t.push(P2)),u&&t.push(dP),g&&t.push(k2),t.push(K2),o.allowPicking&&t.push($2),I&&t.push(oP),t.push(G2),t.push(rP)};function DQe(e,t,n){let i;return l(t.instances)&&(i=Qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var mP=Uue;var fKn=T(S(),1);function GJ(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],BQe(this)}Object.defineProperties(GJ.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function BQe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let h=n[c],p=Due(u,h,new A);a.push(p)}}function Due(e,t,n){let i=A.multiplyTransformation(e.transformToRoot,e.transform,n);return n=A.multiplyTransformation(i,t,n),n}GJ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Due(i,o,e[n])}};var hP=GJ;var SKn=T(S(),1);var bKn=T(S(),1);function OQe(){this.pass=void 0,this.alphaCutoff=void 0}var fP=OQe;function YQe(e){this.shaderBuilder=new Vx,this.model=e,this.uniformMap={},this.alphaOptions=new fP,this.renderStateOptions=Ue.getState(Ue.fromCache({depthTest:{enabled:!0,func:bc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var pP=YQe;var PKn=T(S(),1);var VKn=T(S(),1),bP=`void silhouetteStage(inout vec4 color) {
    if(model_silhouettePass) {
        color = czm_gammaCorrect(model_silhouetteColor);
    }
}`;var RKn=T(S(),1),gP=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
     #ifdef HAS_NORMALS
     if(model_silhouettePass) {
          vec3 normal = normalize(czm_normal3D * attributes.normalMC);
          normal.x *= czm_projection[0][0];
          normal.y *= czm_projection[1][1];
          positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
    }
    #endif
}
`;var Jk={name:"ModelSilhouettePipelineStage"};Jk.silhouettesLength=0;Jk.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++Jk.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ye.BOTH),i.addVertexLines(gP),i.addFragmentLines(bP),i.addUniform("vec4","model_silhouetteColor",ye.FRAGMENT),i.addUniform("float","model_silhouetteSize",ye.VERTEX),i.addUniform("bool","model_silhouettePass",ye.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=St(o,e.uniformMap),e.hasSilhouette=!0};var yP=Jk;var kKn=T(S(),1);var wKn=T(S(),1),xP=`void modelSplitterStage()
{
    // Don't split when rendering the shadow map, because it is rendered from
    // the perspective of a totally different camera.
#ifndef SHADOW_MAP
    if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
}
`;var Qk={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Qk.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ye.FRAGMENT),i.addFragmentLines(xP);let o={};i.addUniform("float",Qk.SPLIT_DIRECTION_UNIFORM_NAME,ye.FRAGMENT),o[Qk.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=St(o,e.uniformMap)};var _P=Qk;var BKn=T(S(),1);function HQe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var TP=HQe;var tJn=T(S(),1);var zKn=T(S(),1);function zQe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,vf.UNLIT)}var SP=zQe;function KQe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new SP,this.pickId=void 0}var CP=KQe;var nQn=T(S(),1);var pJn=T(S(),1);function IJ(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==Dn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Dn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],qQe(this)}function JQe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:bc.LESS_OR_EQUAL},depthMask:!1}}var QQe={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},jQe={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Yue=[];function qQe(e){let t=e._command,n=Yue;if(e._useDebugWireframe){t.pass=Ee.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=VP(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ee.TERRAIN_CLASSIFICATION,s=EJ(t,r),a=Bue(t,r);n.length=0,n.push(s,a),e._commandListTerrain=VP(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Oue(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ee.CESIUM_3D_TILE_CLASSIFICATION,s=EJ(t,r),a=Bue(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=VP(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Oue(e,n,e._commandList3DTilesPicking))}}function VP(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let h=0;h<a;h++){let p=t[h],g=$e.shallowClone(p);g.count=d,g.offset=u,n.push(g)}}return n}function EJ(e,t){let n=$e.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ee.TERRAIN_CLASSIFICATION?Bn.ALWAYS:Bn.EQUAL,o=JQe(i);return n.renderState=Ue.fromCache(o),n}function Bue(e,t){let n=$e.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ue.fromCache(QQe),n}var $Qe=[];function Oue(e,t,n){let i=Ue.fromCache(jQe),o=t[0],r=t[1],s=$e.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=$e.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=$Qe;return c.length=0,c.push(s,a),VP(e,c,n)}Object.defineProperties(IJ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=le.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});IJ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=EJ(this._command,o),s=Yue;s.length=0,s.push(r),this._commandListIgnoreShow=VP(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var LP=IJ;var FJn=T(S(),1);function jk(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Ee.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,h=c;this._command=t,this._modelMatrix=A.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new A,this._boundingVolume2D=new le,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=h,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,e4e(this)}function Ab(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}Ab.clone=function(e){return new Ab({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function e4e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new Ab({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Ab({command:a4e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Ab({command:h4e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Ab({command:f4e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Ab({command:c4e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Ab({command:l4e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(jk.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=le.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,n4e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,i4e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,o4e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,r4e(this))}}});function t4e(e,t){let n=e._modelMatrix;e._modelMatrix2D=A.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function n4e(e){let t=e.shadows,n=Tn.castShadows(t),i=Tn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function i4e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ye(r.renderState,!0);s.cull.enabled=t,r.renderState=Ue.fromCache(s)}}}function o4e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ye(r.renderState,!0);s.cull.face=t,r.renderState=Ue.fromCache(s)}}}function r4e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}jk.prototype.pushCommands=function(e,t){let n=Hue(this,e);n&&!this._has2DCommands&&(s4e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(t4e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==hh.ALL_OPAQUE&&A1(t,this._translucentCommand,n),i===hh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||A1(o._backfaceCommands,this._skipLodBackfaceCommand,n),d4e(this,r,n),A1(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){A1(t,this._silhouetteModelCommand,n);return}return A1(t,this._originalCommand,n),t}};jk.prototype.pushSilhouetteCommands=function(e,t){let n=Hue(this,e);return A1(t,this._silhouetteColorCommand,n),t};function A1(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Hue(e,t){if(t.mode!==oe.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*W.PI;return o<s&&r>s||o<-s&&r>-s}function F1(e,t){if(!l(t))return;let n=Ab.clone(t),i=$e.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function s4e(e){F1(e,e._originalCommand),F1(e,e._translucentCommand),F1(e,e._skipLodBackfaceCommand),F1(e,e._skipLodStencilCommand),F1(e,e._silhouetteModelCommand),F1(e,e._silhouetteColorCommand)}function a4e(e){let t=$e.shallowClone(e);t.pass=Ee.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function c4e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(o),i}function l4e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ee.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ee.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function d4e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=u4e(o);if(r!==s){let a=m4e(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function u4e(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function m4e(e){return Ut.CESIUM_3D_TILE_MASK|e<<Ut.SKIP_LOD_BIT_SHIFT}function h4e(e){let t=$e.shallowClone(e),n=Ye(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ti.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ye(t.uniformMap),o=new D(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ue.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function f4e(e){let t=$e.shallowClone(e),n=Ye(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ut.SKIP_LOD_MASK,i.reference=Ut.CESIUM_3D_TILE_MASK,i.frontFunction=Bn.GREATER_OR_EQUAL,i.frontOperation.zPass=ht.REPLACE,i.backFunction=Bn.GREATER_OR_EQUAL,i.backOperation.zPass=ht.REPLACE,n.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,t.renderState=Ue.fromCache(n),t}var RP=jk;var MJn=T(S(),1),ZP=`precision highp float;

czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
    czm_modelVertexOutput vsOutput;
    vsOutput.positionMC = positionMC;
    vsOutput.pointSize = 1.0;
    return vsOutput;
}

void main()
{
    // Initialize the attributes struct with all
    // attributes except quantized ones.
    ProcessedAttributes attributes;
    initializeAttributes(attributes);

    // Dequantize the quantized ones and add them to the
    // attributes struct.
    #ifdef USE_DEQUANTIZATION
    dequantizationStage(attributes);
    #endif

    #ifdef HAS_MORPH_TARGETS
    morphTargetsStage(attributes);
    #endif

    #ifdef HAS_SKINNING
    skinningStage(attributes);
    #endif

    #ifdef HAS_PRIMITIVE_OUTLINE
    primitiveOutlineStage();
    #endif

    // Compute the bitangent according to the formula in the glTF spec.
    // Normal and tangents can be affected by morphing and skinning, so
    // the bitangent should not be computed until their values are finalized.
    #ifdef HAS_BITANGENTS
    attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
    #endif

    FeatureIds featureIds;
    featureIdStage(featureIds, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    SelectedFeature feature;
    selectedFeatureIdStage(feature, featureIds);
    // Handle any show properties that come from the style.
    cpuStylingStage(attributes.positionMC, feature);
    #endif

    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
    // The scene mode 2D pipeline stage and instancing stage add a different
    // model view matrix to accurately project the model to 2D. However, the
    // output positions and normals should be transformed by the 3D matrices
    // to keep the data the same for the fragment shader.
    mat4 modelView = czm_modelView3D;
    mat3 normal = czm_normal3D;
    #else
    // These are used for individual model projection because they will
    // automatically change based on the scene mode.
    mat4 modelView = czm_modelView;
    mat3 normal = czm_normal;
    #endif

    // Update the position for this instance in place
    #ifdef HAS_INSTANCING

        // The legacy instance stage is used when rendering i3dm models that
        // encode instances transforms in world space, as opposed to glTF models
        // that use EXT_mesh_gpu_instancing, where instance transforms are encoded
        // in object space.
        #ifdef USE_LEGACY_INSTANCING
        mat4 instanceModelView;
        mat3 instanceModelViewInverseTranspose;

        legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);

        modelView = instanceModelView;
        normal = instanceModelViewInverseTranspose;
        #else
        instancingStage(attributes);
        #endif

        #ifdef USE_PICKING
        v_pickColor = a_pickColor;
        #endif

    #endif

    Metadata metadata;
    MetadataClass metadataClass;
    MetadataStatistics metadataStatistics;
    metadataStage(metadata, metadataClass, metadataStatistics, attributes);

    #ifdef HAS_VERTICAL_EXAGGERATION
    verticalExaggerationStage(attributes);
    #endif

    #ifdef HAS_CUSTOM_VERTEX_SHADER
    czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
    customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
    #endif

    // Compute the final position in each coordinate system needed.
    // This returns the value that will be assigned to gl_Position.
    vec4 positionClip = geometryStage(attributes, modelView, normal);

    // This must go after the geometry stage as it needs v_positionWC
    #ifdef HAS_ATMOSPHERE
    atmosphereStage(attributes);
    #endif

    #ifdef ENABLE_CLIPPING_POLYGONS
    modelClippingPolygonsStage(attributes);
    #endif

    #ifdef HAS_SILHOUETTE
    silhouetteStage(attributes, positionClip);
    #endif

    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
    float show = pointCloudShowStylingStage(attributes, metadata);
    #else
    float show = 1.0;
    #endif

    #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
    show *= pointCloudBackFaceCullingStage();
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
    v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
    #endif

    #ifdef PRIMITIVE_TYPE_POINTS
        #ifdef HAS_CUSTOM_VERTEX_SHADER
        gl_PointSize = vsOutput.pointSize;
        #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
        gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
        #else
        gl_PointSize = 1.0;
        #endif

        gl_PointSize *= show;
    #endif

    // Important NOT to compute gl_Position = show * positionClip or we hit:
    // https://github.com/CesiumGS/cesium/issues/11270
    //
    // We will discard points with v_pointCloudShow == 0 in the fragment shader.
    gl_Position = positionClip;

    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
    v_pointCloudShow = show;
    #endif
}
`;var kJn=T(S(),1),GP=`
precision highp float;
czm_modelMaterial defaultModelMaterial()
{
    czm_modelMaterial material;
    material.diffuse = vec3(0.0);
    material.specular = vec3(1.0);
    material.roughness = 1.0;
    material.occlusion = 1.0;
    material.normalEC = vec3(0.0, 0.0, 1.0);
    material.emissive = vec3(0.0);
    material.alpha = 1.0;
    return material;
}

vec4 handleAlpha(vec3 color, float alpha)
{
    #ifdef ALPHA_MODE_MASK
    if (alpha < u_alphaCutoff) {
        discard;
    }
    #endif

    return vec4(color, alpha);
}

SelectedFeature selectedFeature;

void main()
{
    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
        if (v_pointCloudShow == 0.0)
        {
            discard;
        }
    #endif

    #ifdef HAS_MODEL_SPLITTER
    modelSplitterStage();
    #endif

    czm_modelMaterial material = defaultModelMaterial();

    ProcessedAttributes attributes;
    geometryStage(attributes);

    FeatureIds featureIds;
    featureIdStage(featureIds, attributes);

    Metadata metadata;
    MetadataClass metadataClass;
    MetadataStatistics metadataStatistics;
    metadataStage(metadata, metadataClass, metadataStatistics, attributes);

    //========================================================================
    // When not picking metadata START
    #ifndef METADATA_PICKING_ENABLED

    #ifdef HAS_SELECTED_FEATURE_ID
    selectedFeatureIdStage(selectedFeature, featureIds);
    #endif

    #ifndef CUSTOM_SHADER_REPLACE_MATERIAL
    materialStage(material, attributes, selectedFeature);
    #endif

    #ifdef HAS_CUSTOM_FRAGMENT_SHADER
    customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
    #endif

    lightingStage(material, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    cpuStylingStage(material, selectedFeature);
    #endif

    #ifdef HAS_MODEL_COLOR
    modelColorStage(material);
    #endif

    #ifdef HAS_PRIMITIVE_OUTLINE
    primitiveOutlineStage(material);
    #endif

    vec4 color = handleAlpha(material.diffuse, material.alpha);

    // When not picking metadata END
    //========================================================================
    #else 
    //========================================================================
    // When picking metadata START

    vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
    metadataPickingStage(metadata, metadataClass, metadataValues);
    vec4 color = metadataValues;

    #endif
    // When picking metadata END
    //========================================================================

    #ifdef HAS_CLIPPING_PLANES
    modelClippingPlanesStage(color);
    #endif

    #ifdef ENABLE_CLIPPING_POLYGONS
    modelClippingPolygonsStage();
    #endif

    //========================================================================
    // When not picking metadata START
    #ifndef METADATA_PICKING_ENABLED

    #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
    silhouetteStage(color);
    #endif

    #ifdef HAS_ATMOSPHERE
    atmosphereStage(color, attributes);
    #endif

    #endif
    // When not picking metadata END
    //========================================================================

    out_FragColor = color;
}
`;function zue(){}zue.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=p4e(e,n,t),o=b4e(e,i,t),r=e.model;return l(r.classificationType)?new LP({primitiveRenderResources:e,command:o}):new RP({primitiveRenderResources:e,command:o})};function p4e(e,t,n){t.addVertexLines(ZP),t.addFragmentLines(GP);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function b4e(e,t,n){let i=g4e(e),o=new ni({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===oe.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=A.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new A),u=e.runtimePrimitive.boundingSphere2D;else{let C=c?a._computedModelMatrix:a._computedModelMatrix2D;d=A.multiplyTransformation(C,e.runtimeNode.computedTransform,new A),u=le.transform(e.boundingSphere,d)}let h=Ye(Ue.fromCache(e.renderStateOptions),!0);h.cull.face=Qt.getCullFace(d,e.primitiveType),h=Ue.fromCache(h);let p=l(r.classificationType),g=p?!1:Tn.castShadows(r.shadows),f=p?!1:Tn.receiveShadows(r.shadows),x=p?void 0:e.pickId;return new $e({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:x,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:f})}function g4e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var EP=zue;function vd(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=A.clone(A.IDENTITY),this._computedModelMatrix2D=A.clone(A.IDENTITY),this._axisCorrectionMatrix=Qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new A),this._runtimeArticulations={},y4e(this)}Object.defineProperties(vd.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function y4e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Kue(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V<s;V++){let L=r[V],R=new m2({articulation:L,sceneGraph:e}),G=R.name;a[G]=R}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let h=n.nodes.length,p=A.IDENTITY;for(let V=0;V<h;V++){let L=n.nodes[V],R=Jue(e,L,p);e._rootNodes.push(R)}let g=t.skins,f=e._runtimeSkins,x=g.length;for(let V=0;V<x;V++){let L=g[V];f.push(new hP({skin:L,sceneGraph:e}))}let _=e._skinnedNodes,C=_.length;for(let V=0;V<C;V++){let L=_[V],R=e._runtimeNodes[L],I=c[L].skin.index;R._runtimeSkin=f[I],R.updateJointMatrices()}e.applyArticulations()}function Kue(e,t){let n=e._components,i=e._model;e._computedModelMatrix=A.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=A.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=A.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var x4e=new m;function _4e(e,t){let n=e._computedModelMatrix,i=A.getTranslation(n,x4e);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Pt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Pt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=A.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Jue(e,t,n){let i=[],o=Qt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let h=t.children[u],p=A.multiplyTransformation(n,o,new A),g=Jue(e,h,p);i.push(g)}let s=new Z2({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new mP({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,h=new x2(u,s);u._nodesByName[d]=h}return c}var T4e=new m,S4e=new m,C4e=new m,V4e=new m;vd.prototype.buildDrawCommands=function(e){let t=this._model,n=new pP(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,T4e),c=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,S4e);for(o=0;o<this._runtimeNodes.length;o++){let d=this._runtimeNodes[o];if(!l(d))continue;d.configurePipeline();let u=d.pipelineStages,h=new TP(n,d);for(r=0;r<u.length;r++)u[r].process(h,d.node,e);let p=d.computedTransform;for(r=0;r<d.runtimePrimitives.length;r++){let g=d.runtimePrimitives[r];g.configurePipeline(e);let f=g.pipelineStages,x=new CP(h,g);for(s=0;s<f.length;s++)f[s].process(x,g.primitive,e);g.boundingSphere=le.clone(x.boundingSphere,new le);let _=A.multiplyByPoint(p,x.positionMin,C4e),C=A.multiplyByPoint(p,x.positionMax,V4e);m.minimumByComponent(a,_,a),m.maximumByComponent(c,C,c);let V=EP.buildModelDrawCommand(x,e);g.drawCommand=V}}this._boundingSphere=le.fromCornerPoints(a,c,new le),this._boundingSphere=le.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=le.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=le.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};vd.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(Kg),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(d2),n.isClippingEnabled()&&t.push(p2),n.isClippingPolygonsEnabled()&&t.push(y2),n.hasSilhouette(e)&&t.push(yP),l(n.splitDirection)&&n.splitDirection!==kr.NONE&&t.push(_P),dr.is3DTiles(n.type)&&t.push(r2),i&&t.push(c2))};vd.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==oe.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};vd.prototype.updateModelMatrix=function(e,t){Kue(this,e),t.mode!==oe.SCENE3D&&_4e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};vd.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Que(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);Que(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function qk(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];Que(e,c,t,n,i)}}var L4e={backFaceCulling:void 0};vd.prototype.updateBackFaceCulling=function(e){let t=L4e;t.backFaceCulling=e,qk(this,!1,R4e,t)};function R4e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Z4e={shadowMode:void 0};vd.prototype.updateShadows=function(e){let t=Z4e;t.shadowMode=e,qk(this,!1,G4e,t)};function G4e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var E4e={debugShowBoundingVolume:void 0};vd.prototype.updateShowBoundingVolume=function(e){let t=E4e;t.debugShowBoundingVolume=e,qk(this,!1,I4e,t)};function I4e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var jue=[],X4e={frameState:void 0,hasSilhouette:void 0};vd.prototype.pushDrawCommands=function(e){let t=jue;t.length=0;let n=X4e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,qk(this,!0,W4e,n),e.commandList.push.apply(e.commandList,t)};function W4e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=jue,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}vd.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};vd.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var IP=vd;var vQn=T(S(),1);function qg(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Gt}Object.defineProperties(qg.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});qg.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};qg.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};qg.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};qg.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};qg.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};qg.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var XP=qg;var g4n=T(S(),1);var tme=T(qM(),1);var zQn=T(S(),1);var que={},mT=Uint32Array.BYTES_PER_ELEMENT;que.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=mT;let o=i.getUint32(t,!0);if(o!==1)throw new ae(`Only Point Cloud tile version 1 is supported.  Version ${o} is not.`);t+=mT,t+=mT;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=mT;let s=i.getUint32(t,!0);t+=mT;let a=i.getUint32(t,!0);t+=mT;let c=i.getUint32(t,!0);t+=mT;let d=Jo(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=Jo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new uh(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=m.unpack(x));let _=P4e(g,h);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=v4e(g);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=F4e(g);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=w4e(g);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=A4e(g);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return l(p)&&(p=new Uint8Array(p),_.batchTableJson=h,_.batchTableBinary=p),_};function P4e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,h,p;if(l(s)){o=s.properties;let f=s.byteOffset,x=s.byteLength;if(!l(o)||!l(f)||!l(x))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+x),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:St(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:h}}function v4e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:ft.POSITION,semantic:ft.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:on.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ft.POSITION,semantic:ft.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:on.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:on.VEC3}}}function w4e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:ft.COLOR,semantic:ft.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ft.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ft.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:on.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=B.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:ft.COLOR,semantic:ft.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:s}}}function F4e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:ft.NORMAL,semantic:ft.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:on.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:ft.NORMAL,semantic:ft.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:on.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:on.VEC3}}function A4e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:ft.FEATURE_ID,semantic:ft.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:on.SCALAR}}}var hT=que;var M4e=Sn.Components,N4e=Sn.Scene,k4e=Sn.Node,U4e=Sn.Primitive,D4e=Sn.Attribute,$ue=Sn.Quantization,B4e=Sn.FeatureIdAttribute,O4e=Sn.Material,Y4e=Sn.MetallicRoughness;function $g(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=yt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=A.IDENTITY}l(Object.create)&&($g.prototype=Object.create(Ki.prototype),$g.prototype.constructor=$g);Object.defineProperties($g.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});$g.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=hT.parse(this._arrayBuffer,this._byteOffset),this._state=yt.PROCESSING,this._promise=Promise.resolve(this)};$g.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===yt.READY)return!0;if(this._state===yt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=H4e(this,e.context)}return!1};function H4e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Sb.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&z4e(e,i,r),oje(e,t),e._state=yt.READY,e}).catch(function(r){e.unload(),e._state=yt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function z4e(e,t,n){e._state=yt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:ft.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:on.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=m.fromElements(c,c,c),u=m.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=h<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT,o.quantizedType=on.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:ft.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Q.FLOAT,type:on.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=Q.UNSIGNED_BYTE,o.quantizedType=on.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ft.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ft.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ft.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Q.fromTypedArray(a),type:on.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:K4e(d.componentsPerAttribute),componentType:J4e(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function K4e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function J4e(e){switch(e){case ie.BYTE:return"BYTE";case ie.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ie.SHORT:return"SHORT";case ie.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ie.INT:return"INT";case ie.UNSIGNED_INT:return"UNSIGNED_INT";case ie.DOUBLE:return"DOUBLE";case ie.FLOAT:return"FLOAT"}}function WP(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new $ue,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new $ue;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new D4e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=wn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=B.pack(t.constantColor,a)}else{let a=xt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===ft.POSITION&&s&&(r.typedArray=i),r}var eme,$k;function Q4e(e){if(!l($k)){eme=new tme.default(0),$k=new Array(e);for(let t=0;t<e;++t)$k[t]=eme.random()}return $k}var j4e=new m,q4e=new m,$4e=new m;function eje(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=Q4e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,j4e),d=m.fromElements(a,a,a,q4e),u,h,p;if(e.isQuantized)c=m.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)h=Math.floor(r[u]*i),p=m.unpack(t,h*3,$4e),m.minimumByComponent(c,p,c),m.maximumByComponent(d,p,d);e.min=m.clone(c),e.max=m.clone(d)}var tje={name:ft.COLOR,semantic:ft.COLOR,setIndex:0,constantColor:B.DARKGRAY,componentDatatype:Q.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:!1};function nje(e,t,n){let i=[],o,r=t.positions;return l(r)&&(eje(r),o=WP(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=WP(e,t.normals,n),i.push(o)),l(t.colors)?(o=WP(e,t.colors,n),i.push(o)):(o=WP(e,tje,n),i.push(o)),l(t.batchIds)&&(o=WP(e,t.batchIds,n),i.push(o)),i}function ije(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return Wb({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new Hs({schema:{},propertyTables:[]})}function oje(e,t){let n=e._parsedContent,i=new Y4e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new O4e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Wf.BLEND);let s=!l(n.normals);o.unlit=s;let a=new U4e;if(a.attributes=nje(e,n,t),a.primitiveType=we.POINTS,a.material=o,l(n.batchIds)){let g=new B4e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new k4e;c.index=0,c.primitives=[a];let d=new N4e;d.nodes=[c],d.upAxis=Po.Z,d.forwardAxis=Po.X;let u=new M4e;u.scene=d,u.nodes=[c];let h=[];u.structuralMetadata=ije(n,h),h.length>0&&rje(e,a,h,t),l(n.rtcCenter)&&(u.transform=A.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=A.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function rje(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=xt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}$g.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var PP=$g;var A4n=T(S(),1);var sje=new m,aje=new m,cje=new m,lje=new A,dje=new A,uje=new A,mje=new he,hje=new le;function M1(e,t,n,i,o,r,s){if(!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,d=c._runtimeNodes;for(let u=0;u<d.length;u++){let h=d[u],p=h.node,g=A.clone(h.computedTransform,lje),f=A.clone(c.computedModelMatrix,dje),x=p.instances;l(x)&&x.transformInWorldSpace&&(f=A.multiplyTransformation(e.modelMatrix,c.components.transform,f),g=A.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,g));let _=A.multiplyTransformation(f,g,uje);n.mode!==oe.SCENE3D&&(_=Pt.basisTo2D(n.mapProjection,_,_));let C=[];if(l(x)){let L=x.attributes[0].count,R=x.attributes[0].componentDatatype,G=12,I=h.transformsTypedArray;if(!l(I)){let v=h.instancingTransformsBuffer;l(v)&&n.context.webgl2&&(I=Q.createTypedArray(R,L*G),v.getBufferData(I))}if(l(I))for(let v=0;v<L;v++){let P=v*G,w=new A(I[P],I[P+1],I[P+2],I[P+3],I[P+4],I[P+5],I[P+6],I[P+7],I[P+8],I[P+9],I[P+10],I[P+11],0,0,0,1);x.transformInWorldSpace?(A.multiplyTransformation(w,g,w),A.multiplyTransformation(f,w,w)):A.multiplyTransformation(w,_,w),C.push(w)}}C.length===0&&C.push(_);let V=h.runtimePrimitives.length;for(let L=0;L<V;L++){let R=h.runtimePrimitives[L],G=R.primitive;if(l(R.boundingSphere)&&!l(x)){let K=le.transform(R.boundingSphere,_,hje),te=qn.raySphere(t,K);if(!l(te))continue}let I=Qt.getAttributeBySemantic(G,ft.POSITION),v=I.byteOffset,P=I.byteStride,w=I.count;if(!l(G.indices))continue;let M=G.indices.typedArray;if(!l(M)){let K=G.indices.buffer,te=G.indices.count,z=G.indices.indexDatatype;l(K)&&n.context.webgl2&&(z===Ae.UNSIGNED_BYTE?M=new Uint8Array(te):z===Ae.UNSIGNED_SHORT?M=new Uint16Array(te):z===Ae.UNSIGNED_INT&&(M=new Uint32Array(te)),K.getBufferData(M))}let b=I.typedArray,Z=I.componentDatatype,E=I.type,X=I.quantization;l(X)&&(Z=I.quantization.componentDatatype,E=I.quantization.type);let F=on.getNumberOfComponents(E),N=Q.getSizeInBytes(Z),O=!l(b)&&l(P)&&P!==F*N,U=F,Y=0;O&&(U=P/N,Y=v/N);let k=w*U;if(!l(b)){let K=I.buffer;l(K)&&n.context.webgl2&&(b=Q.createTypedArray(Z,k),K.getBufferData(b,O?0:v,0,k)),X&&I.normalized&&(b=wn.dequantize(b,Z,E,w))}if(!l(M)||!l(b))return;r=y(r,ne.default),i=y(i,1),o=y(o,0);let H=M.length;for(let K=0;K<H;K+=3){let te=M[K],z=M[K+1],j=M[K+2];for(let ee of C){let fe=XJ(b,te,Y,U,X,ee,i,o,r,sje),Te=XJ(b,z,Y,U,X,ee,i,o,r,aje),de=XJ(b,j,Y,U,X,ee,i,o,r,cje),xe=qn.rayTriangleParametric(t,fe,Te,de,y(e.backFaceCulling,!0));l(xe)&&xe<a&&xe>=0&&(a=xe)}}}}if(a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==oe.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,h=u.ellipsoid,p=u.unproject(s,mje);h.cartographicToCartesian(p,s)}return s}}function XJ(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=wn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let h=d.x;d.x=d.z,d.z=d.y,d.y=h}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=A.multiplyByPoint(r,d,d),s!==1&&Tr.getPosition(d,c,s,a,d),d}function co(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,dr.GLTF),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new t2(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=B.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,Tc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,B.RED);this._silhouetteColor=B.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new le,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Je.NONE),this._heightDirty=this._heightReference!==Je.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Pf(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?fs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=A.clone(A.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?ah.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new M_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Rb(e.environmentMapOptions);Rb.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,Tn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===dr.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Ct(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,kr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,B.BLACK),this._classificationType=e.classificationType,this._statistics=new XP,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function WJ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function fje(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new o2({model:e,propertyTable:s});n.push(a)}return n}function pje(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Qt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=Qt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function wJ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(co.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){wJ(e,this._color)&&this.resetDrawCommands(),this._color=B.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!B.equals(e,this._silhouetteColor)){let t=wJ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=B.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return ome(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===dr.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(fs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(ah.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(Rb.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});co.prototype.getNode=function(e){return this._nodesByName[e]};co.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};co.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};co.prototype.getExtension=function(e){return this._loader.components.extensions[e]};co.prototype.makeStyleDirty=function(){this._styleDirty=!0};co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var bje=new A,gje=new $,yje=new A;co.prototype.update=function(e){let t=!1;try{t=xje(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")WJ(this,n);else{let i=Qt.getError("model",this._resource,n);WJ(this,i)}}if(_je(this,e),Tje(this,e),Sje(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Qt.getError("model",this._resource,new ae("Failed to load model."));WJ(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&fje(this,i);let o=new IP({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(Cje(this),Vje(this),Lje(this,e),Rje(this),Zje(this,e),Gje(this,e),Eje(this,e),Ije(this,e),Xje(this,e),Wje(this,e),Pje(this,e),this._defaultTexture=e.context.defaultTexture,vje(this,e),wje(this,e),Fje(this),Aje(this,e),Uje(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),Nje(this),Dje(this,e),Bje(this),Oje(this,e)}};function xje(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function _je(e,t){l(e._customShader)&&e._customShader.update(t)}function Tje(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function Sje(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Cje(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=pje(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Vje(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Lje(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&ime(e)}function ime(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=hh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Rje(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function Zje(e,t){e._silhouetteDirty&&(rme(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Gje(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Eje(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function Ije(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function Xje(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Wje(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Pje(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function vje(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function wje(e,t){A.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=A.clone(e.modelMatrix,e._modelMatrix))}var ey=new m,PJ=new he;function Fje(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Je.NONE){e._clampedModelMatrix=void 0;return}let n=y(t.ellipsoid,ne.default),i=e.modelMatrix;ey.x=i[12],ey.y=i[13],ey.z=i[14];let o=n.cartesianToCartographic(ey);l(e._clampedModelMatrix)||(e._clampedModelMatrix=A.clone(i,new A)),e._removeUpdateHeightCallback=t.updateHeight(o,nme(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=nme(e,n,o);he.clone(o,PJ),PJ.height=r,s(PJ)}e._heightDirty=!1,e._updateModelMatrix=!0}function Aje(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;ome(e,n),Mje(e,n,t)}function ome(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=le.transform(e._boundingSphere,t,e._boundingSphere)}function Mje(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);A.getTranslation(t,ey),e._sceneMode!==oe.SCENE3D&&Di.computeActualEllipsoidPosition(n,ey,ey);let s=e._boundingSphere.radius,a=Yje(ey,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Nje(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var kje=new $(1,0,0,0,0,1,0,-1,0);function Uje(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=gje,s=bje;if(s=A.multiply(o.uniformState.view3D,i,s),r=A.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(kje,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=yje;a=A.multiply(o.uniformState.view3D,i,a),a=A.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=A.inverseTranspose(a,e._clippingPlanesMatrix)}}function Dje(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Bje(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Ct.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Ct.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Ct.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Oje(e,t){let n=zje(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Kje(e,t),e._sceneGraph.pushDrawCommands(t))}var vJ=new le;function Yje(e,t,n){return vJ.center=e,vJ.radius=t,n.camera.getPixelSize(vJ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var eU=new m;function nme(e,t,n){return function(i){$C(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,eU);let o=e._clampedModelMatrix;A.clone(e.modelMatrix,o),o[12]=eU.x,o[13]=eU.y,o[14]=eU.z,e._heightDirty=!0}}var Hje=new m;function zje(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=A.getTranslation(e.modelMatrix,Hje);Di.computeActualEllipsoidPosition(t,s,s),r=m.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Kje(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}co.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};co.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function rme(e){return e.context.stencilBuffer}co.prototype.hasSilhouette=function(e){return rme(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};co.prototype.hasSkipLevelOfDetail=function(e){if(!dr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};co.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};co.prototype.pick=function(e,t,n,i,o){return M1(this,e,t,n,i,o)};co.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,me(this)};co.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};co.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};co.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=Ze.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Ze.createIfNeeded(t);let r=new dh(n),a=l(e.content)?dr.TILE_GLTF:dr.GLTF,c=n.gltfResource,d=vP(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),Qt.getError("model",c,g)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let h=new co(d),p=h._resource.credits;if(l(p)){let g=p.length;for(let f=0;f<g;f++)h._resourceCredits.push(Ct.clone(p[f]))}return h};co.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new JW(t);try{await n.load();let i=vP(n,dr.TILE_B3DM,e);return new co(i)}catch(i){throw n.destroy(),i}};co.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new PP(t);try{await n.load();let i=vP(n,dr.TILE_PNTS,e);return new co(i)}catch(i){throw n.destroy(),i}};co.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new qW(t);try{await n.load();let i=vP(n,dr.TILE_I3DM,e);return new co(i)}catch(i){throw n.destroy(),i}};co.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new QW(t),i=vP(n,dr.TILE_GEOJSON,e);return new co(i)};var Jje=new B;co.prototype.applyColorAndShow=function(e){let t=B.clone(this._color,Jje),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):B.clone(B.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,wJ(t,this._color)&&this.resetDrawCommands()};co.prototype.applyStyle=function(e){let t=this.type===dr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),ime(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function vP(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var fh=co;function Br(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Br.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Br.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Br.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Br.prototype.getExtension=function(e){return this._model.getExtension(e)};Br.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Br.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Br.prototype.applyDebugSettings=function(e,t){t=e?t:B.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Br.prototype.applyStyle=function(e){this._model.style=e};Br.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Ol.REPEAT}),this._ready=!0)};Br.prototype.isDestroyed=function(){return!1};Br.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),me(this)};Br.fromGltf=async function(e,t,n,i){let o=new Br(e,t,n),s=wP(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await fh.fromGltfAsync(s);return o._model=c,o};Br.fromB3dm=async function(e,t,n,i,o){let r=new Br(e,t,n),a=wP(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await fh.fromB3dm(a);return r._model=d,r};Br.fromI3dm=async function(e,t,n,i,o){let r=new Br(e,t,n),a=wP(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await fh.fromI3dm(a);return r._model=c,r};Br.fromPnts=async function(e,t,n,i,o){let r=new Br(e,t,n),a=wP(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await fh.fromPnts(a);return r._model=c,r};Br.fromGeoJson=async function(e,t,n,i){let o=new Br(e,t,n),s=wP(e,t,o,{geoJson:i,resource:n}),a=await fh.fromGeoJson(s);return o._model=a,o};Br.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ne.WGS84,n)};function wP(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ee.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return St(i,o)}var wd=Br;var Njn=T(S(),1);function zu(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(zu.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});zu.fromJson=function(e,t,n,i){let o=new zu(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};zu.prototype.hasProperty=function(e,t){return!1};zu.prototype.getFeature=function(e){};zu.prototype.applyDebugSettings=function(e,t){};zu.prototype.applyStyle=function(e){};zu.prototype.update=function(e,t){};zu.prototype.pick=function(e,t,n){};zu.prototype.isDestroyed=function(){return!1};zu.prototype.destroy=function(){return me(this)};var FP=zu;var bei=T(S(),1);var Tqn=T(S(),1);var r7n=T(S(),1);var Ujn=T(S(),1),AP=`uniform sampler2D u_atlas;

#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;
in float v_splitDirection;

#ifdef SDF
in vec4 v_outlineColor;
in float v_outlineWidth;
#endif

#ifdef FRAGMENT_DEPTH_CHECK
in vec4 v_textureCoordinateBounds;                  // the min and max x and y values for the texture coordinates
in vec4 v_originTextureCoordinateAndTranslate;      // texture coordinate at the origin, billboard translate (used for label glyphs)
in vec4 v_compressed;                               // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
in mat2 v_rotationMatrix;

const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT1 = 2.0;

const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;

float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
{
    vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
    lookupVector = v_rotationMatrix * lookupVector;
    vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle.  Will be zero for billboards because dimensions and imageSize will be equal

    vec2 translation = v_originTextureCoordinateAndTranslate.zw;

    if (applyTranslate)
    {
        // this is only needed for labels where the horizontal origin is not LEFT
        // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
        translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
    }

    vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));

    if (logDepthOrDepth == 0.0)
    {
        return 0.0; // not on the globe
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    return eyeCoordinate.z / eyeCoordinate.w;
}
#endif


#ifdef SDF

// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
float getDistance(vec2 position)
{
    return texture(u_atlas, position).r;
}

// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
{
    float distance = getDistance(position);

    if (outlineWidth > 0.0)
    {
        // Don't get the outline edge exceed the SDF_EDGE
        float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
        float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
        vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
        float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
        return vec4(sdfColor.rgb, sdfColor.a * alpha);
    }
    else
    {
        float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
        return vec4(v_color.rgb, v_color.a * alpha);
    }
}
#endif

void main()
{
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
    
    vec4 color = texture(u_atlas, v_textureCoordinates);

#ifdef SDF
    float outlineWidth = v_outlineWidth;
    vec4 outlineColor = v_outlineColor;

    // Get the current distance
    float distance = getDistance(v_textureCoordinates);

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float smoothing = fwidth(distance);
    // Get an offset that is approximately half the distance to the neighbor pixels
    // 0.354 is approximately half of 1/sqrt(2)
    vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));

    // Sample the center point
    vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);

    // Sample the 4 neighbors
    vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);

    // Equally weight the center sample and the 4 neighboring samples
    color = (center + color1 + color2 + color3 + color4)/5.0;
#else
    // If no derivatives available (IE 10?), just do a single sample
    float smoothing = 1.0/32.0;
    color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
#endif

    color = czm_gammaCorrect(color);
#else
    color = czm_gammaCorrect(color);
    color *= czm_gammaCorrect(v_color);
#endif

// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
    if (color.a < 0.005)   // matches 0/255 and 1/255
    {
        discard;
    }
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
    if (color.a < 0.995)   // matches < 254/255
    {
        discard;
    }
#else
    if (color.a >= 0.995)  // matches 254/255 and 255/255
    {
        discard;
    }
#endif
#endif

#ifdef VECTOR_TILE
    color *= u_highlightColor;
#endif
    out_FragColor = color;

#ifdef LOG_DEPTH
    czm_writeLogDepth();
#endif

#ifdef FRAGMENT_DEPTH_CHECK
    float temp = v_compressed.y;

    temp = temp * SHIFT_RIGHT1;

    float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
    bool enableDepthTest = temp2 != 0.0;
    bool applyTranslate = floor(temp) != 0.0;

    if (enableDepthTest) {
        temp = v_compressed.z;
        temp = temp * SHIFT_RIGHT12;

        vec2 dimensions;
        dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
        dimensions.x = floor(temp);

        temp = v_compressed.w;
        temp = temp * SHIFT_RIGHT12;

        vec2 imageSize;
        imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
        imageSize.x = floor(temp);

        vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
        adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);

        float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
        float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);

        // negative values go into the screen
        if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
        {
            float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
            if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
            {
                float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
                if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
                {
                    discard;
                }
            }
        }
    }
#endif

}
`;var Bjn=T(S(),1),MP=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScale;
in vec4 positionLowAndRotation;
in vec4 compressedAttribute0;                       // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
in vec4 compressedAttribute1;                       // aligned axis, translucency by distance, image width
in vec4 compressedAttribute2;                       // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
in vec4 eyeOffset;                                  // eye offset in meters, 4 bytes free (texture range)
in vec4 scaleByDistance;                            // near, nearScale, far, farScale
in vec4 pixelOffsetScaleByDistance;                 // near, nearScale, far, farScale
in vec4 compressedAttribute3;                       // distance display condition near, far, disableDepthTestDistance, dimensions
in vec2 sdf;                                        // sdf outline color (rgb) and width (w)
in float splitDirection;                            // splitDirection
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
in vec4 textureCoordinateBoundsOrLabelTranslate;    // the min and max x and y values for the texture coordinates
#endif
#ifdef VECTOR_TILE
in float a_batchId;
#endif

out vec2 v_textureCoordinates;
#ifdef FRAGMENT_DEPTH_CHECK
out vec4 v_textureCoordinateBounds;
out vec4 v_originTextureCoordinateAndTranslate;
out vec4 v_compressed;                                 // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
out mat2 v_rotationMatrix;
#endif

out vec4 v_pickColor;
out vec4 v_color;
out float v_splitDirection;
#ifdef SDF
out vec4 v_outlineColor;
out float v_outlineWidth;
#endif

const float UPPER_BOUND = 32768.0;

const float SHIFT_LEFT16 = 65536.0;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_LEFT7 = 128.0;
const float SHIFT_LEFT5 = 32.0;
const float SHIFT_LEFT3 = 8.0;
const float SHIFT_LEFT2 = 4.0;
const float SHIFT_LEFT1 = 2.0;

const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
const float SHIFT_RIGHT7 = 1.0 / 128.0;
const float SHIFT_RIGHT5 = 1.0 / 32.0;
const float SHIFT_RIGHT3 = 1.0 / 8.0;
const float SHIFT_RIGHT2 = 1.0 / 4.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;

vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
{
    // Note the halfSize cannot be computed in JavaScript because it is sent via
    // compressed vertex attributes that coerce it to an integer.
    vec2 halfSize = imageSize * scale * 0.5;
    halfSize *= ((direction * 2.0) - 1.0);

    vec2 originTranslate = origin * abs(halfSize);

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    if (validAlignedAxis || rotation != 0.0)
    {
        float angle = rotation;
        if (validAlignedAxis)
        {
            vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
            angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
                    (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
        }

        float cosTheta = cos(angle);
        float sinTheta = sin(angle);
        rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
        halfSize = rotationMatrix * halfSize;
    }
    else
    {
        rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
    }
#endif

    mpp = czm_metersPerPixel(positionEC);
    positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
    positionEC.xy += (translate + pixelOffset) * mpp;

    return positionEC;
}

#ifdef VERTEX_DEPTH_CHECK
float getGlobeDepth(vec4 positionEC)
{
    vec4 posWC = czm_eyeToWindowCoordinates(positionEC);

    float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));

    if (globeDepth == 0.0)
    {
        return 0.0; // not on the globe
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
    return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
void main()
{
    // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition

    // unpack attributes
    vec3 positionHigh = positionHighAndScale.xyz;
    vec3 positionLow = positionLowAndRotation.xyz;
    float scale = positionHighAndScale.w;

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    float rotation = positionLowAndRotation.w;
#else
    float rotation = 0.0;
#endif

    float compressed = compressedAttribute0.x;

    vec2 pixelOffset;
    pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
    compressed -= pixelOffset.x * SHIFT_LEFT7;
    pixelOffset.x -= UPPER_BOUND;

    vec2 origin;
    origin.x = floor(compressed * SHIFT_RIGHT5);
    compressed -= origin.x * SHIFT_LEFT5;

    origin.y = floor(compressed * SHIFT_RIGHT3);
    compressed -= origin.y * SHIFT_LEFT3;

#ifdef FRAGMENT_DEPTH_CHECK
    vec2 depthOrigin = origin.xy;
#endif
    origin -= vec2(1.0);

    float show = floor(compressed * SHIFT_RIGHT2);
    compressed -= show * SHIFT_LEFT2;

#ifdef INSTANCED
    vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
    vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
    vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
#else
    vec2 direction;
    direction.x = floor(compressed * SHIFT_RIGHT1);
    direction.y = compressed - direction.x * SHIFT_LEFT1;

    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
#endif

    float temp = compressedAttribute0.y  * SHIFT_RIGHT8;
    pixelOffset.y = -(floor(temp) - UPPER_BOUND);

    vec2 translate;
    translate.y = (temp - floor(temp)) * SHIFT_LEFT16;

    temp = compressedAttribute0.z * SHIFT_RIGHT8;
    translate.x = floor(temp) - UPPER_BOUND;

    translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
    translate.y -= UPPER_BOUND;

    temp = compressedAttribute1.x * SHIFT_RIGHT8;
    float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);

    vec2 imageSize = vec2(floor(temp), temp2);

#ifdef FRAGMENT_DEPTH_CHECK
    float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
    float applyTranslate = 0.0;
    if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false
    {
        applyTranslate = 1.0;
        labelHorizontalOrigin -= 2.0;
        depthOrigin.x = labelHorizontalOrigin + 1.0;
    }

    depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
#endif

#ifdef EYE_DISTANCE_TRANSLUCENCY
    vec4 translucencyByDistance;
    translucencyByDistance.x = compressedAttribute1.z;
    translucencyByDistance.z = compressedAttribute1.w;

    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;

    temp = compressedAttribute1.y * SHIFT_RIGHT8;
    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif

#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
    temp = compressedAttribute3.w;
    temp = temp * SHIFT_RIGHT12;

    vec2 dimensions;
    dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
    dimensions.x = floor(temp);
#endif

#ifdef ALIGNED_AXIS
    vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
    temp = compressedAttribute2.z * SHIFT_RIGHT5;
    bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
#else
    vec3 alignedAxis = vec3(0.0);
    bool validAlignedAxis = false;
#endif

    vec4 pickColor;
    vec4 color;

    temp = compressedAttribute2.y;
    temp = temp * SHIFT_RIGHT8;
    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor.r = floor(temp);

    temp = compressedAttribute2.x;
    temp = temp * SHIFT_RIGHT8;
    color.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    color.g = (temp - floor(temp)) * SHIFT_LEFT8;
    color.r = floor(temp);

    temp = compressedAttribute2.z * SHIFT_RIGHT8;
    bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
    temp = floor(temp) * SHIFT_RIGHT8;

    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor /= 255.0;

    color.a = floor(temp);
    color /= 255.0;

    ///////////////////////////////////////////////////////////////////////////

    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;

#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
    float eyeDepth = positionEC.z;
#endif

    positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
    positionEC.xyz *= show;

    ///////////////////////////////////////////////////////////////////////////

#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
    float lengthSq;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        // 2D camera distance is a special case
        // treat all billboards as flattened to the z=0.0 plane
        lengthSq = czm_eyeHeight2D.y;
    }
    else
    {
        lengthSq = dot(positionEC.xyz, positionEC.xyz);
    }
#endif

#ifdef EYE_DISTANCE_SCALING
    float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
    scale *= distanceScale;
    translate *= distanceScale;
    // push vertex behind near plane for clipping
    if (scale == 0.0)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

    float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
    // push vertex behind near plane for clipping
    if (translucency == 0.0)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

#ifdef EYE_DISTANCE_PIXEL_OFFSET
    float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
    pixelOffset *= pixelOffsetScale;
#endif

#ifdef DISTANCE_DISPLAY_CONDITION
    float nearSq = compressedAttribute3.x;
    float farSq = compressedAttribute3.y;
    if (lengthSq < nearSq || lengthSq > farSq)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

    mat2 rotationMatrix;
    float mpp;

#ifdef DISABLE_DEPTH_DISTANCE
    float disableDepthTestDistance = compressedAttribute3.z;
#endif

#ifdef VERTEX_DEPTH_CHECK
if (lengthSq < disableDepthTestDistance) {
    float depthsilon = 10.0;

    vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
    vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
    float globeDepth1 = getGlobeDepth(pEC1);

    if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
    {
        vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
        float globeDepth2 = getGlobeDepth(pEC2);

        if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
        {
            vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
            float globeDepth3 = getGlobeDepth(pEC3);
            if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
            {
                positionEC.xyz = vec3(0.0);
            }
        }
    }
}
#endif

    positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
    gl_Position = czm_projection * positionEC;
    v_textureCoordinates = textureCoordinates;

#ifdef LOG_DEPTH
    czm_vertexLogDepth();
#endif

#ifdef DISABLE_DEPTH_DISTANCE
    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
    {
        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
    }

    if (disableDepthTestDistance != 0.0)
    {
        // Don't try to "multiply both sides" by w.  Greater/less-than comparisons won't work for negative values of w.
        float zclip = gl_Position.z / gl_Position.w;
        bool clipped = (zclip < -1.0 || zclip > 1.0);
        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
        {
            // Position z on the near plane.
            gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
            v_depthFromNearPlusOne = 1.0;
#endif
        }
    }
#endif

#ifdef FRAGMENT_DEPTH_CHECK
    if (sizeInMeters) {
        translate /= mpp;
        dimensions /= mpp;
        imageSize /= mpp;
    }

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    v_rotationMatrix = rotationMatrix;
#else
    v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
#endif

    float enableDepthCheck = 0.0;
    if (lengthSq < disableDepthTestDistance)
    {
        enableDepthCheck = 1.0;
    }

    float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
    float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));

    float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
    float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));

    v_compressed.x = eyeDepth;
    v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
    v_compressed.z = dw * SHIFT_LEFT12 + dh;
    v_compressed.w = iw * SHIFT_LEFT12 + ih;
    v_originTextureCoordinateAndTranslate.xy = depthOrigin;
    v_originTextureCoordinateAndTranslate.zw = translate;
    v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;

#endif

#ifdef SDF
    vec4 outlineColor;
    float outlineWidth;

    temp = sdf.x;
    temp = temp * SHIFT_RIGHT8;
    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.r = floor(temp);

    temp = sdf.y;
    temp = temp * SHIFT_RIGHT8;
    float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.a = floor(temp);
    outlineColor /= 255.0;

    v_outlineWidth = outlineWidth / 255.0;
    v_outlineColor = outlineColor;
    v_outlineColor.a *= translucency;
#endif

    v_pickColor = pickColor;

    v_color = color;
    v_color.a *= translucency;
    v_splitDirection = splitDirection;
}
`;var y8n=T(S(),1);var Jjn=T(S(),1);var Yjn=T(S(),1),Qje=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),os=Qje;function Mb(e){this._billboardCollection=e,this._id=void 0,this._loadState=os.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Mb.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===os.LOADED}},hasImage:{get:function(){return this._loadState!==os.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Mb.prototype.unload=async function(){this._loadState!==os.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=os.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Mb.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(l(o)&&t.loadState===os.LOADING||t.loadState===os.LOADED){Mb.clone(o,this);return}l(o)||(o=new Mb(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=os.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(c){if(o._loadState=os.ERROR,o._loadError=c,this._id!==e)return;this._loadState=os.ERROR,this._loadError=c;return}if(!l(r)||r===-1){if(o._loadState=os.FAILED,o._index=-1,this._id!==e)return;this._loadState=os.FAILED,this._index=-1;return}o._index=r,o._loadState=os.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=os.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};Mb.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=os.LOADING,this._loadError=void 0,this._hasSubregion=!0;let n,i=this._billboardCollection.textureAtlas;try{n=await i.addImageSubRegion(e,t)}catch(o){this._loadState=os.ERROR,this._loadError=o;return}if(!l(n)||n===-1){this._loadState=os.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=n,this._loadState=os.LOADED,this.dirty=!0};Mb.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Mb.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var Nb=Mb;function pi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=wt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._translate=new D(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,Je.NONE),this._verticalOrigin=y(e.verticalOrigin,An.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,_i.CENTER),this._scale=y(e.scale,1),this._color=B.clone(y(e.color,B.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Nb(t),this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Hn()),this._imageTexture.loadImage(a,s)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=B.clone(y(e.outlineColor,B.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,kr.NONE)}var sme=pi.SHOW_INDEX=0,nU=pi.POSITION_INDEX=1,ume=pi.PIXEL_OFFSET_INDEX=2,jje=pi.EYE_OFFSET_INDEX=3,qje=pi.HORIZONTAL_ORIGIN_INDEX=4,$je=pi.VERTICAL_ORIGIN_INDEX=5,e8e=pi.SCALE_INDEX=6,ame=pi.IMAGE_INDEX_INDEX=7,cme=pi.COLOR_INDEX=8,t8e=pi.ROTATION_INDEX=9,n8e=pi.ALIGNED_AXIS_INDEX=10,i8e=pi.SCALE_BY_DISTANCE_INDEX=11,o8e=pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,r8e=pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,s8e=pi.DISTANCE_DISPLAY_CONDITION=14,a8e=pi.DISABLE_DEPTH_DISTANCE=15;pi.TEXTURE_COORDINATE_BOUNDS=16;var lme=pi.SDF_INDEX=17,c8e=pi.SPLIT_DIRECTION_INDEX=18;pi.NUMBER_OF_PROPERTIES=19;function er(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(pi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,er(this,sme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),er(this,nU))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),er(this,nU))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),er(this,ume))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),er(this,i8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),er(this,o8e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;kt.equals(t,e)||(this._pixelOffsetScaleByDistance=kt.clone(e,t),er(this,r8e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),er(this,jje))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,er(this,qje))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,er(this,$je))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,er(this,e8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),er(this,cme))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,er(this,t8e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),er(this,n8e))}},width:{get:function(){return y(this._width,this._imageTexture.width)},set:function(e){this._width!==e&&(this._width=e,er(this,ame))}},height:{get:function(){return y(this._height,this._imageTexture.height)},set:function(e){this._height!==e&&(this._height=e,er(this,ame))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,er(this,cme))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),er(this,s8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,er(this,a8e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof Ze?t=e._url:l(e.src)?t=e.src:t=Hn(),this._imageTexture.loadImage(t,e)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),er(this,nU)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,er(this,sme))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),er(this,lme))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,er(this,lme))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,er(this,c8e))}}});pi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};pi.prototype._updateClamping=function(){pi._updateClamping(this._billboardCollection,this)};var iU=new he;pi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=y(n.ellipsoid,ne.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Je.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Je.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);$C(t._heightReference)&&(t._mode===oe.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,iU);let c=n.getHeight(s,t._heightReference);l(c)&&(iU.height=c),a(iU)};pi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};pi.prototype.setImage=function(e,t){this._imageTexture.loadImage(e,t)};pi.prototype.setImageTexture=function(e){Nb.clone(e,this._imageTexture)};pi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};pi.prototype._setTranslate=function(e){let t=this._translate;D.equals(t,e)||(D.clone(e,t),er(this,ume))};pi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};pi.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),er(this,nU)};var dme=new se;pi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(A.multiplyByPoint(i,t,dme),Di.computeActualEllipsoidPosition(n,dme))};var mme=new m;pi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=A.multiplyByPoint(e,t,mme),a=Di.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return D.add(a,i,a),a};var tU=new D(0,0);pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new D),D.clone(this._pixelOffset,tU),D.add(tU,this._translate,tU);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,iU);o=a.cartographicToCartesian(c,mme),i=A.IDENTITY}return pi._computeScreenSpacePosition(i,o,this._eyeOffset,tU,e,t)};pi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===_i.RIGHT?s-=i:e.horizontalOrigin===_i.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===An.BOTTOM||e.verticalOrigin===An.BASELINE?a-=o:e.verticalOrigin===An.CENTER&&(a-=o*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};pi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&B.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};pi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var lo=pi;var _8n=T(S(),1),l8e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Ro=Object.freeze(l8e);var S8n=T(S(),1),d8e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ks=Object.freeze(d8e);var u8e=lo.SHOW_INDEX,NP=lo.POSITION_INDEX,hme=lo.PIXEL_OFFSET_INDEX,fme=lo.EYE_OFFSET_INDEX,m8e=lo.HORIZONTAL_ORIGIN_INDEX,h8e=lo.VERTICAL_ORIGIN_INDEX,f8e=lo.SCALE_INDEX,fT=lo.IMAGE_INDEX_INDEX,pme=lo.COLOR_INDEX,p8e=lo.ROTATION_INDEX,b8e=lo.ALIGNED_AXIS_INDEX,bme=lo.SCALE_BY_DISTANCE_INDEX,gme=lo.TRANSLUCENCY_BY_DISTANCE_INDEX,yme=lo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,xme=lo.DISTANCE_DISPLAY_CONDITION,g8e=lo.DISABLE_DEPTH_DISTANCE,y8e=lo.TEXTURE_COORDINATE_BOUNDS,_me=lo.SDF_INDEX,Tme=lo.SPLIT_DIRECTION_INDEX,DJ=lo.NUMBER_OF_PROPERTIES,uo,x8e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},_8e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Ju(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Lx),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(DJ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=y(e.show,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(A.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Ro.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=B.clone(B.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Ju.prototype,{length:{get:function(){return BJ(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}}});function Sme(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Ju.prototype.add=function(e){let t=new lo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Ju.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Ju.prototype.removeAll=function(){Sme(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function BJ(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Ju.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Ju.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Ju.prototype.get=function(e){return BJ(this),this._billboards[e]};var FJ;function T8e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=xt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function S8e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=xt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function C8e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=xt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Ju.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<DJ;++i){let o=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function V8e(e,t,n,i,o,r){let s=[{index:uo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[NP]},{index:uo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[NP]},{index:uo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[hme]},{index:uo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[gme]},{index:uo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[pme]},{index:uo.eyeOffset,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[fme]},{index:uo.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[bme]},{index:uo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[yme]},{index:uo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[xme]},{index:uo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[y8e]},{index:uo.splitDirection,componentsPerAttribute:1,componentDatatype:Q.FLOAT,usage:n[Tme]}];i&&s.push({index:uo.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:C8e(e)}),l(o)&&s.push({index:uo.a_batchId,componentsPerAttribute:1,componentDatatype:Q.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&s.push({index:uo.sdf,componentsPerAttribute:2,componentDatatype:Q.FLOAT,usage:n[_me]});let a=i?t:4*t;return new Wp(e,s,a,i)}var AJ=new On;function Cme(e,t,n,i){let o,r=n[uo.positionHighAndScale],s=n[uo.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),On.fromCartesian(a,AJ);let c=i.scale,d=i.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);let u=AJ.high,h=AJ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c),s(o,h.x,h.y,h.z,d)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c),r(o+1,u.x,u.y,u.z,c),r(o+2,u.x,u.y,u.z,c),r(o+3,u.x,u.y,u.z,c),s(o+0,h.x,h.y,h.z,d),s(o+1,h.x,h.y,h.z,d),s(o+2,h.x,h.y,h.z,d),s(o+3,h.x,h.y,h.z,d))}var Hl=new D,Ku=32768,N1=65536,MJ=4096,wf=256,L8e=128,R8e=32,Z8e=8,Vme=4,G8e=1/256,Lme=0,Rme=2,Zme=3,Gme=1,OJ=new Ke;function Eme(e,t,n,i){let o,r=n[uo.compressedAttribute0],s=i.pixelOffset,a=s.x,c=s.y,d=i._translate,u=d.x,h=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-c+h));let p=i.horizontalOrigin,g=i._verticalOrigin,f=i.show&&i.clusterShow;i.color.alpha===0&&(f=!1),g===An.BASELINE&&(g=An.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===_i.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===An.CENTER;let x=0,_=0,C=0,V=0;if(i.ready){let F=i.computeTextureCoordinates(OJ);x=F.x,_=F.y,C=F.width,V=F.height}let L=x+C,R=_+V,G=Math.floor(W.clamp(a,-Ku,Ku)+Ku)*L8e;G+=(p+1)*R8e,G+=(g+1)*Z8e,G+=(f?1:0)*Vme;let I=Math.floor(W.clamp(c,-Ku,Ku)+Ku)*wf,v=Math.floor(W.clamp(u,-Ku,Ku)+Ku)*wf,P=(W.clamp(h,-Ku,Ku)+Ku)*G8e,w=Math.floor(P),M=Math.floor((P-w)*wf);I+=w,v+=M,Hl.x=x,Hl.y=_;let b=wn.compressTextureCoordinates(Hl);Hl.x=L;let Z=wn.compressTextureCoordinates(Hl);Hl.y=R;let E=wn.compressTextureCoordinates(Hl);Hl.x=x;let X=wn.compressTextureCoordinates(Hl);e._instanced?(o=i._index,r(o,G,I,v,b)):(o=i._index*4,r(o+0,G+Lme,I,v,b),r(o+1,G+Rme,I,v,Z),r(o+2,G+Zme,I,v,E),r(o+3,G+Gme,I,v,X))}function Ime(e,t,n,i){let o,r=n[uo.compressedAttribute1],s=i.alignedAxis;m.equals(s,m.ZERO)||(e._shaderAlignedAxis=!0);let a=0,c=1,d=1,u=1,h=i.translucencyByDistance;l(h)&&(a=h.near,c=h.nearValue,d=h.far,u=h.farValue,(c!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let g=W.clamp(p,0,N1),f=0;Math.abs(m.magnitudeSquared(s)-1)<W.EPSILON6&&(f=wn.octEncodeFloat(s)),c=W.clamp(c,0,1),c=c===1?255:c*255|0,g=g*wf+c,u=W.clamp(u,0,1),u=u===1?255:u*255|0,f=f*wf+u,e._instanced?(o=i._index,r(o,g,f,a,d)):(o=i._index*4,r(o+0,g,f,a,d),r(o+1,g,f,a,d),r(o+2,g,f,a,d),r(o+3,g,f,a,d))}function kJ(e,t,n,i){let o,r=n[uo.compressedAttribute2],s=i.color,a=l(e._batchTable)?B.WHITE:i.getPickId(t.context).color,c=i.sizeInMeters?1:0,d=Math.abs(m.magnitudeSquared(i.alignedAxis)-1)<W.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&c===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let h=y(i._labelHorizontalOrigin,-2);h+=2;let p=u*Vme+h,g=B.floatToByte(s.red),f=B.floatToByte(s.green),x=B.floatToByte(s.blue),_=g*N1+f*wf+x;g=B.floatToByte(a.red),f=B.floatToByte(a.green),x=B.floatToByte(a.blue);let C=g*N1+f*wf+x,V=B.floatToByte(s.alpha)*N1+B.floatToByte(a.alpha)*wf;V+=c*2+d,e._instanced?(o=i._index,r(o,_,C,V,p)):(o=i._index*4,r(o+0,_,C,V,p),r(o+1,_,C,V,p),r(o+2,_,C,V,p),r(o+3,_,C,V,p))}function UJ(e,t,n,i){let o,r=n[uo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==Je.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(Hl.x=0,Hl.y=0,i.ready){let d=i.computeTextureCoordinates(OJ);Hl.x=d.width,Hl.y=d.height}let c=wn.compressTextureCoordinates(Hl);o=i._index,r(o,s.x,s.y,a,c)}else o=i._index*4,r(o+0,s.x,s.y,a,0),r(o+1,s.x,s.y,a,0),r(o+2,s.x,s.y,a,0),r(o+3,s.x,s.y,a,0)}function Xme(e,t,n,i){let o,r=n[uo.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,d)):(o=i._index*4,r(o+0,s,a,c,d),r(o+1,s,a,c,d),r(o+2,s,a,c,d),r(o+3,s,a,c,d))}function Wme(e,t,n,i){let o,r=n[uo.pixelOffsetScaleByDistance],s=0,a=1,c=1,d=1,u=i.pixelOffsetScaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,d)):(o=i._index*4,r(o+0,s,a,c,d),r(o+1,s,a,c,d),r(o+2,s,a,c,d),r(o+3,s,a,c,d))}function Pme(e,t,n,i){let o,r=n[uo.compressedAttribute3],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance,u=Mu(i.heightReference)&&t.context.depthTexture;l(d)||(d=u?5e3:0),d*=d,(u||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let h,p;l(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(W.clamp(p,0,MJ)),f=Math.floor(W.clamp(h,0,MJ)),x=g*MJ+f;e._instanced?(o=i._index,r(o,s,a,d,x)):(o=i._index*4,r(o+0,s,a,d,x),r(o+1,s,a,d,x),r(o+2,s,a,d,x),r(o+3,s,a,d,x))}function vme(e,t,n,i){if(Mu(i.heightReference)){let p=e._scene,g=t.context,f=t.globeTranslucencyState.translucent,x=l(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!f&&x}let o,r=n[uo.textureCoordinateBoundsOrLabelTranslate];if(At.maximumVertexTextureImageUnits>0){let p=0,g=0;l(i._labelTranslate)&&(p=i._labelTranslate.x,g=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,g,0,0)):(o=i._index*4,r(o+0,p,g,0,0),r(o+1,p,g,0,0),r(o+2,p,g,0,0),r(o+3,p,g,0,0));return}let s=0,a=0,c=0,d=0;if(i.ready){let p=i.computeTextureCoordinates(OJ);s=p.x,a=p.y,c=p.width,d=p.height}let u=s+c,h=a+d;e._instanced?(o=i._index,r(o,s,a,u,h)):(o=i._index*4,r(o+0,s,a,u,h),r(o+1,s,a,u,h),r(o+2,s,a,u,h),r(o+3,s,a,u,h))}function E8e(e,t,n,i){if(!l(e._batchTable))return;let o=n[uo.a_batchId],r=i._batchIndex,s;e._instanced?(s=i._index,o(s,r)):(s=i._index*4,o(s+0,r),o(s+1,r),o(s+2,r),o(s+3,r))}function wme(e,t,n,i){if(!e._sdf)return;let o,r=n[uo.sdf],s=i.outlineColor,a=i.outlineWidth,c=B.floatToByte(s.red),d=B.floatToByte(s.green),u=B.floatToByte(s.blue),h=c*N1+d*wf+u,p=a/Ks.RADIUS,g=B.floatToByte(s.alpha)*N1+B.floatToByte(p)*wf;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+Lme,g),r(o+1,h+Rme,g),r(o+2,h+Zme,g),r(o+3,h+Gme,g))}function Fme(e,t,n,i){let o=n[uo.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s);let a;e._instanced?(a=i._index,o(a,r)):(a=i._index*4,o(a+0,r),o(a+1,r),o(a+2,r),o(a+3,r))}function I8e(e,t,n,i){Cme(e,t,n,i),Eme(e,t,n,i),Ime(e,t,n,i),kJ(e,t,n,i),UJ(e,t,n,i),Xme(e,t,n,i),Wme(e,t,n,i),Pme(e,t,n,i),vme(e,t,n,i),E8e(e,t,n,i),wme(e,t,n,i),Fme(e,t,n,i)}function NJ(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,h=lo._computeActualPosition(d,u,i,o);l(h)&&(d._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function X8e(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!A.equals(r,e.modelMatrix)?(e._mode=n,A.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&NJ(e,i,i.length,t,r,!0)):n===oe.MORPHING?NJ(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&NJ(e,o,e._billboardsToUpdateIndex,t,r,!1)}function W8e(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function P8e(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; 
in vec2 v_textureCoordinates; 
void main() 
{ 
    out_FragColor = texture(billboard_texture, v_textureCoordinates); 
} 
`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ee.OVERLAY,i}var v8e=[];Ju.prototype.update=function(e){if(BJ(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,uo=this._instanced?_8e:x8e,FJ=this._instanced?S8e:T8e;let n=this._billboards,i=n.length,o=!0;for(let P=0;P<i;++P){let w=n[P];l(w.loadError)&&(console.error(`Error loading image for billboard: ${w.loadError}`),w.image=void 0),w.textureDirty&&this._updateBillboard(w,fT),w.show&&(o=o&&w.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;X8e(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let h,p=e.passes,g=p.pick;if(u||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<DJ;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=V8e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let P=0;P<i;++P){let w=this._billboards[P];w._dirty=!1,w.textureDirty=!1,I8e(this,e,h,w)}this._vaf.commit(FJ(t))}this._billboardsToUpdateIndex=0}else if(a>0){let P=v8e;P.length=0,(c[NP]||c[p8e]||c[f8e])&&P.push(Cme),(c[fT]||c[hme]||c[m8e]||c[h8e]||c[u8e])&&(P.push(Eme),this._instanced&&P.push(UJ)),(c[fT]||c[b8e]||c[gme])&&(P.push(Ime),P.push(kJ)),(c[fT]||c[pme])&&P.push(kJ),(c[fT]||c[fme])&&P.push(UJ),c[bme]&&P.push(Xme),c[yme]&&P.push(Wme),(c[xme]||c[g8e]||c[fT]||c[NP])&&P.push(Pme),(c[fT]||c[NP])&&P.push(vme),c[_me]&&P.push(wme),c[Tme]&&P.push(Fme);let w=P.length;if(h=this._vaf.writers,a/i>.1){for(let M=0;M<a;++M){let b=s[M];b._dirty=!1,b.textureDirty=!1;for(let Z=0;Z<w;++Z)P[Z](this,e,h,b)}this._vaf.commit(FJ(t))}else{for(let M=0;M<a;++M){let b=s[M];b._dirty=!1,b.textureDirty=!1;for(let Z=0;Z<w;++Z)P[Z](this,e,h,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(b._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,x=A.IDENTITY;e.mode===oe.SCENE3D?(x=this.modelMatrix,f=le.clone(this._baseVolumeWC,this._boundingVolume)):f=le.clone(this._baseVolume2D,this._boundingVolume),W8e(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Ro.OPAQUE||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Ro.TRANSLUCENT;this._blendOption===Ro.TRANSLUCENT||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:P?ie.LEQUAL:ie.LESS},depthMask:P,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,R,G,I=At.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=MP,V=AP,G=[],l(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new De({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Ks.CUTOFF;this._sdf&&L.defines.push("SDF");let w=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT&&(R=new De({defines:["OPAQUE",w],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:uo}),R=new De({defines:["TRANSLUCENT",w],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=$t.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:uo})),this._blendOption===Ro.OPAQUE&&(R=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:uo})),this._blendOption===Ro.TRANSLUCENT&&(R=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=$t.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:uo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let v=e.commandList;if(p.render||p.pick){let P=this._colorCommands,w=this._blendOption===Ro.OPAQUE,M=this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,Z=b.length,E=this._uniforms,X;l(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),X=this._batchTable.getPickId()):X="v_pickColor",P.length=Z;let F=M?Z*2:Z;for(let N=0;N<F;++N){let O=P[N];l(O)||(O=P[N]=new $e);let U=w||M&&N%2===0;O.pass=U||!M?Ee.OPAQUE:Ee.TRANSLUCENT,O.owner=this;let Y=M?Math.floor(N/2):N;O.boundingVolume=f,O.modelMatrix=x,O.count=b[Y].indicesCount,O.shaderProgram=U?this._sp:this._spTranslucent,O.uniformMap=E,O.vertexArray=b[Y].va,O.renderState=U?this._rsOpaque:this._rsTranslucent,O.debugShowBoundingVolume=this.debugShowBoundingVolume,O.pickId=X,this._instanced&&(O.count=6,O.instanceCount=i),v.push(O)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=P8e(this,e.context)),v.push(this.debugCommand))}this._allBillboardsReady=o};Ju.prototype.isDestroyed=function(){return!1};Ju.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Sme(this._billboards),me(this)};var Fd=Ju;var p7n=T(S(),1);var a7n=T(S(),1);function w8e(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var pT=w8e;function pa(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),k1(this)}var F8e=new he;Object.defineProperties(pa.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=B.clone(e,this._color),k1(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,k1(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=B.clone(e,this._pointOutlineColor),k1(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,k1(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,F8e);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=B.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&k1(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});pa.defaultColor=B.WHITE;pa.defaultPointOutlineColor=B.BLACK;pa.defaultPointOutlineWidth=0;pa.defaultPointSize=8;function k1(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,pa.defaultColor),i=y(e._pointOutlineColor,pa.defaultPointOutlineColor),o=y(e._pointOutlineWidth,pa.defaultPointOutlineWidth),r=y(e._pointSize,pa.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(B.equals(n,s)&&B.equals(i,a)&&o===c&&r===d)return;e._billboardColor=B.clone(n,e._billboardColor),e._billboardOutlineColor=B.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,pT(u,h,p,o,r))}pa.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};pa.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};pa.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};pa.prototype.getPropertyInherited=function(e){return Os.getPropertyInherited(this._content,this._batchId,e)};pa.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};pa.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};pa.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};pa.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var kb=pa;var i6n=T(S(),1);var Kme=T(kme(),1);var w7n=T(S(),1);var x7n=T(S(),1),M8e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Do=Object.freeze(M8e);var Ume={},Dme=0,N8e=256,k8e=new B(.165,.165,.165,.8),U8e=new D(7,5),ps=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function bT(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function UP(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function DP(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Ome(e){let t=Ume[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(DP(n,"line-height"));isNaN(i)&&(i=void 0),t={family:DP(n,"font-family"),size:DP(n,"font-size").replace("px",""),style:DP(n,"font-style"),weight:DP(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Dme<N8e&&(Ume[e._font]=t,Dme++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function ph(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=wt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=B.clone(y(e.fillColor,B.WHITE)),this._outlineColor=B.clone(y(e.outlineColor,B.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=B.clone(y(e.backgroundColor,k8e)),this._backgroundPadding=D.clone(y(e.backgroundPadding,U8e)),this._style=y(e.style,Do.FILL),this._verticalOrigin=y(e.verticalOrigin,An.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,_i.LEFT),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._position=m.clone(y(e.position,m.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,Je.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Ome(this),this._updateClamping()}Object.defineProperties(ph.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),UP(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=ph.filterUnsupportedCharacters(e);this._renderedText=ph.enableRightToLeftDetection?z8e(t):t,bT(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,bT(this),Ome(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;B.equals(t,e)||(B.clone(e,t),bT(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),bT(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,bT(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,bT(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!B.equals(t,e)){B.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;D.equals(t,e)||(D.clone(e,t),UP(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,bT(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!D.equals(t,e)){D.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!kt.equals(t,e)){this._translucencyByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!kt.equals(t,e)){this._pixelOffsetScaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!kt.equals(t,e)){this._scaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,UP(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),UP(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),UP(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!wt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});ph.prototype._updateClamping=function(){lo._updateClamping(this._labelCollection,this)};ph.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new D);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return lo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};ph.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===An.BOTTOM||e.verticalOrigin===An.BASELINE?o-=s:e.verticalOrigin===An.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,h=e._glyphs,p=h.length;for(let g=0;g<p;++g){let f=h[g],x=f.billboard;if(!l(x))continue;let _=t.x+x._translate.x,C=t.y-x._translate.y,V=f.dimensions.width*a,L=f.dimensions.height*a;e.verticalOrigin===An.BOTTOM||e.verticalOrigin===An.BASELINE?C-=L:e.verticalOrigin===An.CENTER&&(C-=L*.5),e._verticalOrigin===An.TOP?C+=Ks.PADDING*a:(e._verticalOrigin===An.BOTTOM||e._verticalOrigin===An.BASELINE)&&(C-=Ks.PADDING*a),i=Math.min(i,_),o=Math.min(o,C),d=Math.max(d,_+V),u=Math.max(u,C+L)}r=d-i,s=u-o}return l(n)||(n=new Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};ph.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};ph.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&B.equals(this._fillColor,e._fillColor)&&B.equals(this._outlineColor,e._outlineColor)&&B.equals(this._backgroundColor,e._backgroundColor)&&D.equals(this._backgroundPadding,e._backgroundPadding)&&D.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};ph.prototype.isDestroyed=function(){return!1};ph.enableRightToLeftDetection=!1;function D8e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ps.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=ps.RTL:n.test(u)?a=ps.LTR:i.test(u)?a=ps.BRACKETS:a=ps.WEAK,d===0&&(s=a),s===a&&a!==ps.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function B8e(e){return e.split("").reverse().join("")}function BP(e,t,n){return e.slice(0,t)+n+e.slice(t)}function O8e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Y8e="\u05D0-\u05EA",H8e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Bme=new RegExp(`[${Y8e}${H8e}]`);function z8e(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Bme.test(o.charAt(0)),s=D8e(o,Bme),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],h=u.Type===ps.BRACKETS?O8e(u.Word):B8e(u.Word);r?u.Type===ps.RTL?(c=h+c,a=0):u.Type===ps.LTR?(c=BP(c,a,u.Word),a+=u.Word.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(u.Type===ps.WEAK&&s[d-1].Type===ps.BRACKETS?c=h+c:s[d-1].Type===ps.RTL?(c=h+c,a=0):s.length>d+1?s[d+1].Type===ps.RTL?(c=h+c,a=0):(c=BP(c,a,u.Word),a+=u.Word.length):c=BP(c,0,h)):u.Type===ps.RTL?c=BP(c,a,h):u.Type===ps.LTR?(c+=u.Word,a=c.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(d>0&&s[d-1].Type===ps.RTL?s.length>d+1?s[d+1].Type===ps.RTL?c=BP(c,a,h):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
`)}return n}var ty=ph;var Jme=T(Yme(),1);function J8e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Q8e=1.2,Hme="ID_WHITE_PIXEL",YJ=new D(4,4),j8e=new Ke(1,1,1,1);function q8e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=YJ.x,o.height=YJ.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Hme,o),n.addImageSubRegion(Hme,j8e)}let i=e.add({collection:t});return i.setImageTexture(n),i}var Ub={};function $8e(e,t,n,i,o,r){return Ub.font=t,Ub.fillColor=n,Ub.strokeColor=i,Ub.strokeWidth=o,Ub.padding=Ks.PADDING,Ub.fill=r===Do.FILL||r===Do.FILL_AND_OUTLINE,Ub.stroke=r===Do.OUTLINE||r===Do.FILL_AND_OUTLINE,Ub.backgroundColor=B.BLACK,jx(e,Ub)}function HJ(e,t){let n=t.billboard;l(n)&&(n.show=!1,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var e7e=new Jme.default,t7e=/\s/;function n7e(e,t){let n=t._renderedText,i=e7e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Ks.FONT_SIZE,o<s)for(let g=o;g<s;++g)HJ(e,r[g]);r.length=o;let a=t.show&&t._showBackground&&n.split(`
`).join("").length>0,c=t._backgroundBillboard,d=e._backgroundBillboardCollection;a?(l(c)||(c=q8e(d,e),t._backgroundBillboard=c),c.color=t._backgroundColor,c.show=t._show,c.position=t._position,c.eyeOffset=t._eyeOffset,c.pixelOffset=t._pixelOffset,c.horizontalOrigin=_i.LEFT,c.verticalOrigin=t._verticalOrigin,c.heightReference=t._heightReference,c.scale=t.totalScale,c.pickPrimitive=t,c.id=t._id,c.translucencyByDistance=t._translucencyByDistance,c.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,c.scaleByDistance=t._scaleByDistance,c.distanceDisplayCondition=t._distanceDisplayCondition,c.disableDepthTestDistance=t._disableDepthTestDistance,c.clusterShow=t.clusterShow):l(c)&&(d.remove(c),t._backgroundBillboard=c=void 0);let u=e._glyphBillboardCollection,h=u.billboardTextureCache,p=e._textDimensionsCache;for(let g=0;g<o;++g){let f=i[g],x=t._verticalOrigin,_=JSON.stringify([f,t._fontFamily,t._fontStyle,t._fontWeight,+x]),C=p[_],V=h.get(_);if(!l(V)||!l(C)){V=new Nb(u),h.set(_,V);let I=`${t._fontStyle} ${t._fontWeight} ${Ks.FONT_SIZE}px ${t._fontFamily}`,v=$8e(f,I,B.WHITE,B.WHITE,0,Do.FILL);if(C=v.dimensions,p[_]=C,v.width>0&&v.height>0&&!t7e.test(f)){let P=(0,Kme.default)(v,{cutoff:Ks.CUTOFF,radius:Ks.RADIUS}),w=v.getContext("2d"),M=v.width,b=v.height,Z=w.getImageData(0,0,M,b);for(let E=0;E<M;E++)for(let X=0;X<b;X++){let F=X*M+E,N=P[F]*255,O=F*4;Z.data[O+0]=N,Z.data[O+1]=N,Z.data[O+2]=N,Z.data[O+3]=N}w.putImageData(Z,0,0),V.loadImage(_,v)}}let L=r[g];if(l(L)||(L=new J8e,L.dimensions=C,L.billboardTexture=V,r[g]=L),L.billboardTexture.id!==_&&(L.billboardTexture=V,L.dimensions=C),!V.hasImage){HJ(e,L);continue}let R=L.billboard,G=e._spareBillboards;l(R)||(G.length>0?R=G.pop():(R=u.add({collection:e}),R._labelDimensions=new D,R._labelTranslate=new D),L.billboard=R),R.setImageTexture(V),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=_i.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t.totalScale,R.pickPrimitive=t,R.id=t._id,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.scaleByDistance=t._scaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition,R.disableDepthTestDistance=t._disableDepthTestDistance,R._batchIndex=t._batchIndex,R.outlineColor=t.outlineColor,t.style===Do.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===Do.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===Do.OUTLINE&&(R.color=B.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function zme(e,t,n){return t===_i.CENTER?-e/2:t===_i.RIGHT?-(e+n.x):n.x}var ur=new D,i7e=new D;function o7e(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,d=t.length,u=e._backgroundBillboard,h=D.clone(l(u)?e._backgroundPadding:D.ZERO,i7e);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let w=0;w<d;++w){if(n.charAt(w)===`
`){r.push(i),++c,i=0;continue}let b=t[w].dimensions;l(b)&&(a=Math.max(a,b.height-b.descent),s=Math.max(s,b.descent),i+=b.width-b.minx,w<d-1&&(i+=t[w+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,g=e.totalScale,f=e._horizontalOrigin,x=e._verticalOrigin,_=0,C=r[_],V=zme(C,f,h),L=(l(e._lineHeight)?e._lineHeight:Q8e*e._fontSize)/e._relativeSize,R=L*(c-1),G=o,I=p+R;l(u)&&(G+=h.x*2,I+=h.y*2,u._labelHorizontalOrigin=f),ur.x=V*g,ur.y=0;let v=!0,P=0;for(let w=0;w<d;++w){if(n.charAt(w)===`
`){++_,P+=L,C=r[_],V=zme(C,f,h),ur.x=V*g,v=!0;continue}let M=t[w],b=M.dimensions;if(l(b)&&(x===An.TOP?(ur.y=b.height-a-h.y,ur.y+=Ks.PADDING):x===An.CENTER?ur.y=(R+b.height-a)/2:x===An.BASELINE?(ur.y=R,ur.y-=Ks.PADDING):(ur.y=R+s+h.y,ur.y-=Ks.PADDING),ur.y=(ur.y-b.descent-P)*g,v&&(ur.x-=Ks.PADDING*g,v=!1),l(M.billboard)&&(M.billboard._setTranslate(ur),M.billboard._labelDimensions.x=G,M.billboard._labelDimensions.y=I,M.billboard._labelHorizontalOrigin=f),w<d-1)){let Z=t[w+1];ur.x+=(b.width-b.minx+Z.dimensions.minx)*g}}if(l(u)&&n.split(`
`).join("").length>0&&(f===_i.CENTER?V=-o/2-h.x:f===_i.RIGHT?V=-(o+h.x*2):V=0,ur.x=V*g,x===An.TOP?ur.y=p-a-s:x===An.CENTER?ur.y=(p-a)/2-s:x===An.BASELINE?ur.y=-h.y-s:ur.y=0,ur.y=ur.y*g,u.width=G,u.height=I,u._setTranslate(ur),u._labelTranslate=D.clone(ur,u._labelTranslate)),Mu(e.heightReference))for(let w=0;w<d;++w){let b=t[w].billboard;l(b)&&(b._labelTranslate=D.clone(ur,b._labelTranslate))}}function Qme(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)HJ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),me(t)}function Ff(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable;let t=new Fd({scene:this._scene,textureAtlas:new Lx({initialSize:YJ})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Nb(t),this._glyphBillboardCollection=new Fd({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=B.clone(B.WHITE),this.show=y(e.show,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Ro.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Ff.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});Ff.prototype.add=function(e){let t=new ty(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Ff.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Qme(this,e),!0}return!1};Ff.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Qme(this,e[t]);e.length=0};Ff.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Ff.prototype.get=function(e){return this._labels[e]};Ff.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let s=this._labelsToUpdate[r];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(n7e(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(o7e(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Ro.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Ff.prototype.isDestroyed=function(){return!1};Ff.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),me(this)};var Af=Ff;var nqn=T(S(),1);var r6n=T(S(),1),OP=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 position2DHigh;
in vec3 position2DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 prevPosition2DHigh;
in vec3 prevPosition2DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec3 nextPosition2DHigh;
in vec3 nextPosition2DLow;
in vec4 texCoordExpandAndBatchIndex;

out vec2  v_st;
out float v_width;
out vec4 v_pickColor;
out float v_polylineAngle;

void main()
{
    float texCoord = texCoordExpandAndBatchIndex.x;
    float expandDir = texCoordExpandAndBatchIndex.y;
    bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
    float batchTableIndex = texCoordExpandAndBatchIndex.w;

    vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
    float width = widthAndShow.x + 0.5;
    float show = widthAndShow.y;

    if (width < 1.0)
    {
        show = 0.0;
    }

    vec4 pickColor = batchTable_getPickColor(batchTableIndex);

    vec4 p, prev, next;
    if (czm_morphTime == 1.0)
    {
        p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
        prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
        next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
    }
    else if (czm_morphTime == 0.0)
    {
        p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
        prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
        next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
    }
    else
    {
        p = czm_columbusViewMorph(
                czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
                czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
                czm_morphTime);
        prev = czm_columbusViewMorph(
                czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
                czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
                czm_morphTime);
        next = czm_columbusViewMorph(
                czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
                czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
                czm_morphTime);
    }

    #ifdef DISTANCE_DISPLAY_CONDITION
        vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
        vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
        vec3 centerLow = centerLowAndRadius.xyz;
        float radius = centerLowAndRadius.w;
        vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);

        float lengthSq;
        if (czm_sceneMode == czm_sceneMode2D)
        {
            lengthSq = czm_eyeHeight2D.y;
        }
        else
        {
            vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
            lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
        }

        float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
        float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
        if (lengthSq < nearSq || lengthSq > farSq)
        {
            show = 0.0;
        }
    #endif

    float polylineAngle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
    gl_Position = czm_viewportOrthographic * positionWC * show;

    v_st.s = texCoord;
    v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);

    v_width = width;
    v_pickColor = pickColor;
    v_polylineAngle = polylineAngle;
}
`;var g6n=T(S(),1);function Ad(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=zi.fromType(zi.ColorType,{color:new B(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=To(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=A.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=vi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(qme),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var jme=Ad.POSITION_INDEX=0,r7e=Ad.SHOW_INDEX=1,s7e=Ad.WIDTH_INDEX=2,a7e=Ad.MATERIAL_INDEX=3,YP=Ad.POSITION_SIZE_INDEX=4,c7e=Ad.DISTANCE_DISPLAY_CONDITION=5,qme=Ad.NUMBER_OF_PROPERTIES=6;function Db(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ad.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Db(this,r7e))}},positions:{get:function(){return this._positions},set:function(e){let t=To(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Db(this,YP),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Db(this,jme),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Db(this,a7e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Db(this,s7e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Db(this,YP)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),Db(this,c7e))}}});Ad.prototype.update=function(){let e=A.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[jme]>0||this._propertiesChanged[YP]>0;if((!A.equals(e,this._modelMatrix)||i)&&(this._segments=vi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=A.clone(e,this._modelMatrix),this._segments.positions.length!==t)Db(this,YP);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Db(this,YP);break}}};Ad.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ad.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<qme-1;++t)e[t]=0};Ad.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Qu=Ad;var l7e=Qu.SHOW_INDEX,d7e=Qu.WIDTH_INDEX,KJ=Qu.POSITION_INDEX,u7e=Qu.MATERIAL_INDEX,$me=Qu.POSITION_SIZE_INDEX,m7e=Qu.DISTANCE_DISPLAY_CONDITION,she=Qu.NUMBER_OF_PROPERTIES,zl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function bh(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(A.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(she),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=B.clone(B.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(bh.prototype,{length:{get:function(){return JJ(this),this._polylines.length}}});bh.prototype.add=function(e){let t=new Qu(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};bh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};bh.prototype.removeAll=function(){QJ(this),uhe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};bh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};bh.prototype.get=function(e){return JJ(this),this._polylines[e]};function h7e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Q.FLOAT,componentsPerAttribute:2}];e._batchTable=new y_(t,n,e._polylines.length)}var ahe=new On,che=new se,lhe=new D;bh.prototype.update=function(e){if(JJ(this),this._polylines.length===0||!this.show)return;x7e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(At.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");h7e(this,t),this._createBatchTable=!1}if(this._createVertexArray||p7e(this))nhe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[$me]||o[u7e])nhe(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let h=0;h<d;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,g=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[KJ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=u[f].lengthOfPositions}if((o[l7e]||o[d7e])&&this._batchTable.setBatchedAttribute(i._index,0,new D(i._width,i._show)),this._batchTable.attributes.length>2){if(o[KJ]||o[$me]){let f=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=On.fromCartesian(f.center,ahe),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,che);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[m7e]){let f=lhe;f.x=0,f.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(f.x=x.near,f.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<she;++c)o[c]=0;let r=A.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ue.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;f7e(this,e,c,r)}};var HP=new le,ehe=new le;function f7e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=d.length;for(let f=0;f<g;++f){let x=d[f],_=x.buckets,C=_.length;for(let V=0;V<C;++V){let L=_[V],R=L.offset,G=L.bucket.shaderProgram,I=L.bucket.polylines,v=I.length,P,w,M=0,b,Z;for(let E=0;E<v;++E){let X=I[E],F=g7e(X._material);if(F!==P){if(l(P)&&M>0){let Y=w.isTranslucent();a>=s?(b=new $e({owner:e}),n.push(b)):b=n[a],++a,Z=St(p(w._uniforms),e._uniformMap),b.boundingVolume=le.clone(HP,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=Y?e._translucentRS:e._opaqueRS,b.pass=Y?Ee.TRANSLUCENT:Ee.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=Z,b.count=M,b.offset=R,R+=M,M=0,c=!0,r.push(b)}w=X._material,w.update(o),P=F}let N=X._locatorBuckets,O=N.length;for(let Y=0;Y<O;++Y){let k=N[Y];k.locator===L&&(M+=k.count)}let U;t.mode===oe.SCENE3D?U=X._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?U=X._boundingVolume2D:t.mode===oe.SCENE2D?l(X._boundingVolume2D)&&(U=le.clone(X._boundingVolume2D,ehe),U.center.x=0):l(X._boundingVolumeWC)&&l(X._boundingVolume2D)&&(U=le.union(X._boundingVolumeWC,X._boundingVolume2D,ehe)),c?(c=!1,le.clone(U,HP)):le.union(U,HP,HP)}l(P)&&M>0&&(a>=s?(b=new $e({owner:e}),n.push(b)):b=n[a],++a,Z=St(p(w._uniforms),e._uniformMap),b.boundingVolume=le.clone(HP,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=w.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=w.isTranslucent()?Ee.TRANSLUCENT:Ee.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=Z,b.count=M,b.offset=R,c=!0,r.push(b)),P=void 0}}n.length=a}bh.prototype.isDestroyed=function(){return!1};bh.prototype.destroy=function(){return dhe(this),QJ(this),uhe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function p7e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[KJ]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var the=[0,0,0];function nhe(e,t,n){e._createVertexArray=!1,QJ(e),dhe(e),y7e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),u+=g.lengthOfPositions);if(u>0){let f=e._mode,x=new Float32Array(6*u*3),_=new Float32Array(u*4),C,V=0,L=0,R=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(x,_,V,L,R,r,t,n),f===oe.MORPHING&&(l(C)||(C=new Float32Array(6*u*3)),g.writeForMorph(C,V));let Z=g.lengthOfPositions;V+=6*Z*3,L+=Z*4,R+=Z*4,c=g.updateIndices(i,a,d,c)}let G=e._positionBufferUsage.bufferUsage,I=Me.STATIC_DRAW;e._positionBuffer=xt.createVertexBuffer({context:t,typedArray:x,usage:G});let v;l(C)&&(v=xt.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=xt.createVertexBuffer({context:t,typedArray:_,usage:I});let P=3*Float32Array.BYTES_PER_ELEMENT,w=4*Float32Array.BYTES_PER_ELEMENT,M=0,b=i.length;for(let Z=0;Z<b;++Z)if(o=i[Z],o.length>0){let E=new Uint16Array(o),X=xt.createIndexBuffer({context:t,typedArray:E,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});M+=a[Z];let F=6*(Z*(P*W.SIXTY_FOUR_KILOBYTES)-M*P),N=P+F,O=P+N,U=P+O,Y=P+U,k=P+Y,H=Z*(w*W.SIXTY_FOUR_KILOBYTES)-M*w,K=[{index:zl.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:F,strideInBytes:6*P},{index:zl.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:zl.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:F,strideInBytes:6*P},{index:zl.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:zl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:zl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:zl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:zl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:zl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:zl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:zl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:zl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:zl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],te,z,j,ee;f===oe.SCENE3D?(z=e._positionBuffer,te="vertexBuffer",j=the,ee="value"):f===oe.SCENE2D||f===oe.COLUMBUS_VIEW?(z=the,te="value",j=e._positionBuffer,ee="vertexBuffer"):(z=v,te="vertexBuffer",j=e._positionBuffer,ee="vertexBuffer"),K[0][te]=z,K[1][te]=z,K[2][ee]=j,K[3][ee]=j,K[4][te]=z,K[5][te]=z,K[6][ee]=j,K[7][ee]=j,K[8][te]=z,K[9][te]=z,K[10][ee]=j,K[11][ee]=j;let fe=new ni({context:t,attributes:K,indexBuffer:X});e._vertexArrays.push({va:fe,buckets:d[Z]})}}}function b7e(e,t){return t instanceof vt?t.id:t}var rU=[];function g7e(e){let t=zi._uniformList[e.type],n=t.length;rU.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];rU[i]=r,rU[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(rU,b7e)}`}function y7e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new Mf(c,t,n)),d.addPolyline(a)}}}function x7e(e,t){let n=t.mode;(e._mode!==n||!A.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=A.clone(e.modelMatrix),e._createVertexArray=!0)}function JJ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function QJ(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function dhe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}bh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function uhe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function zJ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Mf(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Mf.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Mf.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Bt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new De({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,C_]}),r=t.getVertexShaderCallback()(OP),s=new De({defines:i,sources:[Rd,r]});this.shaderProgram=$t.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:zl})};function mhe(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===Ht.INTERSECTING}Mf.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!mhe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Gs=new m,ju=new m,qu=new m,sU=new m,_7e=new se,T7e=new D;Mf.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,h=u.length;for(let p=0;p<h;++p){let g=u[p],f=g.width,x=g.show&&f>0,_=g._index,C=this.getSegments(g,a),V=C.positions,L=C.lengths,R=V.length,G=g.getPickId(s).color,I=0,v=0,P;for(let O=0;O<R;++O){O===0?g._loop?P=V[R-2]:(P=sU,m.subtract(V[0],V[1],P),m.add(V[0],P,P)):P=V[O-1],m.clone(P,ju),m.clone(V[O],Gs),O===R-1?g._loop?P=V[1]:(P=sU,m.subtract(V[R-1],V[R-2],P),m.add(V[R-1],P,P)):P=V[O+1],m.clone(P,qu);let U=L[I];O===v+U&&(v+=U,++I);let Y=O-v===0,k=O===v+L[I]-1;c===oe.SCENE2D&&(ju.z=0,Gs.z=0,qu.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(Y||k)&&d-Math.abs(Gs.x)<1&&((Gs.x<0&&ju.x>0||Gs.x>0&&ju.x<0)&&m.clone(Gs,ju),(Gs.x<0&&qu.x>0||Gs.x>0&&qu.x<0)&&m.clone(Gs,qu));let H=Y?2:0,K=k?2:4;for(let te=H;te<K;++te){On.writeElements(Gs,e,n),On.writeElements(ju,e,n+6),On.writeElements(qu,e,n+12);let z=te-2<0?-1:1;t[o]=O/(R-1),t[o+1]=2*(te%2)-1,t[o+2]=z,t[o+3]=_,n+=6*3,o+=4}}let w=_7e;w.x=B.floatToByte(G.red),w.y=B.floatToByte(G.green),w.z=B.floatToByte(G.blue),w.w=B.floatToByte(G.alpha);let M=T7e;M.x=f,M.y=x?1:0;let b=c===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,Z=On.fromCartesian(b.center,ahe),E=Z.high,X=se.fromElements(Z.low.x,Z.low.y,Z.low.z,b.radius,che),F=lhe;F.x=0,F.y=Number.MAX_VALUE;let N=g.distanceDisplayCondition;l(N)&&(F.x=N.near,F.y=N.far),r.setBatchedAttribute(_,0,M),r.setBatchedAttribute(_,1,w),r.attributes.length>2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,X),r.setBatchedAttribute(_,4,F))}};var S7e=new m,C7e=new m,V7e=new m,ihe=new m;Mf.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,h=0;for(let p=0;p<d;++p){let g;p===0?s._loop?g=a[d-2]:(g=ihe,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=A.multiplyByPoint(n,g,C7e);let f=A.multiplyByPoint(n,a[p],S7e),x;p===d-1?s._loop?x=a[1]:(x=ihe,m.subtract(a[d-1],a[d-2],x),m.add(a[d-1],x,x)):x=a[p+1],x=A.multiplyByPoint(n,x,V7e);let _=c[u];p===h+_&&(h+=_,++u);let C=p-h===0,V=p===h+c[u]-1,L=C?2:0,R=V?2:4;for(let G=L;G<R;++G)On.writeElements(f,e,t),On.writeElements(g,e,t+6),On.writeElements(x,e,t+12),t+=6*3}}};var L7e=new Array(1);Mf.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new zJ(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let h=0;h<u;++h){let p=d[h];p._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=L7e;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let x=0;for(let _=0;_<f;++_){let C=g[_]-1;for(let V=0;V<C;++V)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new zJ(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new zJ(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Mf.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var U1={positions:void 0,lengths:void 0},ohe=new Array(1),R7e=new m,Z7e=new he;Mf.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return ohe[0]=n.length,U1.positions=n,U1.lengths=ohe,U1;mhe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=R7e;for(let d=0;d<s;++d)a=n[d],c=A.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,Z7e)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return U1.positions=o,U1.lengths=e._segments.lengths,U1};var rhe;Mf.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=rhe,c=6*s*3;!l(a)||a.length<c?a=rhe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,h=d.lengths,p=0,g=0,f=0,x;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?x=u[s-2]:(x=sU,m.subtract(u[0],u[1],x),m.add(u[0],x,x)):x=u[_-1],m.clone(x,ju),m.clone(u[_],Gs),_===s-1?t._loop?x=u[1]:(x=sU,m.subtract(u[s-1],u[s-2],x),m.add(u[s-1],x,x)):x=u[_+1],m.clone(x,qu);let C=h[g];_===f+C&&(f+=C,++g);let V=_-f===0,L=_===f+h[g]-1;o===oe.SCENE2D&&(ju.z=0,Gs.z=0,qu.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(V||L)&&r-Math.abs(Gs.x)<1&&((Gs.x<0&&ju.x>0||Gs.x>0&&ju.x<0)&&m.clone(Gs,ju),(Gs.x<0&&qu.x>0||Gs.x>0&&qu.x<0)&&m.clone(Gs,qu));let R=V?2:0,G=L?2:4;for(let I=R;I<G;++I)On.writeElements(Gs,a,p),On.writeElements(ju,a,p+6),On.writeElements(qu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var gh=bh;function ny(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Fd({batchTable:e.batchTable}),this._labelCollection=new Af({batchTable:e.batchTable}),this._polylineCollection=new gh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ny.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function G7e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ce.pack(n,s,a),a+=ce.packedLength,ne.pack(t,s,a),s}var E7e=new yi("createVectorTilePoints",5),I7e=new m;function X7e(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=G7e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=E7e.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let f=h[g],x=m.unpack(n,g*3,I7e),_=c.add();_.position=x,_._batchIndex=f;let C=d.add();C.text=" ",C.position=x,C._batchIndex=f;let V=u.add();V.positions=[m.clone(x),m.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}ny.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),h=o.get(a);t[c]=new kb(e,c,d,u,h)}};ny.prototype.applyDebugSettings=function(e,t){e?(B.clone(t,this._billboardCollection._highlightColor),B.clone(t,this._labelCollection._highlightColor),B.clone(t,this._polylineCollection._highlightColor)):(B.clone(B.WHITE,this._billboardCollection._highlightColor),B.clone(B.WHITE,this._labelCollection._highlightColor),B.clone(B.WHITE,this._polylineCollection._highlightColor))};function W7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=kb.defaultPointSize,s.color=kb.defaultColor,s.pointOutlineColor=kb.defaultPointOutlineColor,s.pointOutlineWidth=kb.defaultPointOutlineWidth,s.labelColor=B.WHITE,s.labelOutlineColor=B.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Do.FILL,s.labelText=void 0,s.backgroundColor=new B(.165,.165,.165,.8),s.backgroundPadding=new D(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=B.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=_i.CENTER,s.verticalOrigin=An.CENTER,s.labelHorizontalOrigin=_i.RIGHT,s.labelVerticalOrigin=An.BASELINE}}var P7e=new B,v7e=new B,w7e=new B,F7e=new B,A7e=new B,M7e=new B,zP=new kt,KP=new kt,jJ=new wt;ny.prototype.applyStyle=function(e,t){if(!l(e)){W7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,P7e)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,v7e)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,w7e)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,F7e)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,A7e)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(zP.near=a.x,zP.nearValue=a.y,zP.far=a.z,zP.farValue=a.w,s.scaleByDistance=zP):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(KP.near=a.x,KP.nearValue=a.y,KP.far=a.z,KP.farValue=a.w,s.translucencyByDistance=KP):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(jJ.near=a.x,jJ.far=a.y,s.distanceDisplayCondition=jJ):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,M7e)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};ny.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=X7e(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};ny.prototype.isDestroyed=function(){return!1};ny.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),me(this)};var JP=ny;var Fqn=T(S(),1);function Bb(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,m.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Dn.BOTH}Object.defineProperties(Bb.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function N7e(e){let t=new Float64Array(3+m.packedLength+ne.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,ce.pack(e._rectangle,t,n),t}function k7e(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Gn.unpack(t,n),n+=Gn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=B.unpack(t,n);n+=B.packedLength;let d=t[n++],u=t[n++],h=t[n++],p=new Array(h);for(let g=0;g<h;++g)p[g]=t[n++];s[a]=new Zf({color:c,offset:d,count:u,batchIds:p})}}var U7e=new yi("createVectorTilePolygons",5),D7e=new B;function B7e(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,f=s.length;for(let x=0;x<f;++x){let _=g.getColor(x,D7e);s[x]=_.toRgba()}a=e._packedBuffer=N7e(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(u)&&l(h)&&(u=u.slice(),h=h.slice(),c.push(u.buffer,h.buffer),d.minimumHeights=u,d.maximumHeights=h);let p=U7e.scheduleTask(d,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),x=f[0];k7e(e,f),e._indices=Ae.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),O7e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function O7e(e){l(e._primitive)||(e._primitive=new B_({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Bb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Bb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Bb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Bb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Bb.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=B7e(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Bb.prototype.isDestroyed=function(){return!1};Bb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var QP=Bb;var d$n=T(S(),1);var Mqn=T(S(),1),jP=`in vec4 currentPosition;
in vec4 previousPosition;
in vec4 nextPosition;
in vec2 expandAndWidth;
in float a_batchId;

uniform mat4 u_modifiedModelView;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = u_modifiedModelView * currentPosition;
    vec4 prev = u_modifiedModelView * previousPosition;
    vec4 next = u_modifiedModelView * nextPosition;

    float angle;
    vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;
}
`;function yh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(yh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Y7e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var H7e=new yi("createVectorTilePolylines",5),D1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function z7e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Y7e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=H7e.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let h=u.indexDatatype;e._indices=h===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),K7e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function K7e(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=xt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),u=xt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),h=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),p=xt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),g=xt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),f=xt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),x=[{index:D1.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:D1.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:D1.nextPosition,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:D1.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:D1.a_batchId,vertexBuffer:g,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:x,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var qP=new A,hhe=new m;function J7e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return A.clone(n,qP),A.multiplyByPoint(qP,e._center,hhe),A.setTranslation(qP,hhe,qP),qP},u_highlightColor:function(){return e._highlightColor}})}function Q7e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var j7e=`uniform vec4 u_highlightColor; 
void main()
{
    out_FragColor = u_highlightColor;
}
`;function q7e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(jP),o=n.getFragmentShaderCallback(!1,void 0,!1)(j7e),r=new De({defines:["VECTOR_TILE",Bt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Rd,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:D1})}function $7e(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ee.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}yh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(s=0;s<p;++s){let g=(h+s)*3;u[d++]=i[g],u[d++]=i[g+1],u[d++]=i[g+2]}}return u};yh.prototype.getPositions=function(e){return yh.getPolylinePositions(this,e)};yh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Os(e,r)}};yh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function e6e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=B.WHITE}}var t6e=new B,n6e=B.WHITE,i6e=!0;yh.prototype.applyStyle=function(e,t){if(!l(e)){e6e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,t6e):n6e,s.show=l(e.show)?e.show.evaluate(s):i6e}};yh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=z7e(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}J7e(this,t),q7e(this,t),Q7e(this);let n=e.passes;(n.render||n.pick)&&$7e(this,e)};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var gT=yh;var Q$n=T(S(),1);var m$n=T(S(),1),$P=`in vec3 startEllipsoidNormal;
in vec3 endEllipsoidNormal;
in vec4 startPositionAndHeight;
in vec4 endPositionAndHeight;
in vec4 startFaceNormalAndVertexCorner;
in vec4 endFaceNormalAndHalfWidth;
in float a_batchId;

uniform mat4 u_modifiedModelView;
uniform vec2 u_minimumMaximumVectorHeights;

out vec4 v_startPlaneEC;
out vec4 v_endPlaneEC;
out vec4 v_rightPlaneEC;
out float v_halfWidth;
out vec3 v_volumeUpEC;

void main()
{
    // vertex corner IDs
    //          3-----------7
    //         /|   left   /|
    //        / | 1       / |
    //       2-----------6  5  end
    //       | /         | /
    // start |/  right   |/
    //       0-----------4
    //
    float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
    float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top

    vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
    vec3 right = normalize(cross(forward, startEllipsoidNormal));

    vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
    position.xyz += forward * isEnd;

    v_volumeUpEC = czm_normal * normalize(cross(right, forward));

    // Push for volume height
    float offset;
    vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);

    // offset height to create volume
    offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
    offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
    position.xyz += offset * ellipsoidNormal;

    // move from RTC to EC
    position = u_modifiedModelView * position;
    right = czm_normal * right;

    // Push for width in a direction that is in the start or end plane and in a plane with right
    // N = normalEC ("right-facing" direction for push)
    // R = right
    // p = angle between N and R
    // w = distance to push along R if R == N
    // d = distance to push along N
    //
    //   N   R
    //  {  p| }      * cos(p) = dot(N, R) = w / d
    //  d  |  |w    * d = w / dot(N, R)
    //    { | }
    //       o---------- polyline segment ---->
    //
    vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
    scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
    vec3 miterPushNormal = czm_normal * normalize(scratchNormal);

    offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
    offset = offset / dot(miterPushNormal, right);
    position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));

    gl_Position = czm_depthClamp(czm_projection * position);

    position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
    vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
    v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
    v_rightPlaneEC = vec4(right, -dot(right, position.xyz));

    position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
    vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
    v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
    v_halfWidth = endFaceNormalAndHalfWidth.w;
}
`;var f$n=T(S(),1),ev=`in vec4 v_startPlaneEC;
in vec4 v_endPlaneEC;
in vec4 v_rightPlaneEC;
in float v_halfWidth;
in vec3 v_volumeUpEC;

uniform vec4 u_highlightColor;
void main()
{
    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));

    // Discard for sky
    if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);

    // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
    halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));

    // Check distance of the eye coordinate against the right-facing plane
    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);

    // Check eye coordinate against the mitering planes
    float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
    float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);

    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }
    out_FragColor = u_highlightColor;

    czm_writeDepthClamp();
}
`;function Ob(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new D(di._defaultMinTerrainHeight,di._defaultMaxTerrainHeight),this._boundingVolume=Gn.fromRectangle(e.rectangle,di._defaultMinTerrainHeight,di._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Ob.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function o6e(e,t,n){let i=di.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Gn.fromRectangle(c,o,r,n,a)}function r6e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var s6e=new yi("createVectorTileClampedPolylines"),iy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function a6e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=r6e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=s6e.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let h=u.indexDatatype;e._indices=h===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),c6e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function c6e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let h=xt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=xt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),f=xt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),x=xt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),_=xt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),C=xt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),V=xt.createIndexBuffer({context:t,typedArray:d,usage:Me.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),L=[{index:iy.startEllipsoidNormal,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:iy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:iy.startPositionAndHeight,vertexBuffer:g,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:iy.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:iy.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:iy.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:iy.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var tv=new A,fhe=new m;function l6e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return A.clone(n,tv),A.multiplyByPoint(tv,e._center,fhe),A.setTranslation(tv,fhe,tv),tv},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function phe(e){return Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Bn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Bn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function d6e(e){l(e._rs)||(e._rs=phe(!1),e._rs3DTiles=phe(!0))}function u6e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)($P),o=n.getFragmentShaderCallback(!1,void 0,!0)(ev),r=new De({defines:["VECTOR_TILE",Bt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Rd,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:iy})}function m6e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ee.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=$e.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Dn.TERRAIN||i===Dn.BOTH)&&t.commandList.push(n),(i===Dn.CESIUM_3D_TILE||i===Dn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Ob.prototype.getPositions=function(e){return gT.getPolylinePositions(this,e)};Ob.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Os(e,r)}};Ob.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function h6e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=B.WHITE}}var f6e=new B,p6e=B.WHITE,b6e=!0;Ob.prototype.applyStyle=function(e,t){if(!l(e)){h6e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,f6e):p6e,s.show=l(e.show)?e.show.evaluate(s):b6e}};function g6e(e){return di.initialize().then(function(){o6e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Ob.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=g6e(this).then(a6e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}l6e(this,t),u6e(this,t),d6e(this);let n=e.passes;(n.render||n.pick)&&m6e(this,e)};Ob.prototype.isDestroyed=function(){return!1};Ob.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var nv=Ob;function _h(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,S6e(this,i,o)}Object.defineProperties(_h.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function y6e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function x6e(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var xh=Uint32Array.BYTES_PER_ELEMENT;function _6e(e){return new gT(e)}function T6e(e){return new nv(e)}function S6e(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=xh;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported.  Version ${r} is not.`);n+=xh;let s=o.getUint32(n,!0);if(n+=xh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=xh,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=xh;let d=o.getUint32(n,!0);n+=xh;let u=o.getUint32(n,!0);n+=xh;let h=o.getUint32(n,!0);n+=xh;let p=o.getUint32(n,!0);n+=xh;let g=o.getUint32(n,!0);n+=xh;let f=o.getUint32(n,!0);n+=xh;let x=Jo(i,n,a);n+=a;let _=new Uint8Array(t,n,c);n+=c;let C,V;d>0&&(C=Jo(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=y(x.POLYGONS_LENGTH,0),R=y(x.POLYLINES_LENGTH,0),G=y(x.POINTS_LENGTH,0),I=L+R+G,v=new bb(e,I,C,V,y6e(e));if(e._batchTable=v,I===0)return;let P=new uh(x,_),w=P.getGlobalProperty("REGION");if(!l(w))throw new ae("Feature table global property: REGION must be defined");let M=ce.unpack(w),b=w[4],Z=w[5],E=e._tile.computedTransform,X=P.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(X)?(X=m.unpack(X),A.multiplyByPoint(E,X,X)):(X=ce.center(M),X.height=W.lerp(b,Z,.5),X=ne.WGS84.cartographicToCartesian(X));let F=x6e(x,_);if(n+=(4-n%4)%4,L>0){P.featuresLength=L;let N=y(P.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=y(P.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(O))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=N.reduce(function(z,j){return z+j*2},0),Y=O.reduce(function(z,j){return z+j},0),k=new Uint32Array(t,n,Y);n+=h;let H=new Uint16Array(t,n,U);n+=p;let K,te;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(K=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new QP({positions:H,counts:N,indexCounts:O,indices:k,minimumHeight:b,maximumHeight:Z,polygonMinimumHeights:K,polygonMaximumHeights:te,center:X,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:F.polygons,modelMatrix:E})}if(R>0){P.featuresLength=R;let N=y(P.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let O=P.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(O)){O=new Uint16Array(R);for(let te=0;te<R;++te)O[te]=2}let U=N.reduce(function(te,z){return te+z*3},0),Y=new Uint16Array(t,n,U);n+=g;let k=e._tileset,H=k.examineVectorLinesFunction;if(l(H)){let te=XI(new Uint16Array(Y),M,b,Z,ne.WGS84);C6e(te,N,F.polylines,v,e.url,H)}let K=_6e;l(k.classificationType)&&(K=T6e),e._polylines=K({positions:Y,widths:O,counts:N,batchIds:F.polylines,minimumHeight:b,maximumHeight:Z,center:X,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(G>0){let N=new Uint16Array(t,n,G*3);n+=f,e._points=new JP({positions:N,batchIds:F.points,minimumHeight:b,maximumHeight:Z,rectangle:M,batchTable:v})}}function qJ(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}_h.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};_h.prototype.getFeature=function(e){return l(this._features)||qJ(this),this._features[e]};_h.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};_h.prototype.applyStyle=function(e){l(this._features)||qJ(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};_h.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||qJ(this),this._batchTable.update(e,t),this._ready=!0)};_h.prototype.pick=function(e,t,n){};_h.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};_h.prototype.isDestroyed=function(){return!1};_h.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function C6e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var iv=_h;var bhe={b3dm:function(e,t,n,i,o){return wd.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return wd.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return wd.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return YX.fromTileType(e,t,n,i,o,bhe)},externalTileset:function(e,t,n,i){return FP.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new KX(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new iv(e,t,n,i,o)},subt:function(e,t,n,i,o){return V1.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return V1.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ae("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return wd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return wd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return wd.fromGeoJson(e,t,n,i)}},yT=bhe;var Zei=T(S(),1),V6e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Bo=Object.freeze(V6e);var Eei=T(S(),1),Th={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Th.isBinaryFormat=function(e){switch(e){case Th.BATCHED_3D_MODEL:case Th.INSTANCED_3D_MODEL:case Th.COMPOSITE:case Th.POINT_CLOUD:case Th.VECTOR:case Th.GEOMETRY:case Th.IMPLICIT_SUBTREE:case Th.VOXEL_BINARY:case Th.GLTF_BINARY:return!0;default:return!1}};var Es=Object.freeze(Th);var Xei=T(S(),1),L6e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},$u=Object.freeze(L6e);var Pei=T(S(),1),Js={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Yb=new Array(Js.NUMBER_OF_PASSES);Yb[Js.RENDER]=Object.freeze({pass:Js.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Yb[Js.PICK]=Object.freeze({pass:Js.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Yb[Js.SHADOW]=Object.freeze({pass:Js.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Yb[Js.PRELOAD]=Object.freeze({pass:Js.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yb[Js.PRELOAD_FLIGHT]=Object.freeze({pass:Js.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yb[Js.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Js.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yb[Js.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Js.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yb[Js.MOST_DETAILED_PICK]=Object.freeze({pass:Js.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Js.getPassOptions=function(e){return Yb[e]};var wo=Object.freeze(Js);var Fei=T(S(),1);function Nf(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Nf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});Nf.prototype.hasProperty=function(e,t){return!1};Nf.prototype.getFeature=function(e){};Nf.prototype.applyDebugSettings=function(e,t){};Nf.prototype.applyStyle=function(e){};Nf.prototype.update=function(e,t){};Nf.prototype.pick=function(e,t,n){};Nf.prototype.isDestroyed=function(){return!1};Nf.prototype.destroy=function(){return me(this)};var B1=Nf;var zei=T(S(),1);var kei=T(S(),1);function Hb(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Hb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Hb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Hb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Hb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Hb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Hb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Hb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Hb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var ov=Hb;function $J(e,t){let n=si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){$J._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new ov({content:n,class:o})}}$J._oneTimeWarning=_t;var xT=$J;var jei=T(S(),1);function R6e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var _T=R6e;var cti=T(S(),1);var tti=T(S(),1);function zb(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(zb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});zb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};zb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};zb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};zb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};zb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};zb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};zb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var rv=zb;function eQ(e,t){let n=si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){eQ._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new rv({tile:n,class:o})}}eQ._oneTimeWarning=_t;var sv=eQ;var Iti=T(S(),1);var pti=T(S(),1);function Z6e(e){let t=new Uint8Array(e),n=zm(t);if(n==="glTF"&&(n="glb"),Es.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=G6e(t);if(l(i.root))return{contentType:Es.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Es.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Es.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Es.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Es.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function G6e(e){let t;try{t=Jo(e)}catch{throw new ae("Invalid tile content.")}return t}var Kb=Z6e;function em(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=tc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(em.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function tQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function ghe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}em.prototype.requestInnerContents=function(){if(!E6e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;tQ(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=I6e(this,n,t,this._tile._contentState);return X6e(this)};function E6e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!tc.serverHasOpenSlots(n,t[n]))return!1;return tc.heapHasOpenSlots(e.length)}function I6e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Ho({throttle:!0,throttleByServer:!0,type:ds.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){ghe(e,i);return}return tQ(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){ghe(e,i);return}tQ(e,-1),yhe(e,t,u)}})}async function X6e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>W6e(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function W6e(e,t,n){if(l(t))try{let i=Kb(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Es.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Es.GEOMETRY||i.contentType===Es.VECTOR;let a,c=yT[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=xT(o,d));let u=_T(o,d);return l(u)&&(a.group=new N_({metadata:u})),a}catch(i){yhe(e,n,i)}}function yhe(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}em.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};em.prototype.hasProperty=function(e,t){return!1};em.prototype.getFeature=function(e){};em.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};em.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};em.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};em.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=m.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};em.prototype.isDestroyed=function(){return!1};em.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var av=em;var Qti=T(S(),1);function Y1(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=y(e.ellipsoid,ne.WGS84);A6e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(Y1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Y1.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Gn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var xhe=new m,aU=new m,_he=new m,P6e=new m,v6e=new m,w6e=new m,F6e=new m,tm=new he,The=new sn(m.UNIT_X,0),O1=new pn;function A6e(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),tm.longitude=t.west,tm.latitude=(t.south+t.north)*.5,tm.height=0;let i=n.cartographicToCartesian(tm,w6e),o=m.cross(i,m.UNIT_Z,P6e);m.normalize(o,e.westNormal),tm.longitude=t.east;let r=n.cartographicToCartesian(tm,F6e),s=m.cross(m.UNIT_Z,r,xhe);m.normalize(s,e.eastNormal);let a=m.subtract(i,r,xhe);m.magnitude(a)===0&&(a=m.clone(o,a));let c=m.normalize(a,v6e),d=t.south,u;if(d>0){tm.longitude=(t.west+t.east)*.5,tm.latitude=d;let x=n.cartographicToCartesian(tm,O1.origin);m.clone(c,O1.direction);let _=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,The);qn.rayPlane(O1,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,aU)}else u=n.geodeticSurfaceNormalCartographic(ce.southeast(t),aU);let h=m.cross(u,a,_he);m.normalize(h,e.southNormal);let p=t.north,g;if(p<0){tm.longitude=(t.west+t.east)*.5,tm.latitude=p;let x=n.cartographicToCartesian(tm,O1.origin);m.negate(c,O1.direction);let _=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,The);qn.rayPlane(O1,_,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,aU)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),aU);let f=m.cross(a,g,_he);m.normalize(f,e.northNormal)}var M6e=new m,N6e=new m,k6e=new m(0,-1,0),U6e=new m(0,0,-1),She=new m;function D6e(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==oe.SCENE3D&&(d=t.mapProjection.project(ce.southwest(e.rectangle),M6e),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(ce.northeast(e.rectangle),N6e),u.z=u.y,u.y=u.x,u.x=0,h=k6e,g=m.UNIT_Y,p=U6e,f=m.UNIT_Z);let x=m.subtract(i,d,She),_=m.dot(x,h),C=m.dot(x,p),V=m.subtract(i,u,She),L=m.dot(V,g),R=m.dot(V,f);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:R>0&&(r+=R*R)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}Y1.prototype.distanceToCamera=function(e){let t=D6e(this,e);if(e.mode===oe.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};Y1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Y1.prototype.createDebugVolume=function(e){let t=new A.clone(A.IDENTITY),n=new i_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Et({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Md=Y1;var fni=T(S(),1);var cU=new he;function cv(e){let t=eb.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ne.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=j6e(t,n,i,o);this._boundingPlanes=r;let s=tqe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=lQ(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=lQ(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=lQ(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();cU=o.cartesianToCartographic(c,cU),cU.height=(i+n)/2,this.center=o.cartographicToCartesian(cU,c),this._boundingSphere=le.fromPoints(s)}var B6e=new m,O6e=new he,Y6e=new m,H6e=new he,z6e=new m,K6e=new m,J6e=new m,Q6e=new m;function j6e(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,B6e),a=i.cartesianToCartographic(r,O6e);a.height=n;let c=i.cartographicToCartesian(a,Y6e),d=sn.fromPointNormal(c,s);o[0]=d;let u=0,h,p=[],g,f;for(h=0;h<4;h++){g=e.getVertex(h),p[h]=g,f=i.cartesianToCartographic(g,H6e),f.height=t;let _=sn.getPointDistance(d,i.cartographicToCartesian(f,z6e));_<u&&(u=_)}let x=sn.clone(d);for(x.normal=m.negate(x.normal,x.normal),x.distance=x.distance*-1+u,o[1]=x,h=0;h<4;h++){g=p[h];let _=p[(h+1)%4],C=i.geodeticSurfaceNormal(g,K6e),V=m.subtract(_,g,Q6e),L=m.cross(V,C,J6e);L=m.normalize(L,L),o[2+h]=sn.fromPointNormal(g,L)}return o}var TT=new m,ST=new m,CT=new m,nQ=new m,iQ=new m,oQ=new m,q6e=new m,$6e=new m,eqe=new m,rQ=new m,sQ=new m,aQ=new m,oy=new m,kf=new $;function Che(e,t,n){TT=e.normal,ST=t.normal,CT=n.normal,nQ=m.multiplyByScalar(e.normal,-e.distance,nQ),iQ=m.multiplyByScalar(t.normal,-t.distance,iQ),oQ=m.multiplyByScalar(n.normal,-n.distance,oQ),rQ=m.multiplyByScalar(m.cross(ST,CT,q6e),m.dot(nQ,TT),rQ),sQ=m.multiplyByScalar(m.cross(CT,TT,$6e),m.dot(iQ,ST),sQ),aQ=m.multiplyByScalar(m.cross(TT,ST,eqe),m.dot(oQ,CT),aQ),kf[0]=TT.x,kf[1]=ST.x,kf[2]=CT.x,kf[3]=TT.y,kf[4]=ST.y,kf[5]=CT.y,kf[6]=TT.z,kf[7]=ST.z,kf[8]=CT.z;let i=$.determinant(kf);return oy=m.add(rQ,sQ,oy),oy=m.add(oy,aQ,oy),new m(oy.x/i,oy.y/i,oy.z/i)}function tqe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Che(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Che(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var cQ=new m,H1=new m;function lQ(e,t){let n=[];for(let i=0;i<4;i++)cQ=m.subtract(t[(i+1)%4],t[i],cQ),H1=m.cross(e.normal,cQ,H1),H1=m.normalize(H1,H1),n[i]=m.clone(H1);return n}Object.defineProperties(cv.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var dQ=new m;cv.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=uQ(sn.projectPointOntoPlane(c,t,dQ),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Vhe(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=uQ(sn.projectPointOntoPlane(c,t,dQ),i[r],c,this._edgeNormals[n[r]]),h=m.distanceSquared(a,t),h<u&&(u=h);return Math.sqrt(u)}else if(n.length>3)return a=uQ(sn.projectPointOntoPlane(this._boundingPlanes[1],t,dQ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+d)%4]):m.distance(t,this._vertices[4+(n[1]-2+d)%4])};var nqe=new m,iqe=new m;function Vhe(e,t,n){let i=m.subtract(n,t,nqe),o=m.subtract(e,t,iqe),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var oqe=new sn(m.UNIT_X,0);function uQ(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=sn.fromPointNormal(t[c],i[c],oqe);sn.getPointDistance(d,e)<0||(a=Vhe(e,t[c],t[(c+1)%4]),r=m.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}cv.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Ht.INSIDE:n===this._vertices.length?Ht.OUTSIDE:Ht.INTERSECTING};cv.prototype.createDebugVolume=function(e){let t=new A.clone(A.IDENTITY),n=new Eu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Eu.createGeometry(n),o=new Et({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),r=new Eu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Eu.createGeometry(r),a=new Et({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new Eu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),h=Eu.createGeometry(u);c[d]=new Et({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var lv=cv;var Lni=T(S(),1);function z1(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(z1.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});z1.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};z1.prototype.intersectPlane=function(e){return le.intersectPlane(this._boundingSphere,e)};z1.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};z1.prototype.createDebugVolume=function(e){let t=new tb({radius:this.radius}),n=A.fromTranslation(this.center,new A.clone(A.IDENTITY)),i=new Et({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Jb=z1;var Mni=T(S(),1);var rqe=new m,sqe=new m,aqe=new m,cqe=new m;function VT(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,W.EPSILON7/i,n)}function mQ(e,t){let n=m.normalize(e,cqe),i=m.equalsEpsilon(n,m.UNIT_X,W.EPSILON6)?m.UNIT_Y:m.UNIT_X;return VT(e,i,t)}function Lhe(e){let t=$.getColumn(e,0,rqe),n=$.getColumn(e,1,sqe),i=$.getColumn(e,2,aqe),o=m.equals(t,m.ZERO),r=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=W.EPSILON7,e[4]=W.EPSILON7,e[8]=W.EPSILON7,e):(o&&!r&&!s?t=VT(n,i,t):!o&&r&&!s?n=VT(t,i,n):!o&&!r&&s?i=VT(n,t,i):o?r?s||(t=mQ(i,t),n=VT(i,t,n)):(t=mQ(n,t),i=VT(n,t,i)):(n=mQ(t,n),i=VT(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function K1(e,t){t=Lhe(t),this._orientedBoundingBox=new Gn(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(K1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});K1.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};K1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};K1.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=Lhe(t),$.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};K1.prototype.createDebugVolume=function(e){let t=new Am({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=A.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Et({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Kl=K1;function tr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||si(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?A.unpack(n.transform):A.clone(A.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=A.multiply(a,this.transform,new A),d=l(i)?i._initialTransform:A.IDENTITY;this._initialTransform=A.multiply(d,this.transform,new A),this.computedTransform=c,this.metadata=sv(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,tr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&tr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Uo.REPLACE:Uo.ADD):l(i)?p=i.refine:p=Uo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,x,_,C;if(t=Ze.createIfNeeded(t),r)x=Bo.UNLOADED,_=t.clone();else if(l(s)){let G=s.uri;l(s.url)&&(tr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?(tr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new B1(e,this),f=!0,x=Bo.READY):(x=Bo.UNLOADED,_=t.getDerivedResource({url:G}),C=tc.getServerKey(_.getUrlComponent()))}else g=new B1(e,this),f=!0,x=Bo.READY;this._content=g,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!f,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,R;l(V)&&(L=V.duration,l(V.date)&&(R=q.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=R,this.lastStyleTime=0,this._optimChildrenWithinParent=$u.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=B.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}tr._deprecationWarning=wa;Object.defineProperties(tr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new B),B.clone(this._color)},set:function(e){this._color=B.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Bo.READY}},contentUnloaded:{get:function(){return this._contentState===Bo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Bo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Bo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ry=new m;function lqe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,ry),c=m.add(s.positionWC,a,ry),d=m.subtract(c,r,ry);if(m.magnitude(d)>o){let R=m.normalize(d,ry),G=m.multiplyByScalar(R,o,ry),I=m.add(r,G,ry),v=m.subtract(I,s.positionWC,ry),P=m.normalize(v,ry);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Uo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===wo.PRELOAD_FLIGHT||n._pass===wo.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*f;if(e._foveatedFactor<=x)return!1;let _=f-x,C=W.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var Ihe=new q;tr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||d instanceof an){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,h);p=s/f}else{let g=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*h/(g*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(g,x)*_;p-=C}}return p/=e.pixelRatio,p};function dqe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function uqe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}tr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:hs.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==hs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=uqe(n,this),this._priorityProgressiveResolution=dqe(n,this),this.priorityDeferred=lqe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};tr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=q.now(Ihe);q.lessThan(this.expireDate,e)&&(this._contentState=Bo.EXPIRED,this._expiredContent=this._content)}};function mqe(e){if(!l(e.expireDuration))return;let t=q.now(Ihe);q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?q.lessThan(e.expireDate,t)&&q.clone(t,e.expireDate):e.expireDate=q.clone(t)}function hqe(e){return function(){return e._priority}}tr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?fqe(this):bqe(this)};function fqe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=si(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new av(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Bo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Bo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Bo.FAILED,o})}async function pqe(e,t,n,i,o){let r=e._contentState;e._contentState=Bo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Bo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await gqe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Bo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Bo.FAILED,a}}function bqe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ho({throttle:!0,throttleByServer:!0,type:ds.TILES3D,priorityFunction:hqe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return pqe(e,o,i,n,r)}async function gqe(e,t){let n=Kb(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Es.GEOMETRY||n.contentType===Es.VECTOR,(n.contentType===Es.IMPLICIT_SUBTREE||n.contentType===Es.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Es.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=yT[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=xT(i,s));let a=_T(i,s);return l(a)&&(o.group=new N_({metadata:a})),o}tr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};tr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Bo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Xhe=new le;function fQ(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Xhe);e._boundingVolume2D=new Jb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function yqe(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Xhe);e._contentBoundingVolume2D=new Jb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}tr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=fQ(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Ht.INSIDE,a===Ht.OUTSIDE)return hs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Ht.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};tr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Ht.INSIDE;if(this._visibilityPlaneMask===hs.MASK_INSIDE)return Ht.INSIDE;let t=e.cullingVolume,n=yqe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Ht.INSIDE,s===Ht.OUTSIDE)return Ht.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Ht.OUTSIDE,s===Ht.INSIDE)return Ht.OUTSIDE}return t.computeVisibility(n)};tr.prototype.distanceToTile=function(e){return fQ(this,e).distanceToCamera(e)};var xqe=new m;tr.prototype.distanceToTileCenter=function(e){let n=fQ(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,xqe);return m.dot(e.camera.directionWC,i)};tr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Whe=new $,Phe=new m,_qe=new $,pQ=new m,vhe=new ce,whe=new Gn,hQ=new A;function Tqe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],pQ),o=$.fromArray(e,3,_qe);i=A.multiplyByPoint(t,i,i);let r=A.getMatrix3(t,Whe);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Kl(i,o)}function Rhe(e,t,n,i){let o=ce.unpack(e,0,vhe),r=e[4],s=e[5],a=Gn.fromRectangle(o,r,s,ne.WGS84,whe),c=a.center,d=a.halfAxes;t=A.multiplyTransformation(t,A.inverseTransformation(n,hQ),hQ),c=A.multiplyByPoint(t,c,c);let u=A.getMatrix3(t,Whe);return d=$.multiply(u,d,d),l(i)&&i instanceof Kl?(i.update(c,d),i):new Kl(c,d)}function Sqe(e,t,n,i){if(!A.equalsEpsilon(t,n,W.EPSILON8))return i instanceof Kl?Rhe(e,t,n,i):Rhe(e,t,n,void 0);let o=ce.unpack(e,0,vhe);return i instanceof Md?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Md({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Cqe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],pQ),o=e[3];i=A.multiplyByPoint(t,i,i);let r=A.getScale(t,Phe),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Jb(i,o)}tr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=nT.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(si(e,"3DTILES_bounding_volume_S2"))return new lv(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=Tqe(r,t,n);return this._verticalExaggeration!==1&&Zhe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Sqe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Kl?Zhe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Tr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Tr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=Cqe(a,t,n);if(this._verticalExaggeration!==1){let d=Tr.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,pQ),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var Vqe=m.unpackArray(new Array(8*3).fill(0));function Zhe(e,t,n){let i=e.boundingVolume.computeCorners(Vqe).map(r=>Tr.getPosition(r,ne.WGS84,t,n,r)),o=Gn.fromPoints(i,whe);e.update(o.center,o.halfAxes)}tr.prototype.updateTransform=function(e,t){e=y(e,A.IDENTITY);let n=A.multiplyTransformation(e,this.transform,hQ),i=!A.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&A.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};tr.prototype.updateGeometricErrorScale=function(){let e=A.getScale(this.computedTransform,Phe),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Lqe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=B.WHITE:c=B.DARKGRAY:c=B.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Yt.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(B.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(B.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=B.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Rqe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Bo.FAILED,o}}function Zqe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Gqe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}tr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Zqe(this,e),Gqe(this,e),Lqe(this,e,t,n),Rqe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Ee.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Ghe=[];tr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(mqe(this),this._selectedFrame=0,this.lastStyleTime=0,q.now(this._loadTimestamp),this._contentState=Bo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Ghe;try{this._content.update(e,t)}catch(i){throw this._contentState=Bo.FAILED,i}Ghe.length=0,t.commandList=n};function Ehe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function lU(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}tr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,h=r,p=Math.pow(10,u),g=u+h,f=r,x=Math.pow(10,g),_=g+f,C=Math.pow(10,_),V=lU(this._depth,n.depth,i.depth);V=t?1-V:V;let R=!e.isSkippingLevelOfDetail&&this.refine===Uo.REPLACE?lU(this._priorityHolder._distanceToCamera,n.distance,i.distance):lU(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),G=Ehe(R,a,s),I=this._priorityProgressiveResolution?0:p,v=lU(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=Ehe(v,d,c),w=this.priorityDeferred?x:0,M=e._pass===wo.PRELOAD_FLIGHT?0:C;this._priority=V+G+I+P+w+M};tr.prototype.isDestroyed=function(){return!1};tr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),me(this)};var nm=tr;var Kii=T(S(),1);var Aii=T(S(),1);function Qb(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Qb.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Qb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Qb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Qb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Qb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Qb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Qb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var J1=Qb;var Dii=T(S(),1);function jb(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(jb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};jb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};jb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};jb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};jb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};jb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};jb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var dv=jb;function Fhe(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new dv({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new J1({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let h=a[u];s.push(new J1({id:u,group:a[u],class:n.classes[h.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Fhe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var LT=Fhe;var eoi=T(S(),1);var Ahe={},Eqe=new m;Ahe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Kl||i instanceof Md){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=$u.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Kl||a instanceof Md)){e._optimChildrenWithinParent=$u.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=m.subtract(c.center,o.center,Eqe),u=m.magnitude(d);m.divideByScalar(d,u,d);let h=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(h<=p+u){e._optimChildrenWithinParent=$u.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===$u.USE_OPTIMIZATION};var uv=Ahe;var ooi=T(S(),1);function RT(){this._list=new DE,this._sentinel=this._list.add(),this._trimTiles=!1}RT.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};RT.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};RT.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};RT.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};RT.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};RT.prototype.trim=function(){this._trimTiles=!0};var mv=RT;var doi=T(S(),1);function dU(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function gQ(e,t){let n;return t==="_loadTimestamp"?n=q.toDate(e).getTime():n=e,n}dU.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=gQ(e,n),this._referenceMaximum[n]=gQ(t,n)};function Iqe(e,t){let n=e.tilePropertyName;if(l(n)){let i=gQ(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var bQ=[new B(.1,.1,.1,1),new B(.153,.278,.878,1),new B(.827,.231,.49,1),new B(.827,.188,.22,1),new B(1,.592,.259,1),new B(1,.843,0,1)];dU.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Iqe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=bQ.length-1,u=c*d,h=Math.floor(u),p=Math.ceil(u),g=u-h,f=bQ[h],x=bQ[p],_=B.clone(B.WHITE);_.red=W.lerp(f.red,x.red,g),_.green=W.lerp(f.green,x.green,g),_.blue=W.lerp(f.blue,x.blue,g),e._debugColor=_};dU.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var hv=dU;var foi=T(S(),1);function Q1(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}Q1.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};Q1.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};Q1.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof wd))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};Q1.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof wd))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};Q1.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var Sh=Q1;var goi=T(S(),1);function fv(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(fv.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});fv.prototype.makeDirty=function(){this._styleDirty=!0};fv.prototype.resetDirty=function(){this._styleDirty=!1};fv.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var pv=fv;var Loi=T(S(),1);function Xqe(e,t,n){let i=si(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!si(o,"3DTILES_bounding_volume_S2")&&!si(o,"3DTILES_bounding_volume_cylinder"))throw new ae("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Ze({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Wqe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ye(a,!0));let c=new Ze({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Pqe(t),this.subdivisionScheme=ts[i.subdivisionScheme],this.branchingFactor=ts.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Wqe(e){if(si(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Pqe(e){let t=Ye(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var ZT=Xqe;var Ioi=T(S(),1);function Oo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===ts.OCTREE&&(this.z=e.z)}Object.defineProperties(Oo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===ts.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===ts.OCTREE?pg.encode3D(this.x,this.y,this.z):pg.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===ts.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Oo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===ts.OCTREE){let o=(this.z<<e.level)+e.z;return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Oo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===ts.OCTREE){let r=Math.floor(this.z/t);return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Oo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===ts.OCTREE){let r=e.z%n;return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Oo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===ts.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Oo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Oo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Oo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Oo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===ts.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Oo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===ts.OCTREE?this.z===e.z:!0)};Oo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Oo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Oo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Oo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===ts.OCTREE&&(e.z=this.z),e};var Mhe=[0,0,0];Oo.fromMortonIndex=function(e,t,n,i){let o;return e===ts.OCTREE?(o=pg.decode3D(i,Mhe),new Oo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=pg.decode2D(i,Mhe),new Oo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Oo.fromTileIndex=function(e,t,n){let i,o,r;return e===ts.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Oo.fromMortonIndex(e,t,i,r)};var GT=Oo;var Boi=T(S(),1);var Aoi=T(S(),1);function qb(){}qb.selectTiles=function(e,t){pe.throwInstantiationError()};qb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};qb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};qb.selectTile=function(e,t){if(e.contentVisibility(t)===Ht.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};qb.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};qb.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};qb.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!vqe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function vqe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}qb.updateTile=function(e,t){Nhe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Aqe(e),e._shouldSelect=!1,e._finalResolution=!0};function Nhe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];Nhe(r,t),e._visible=r._visible;return}if(wqe(e,t)){e._visible=!1;return}let i=e.refine===Uo.REPLACE,o=e._optimChildrenWithinParent===$u.USE_OPTIMIZATION;if(i&&o&&n&&!Fqe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function wqe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Uo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Fqe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function Aqe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Qs=qb;function khe(){}var bv={stack:new jc,stackMaximumLength:0};khe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Qs,s=bv.stack;for(s.push(i);s.length>0;){bv.stackMaximumLength=Math.max(bv.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Uo.ADD,d=a.refine===Uo.REPLACE,u=Mqe(a);u&&Nqe(a,s,t),(c||d&&!u)&&(kqe(e,a),o(a,t),Uqe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return bv.stack.trim(bv.stackMaximumLength),n};function Mqe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Nqe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function kqe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Uqe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Ht.OUTSIDE&&e.tileset._selectedTiles.push(e)}var gv=khe;var Joi=T(S(),1);function Uhe(){}var yv={stack:new jc,stackMaximumLength:0},xv={stack:new jc,stackMaximumLength:0};Uhe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Qs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Bqe(n,t),yv.stack.trim(yv.stackMaximumLength),xv.stack.trim(xv.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function yQ(e,t){e.contentAvailable&&Qs.selectTile(e,t)}function Dqe(e,t,n){let i=e.refine===Uo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Qs;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Qs.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,h=!1,p=-1,g=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let x=r[f];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=f,g=x._foveatedFactor),h=!0):(d||o.loadSiblings)&&(x._foveatedFactor<g&&(p=f,g=x._foveatedFactor),a(x,n),c(x,n)),d){let _;x._inRequestVolume?x.hasRenderableContent?_=x.contentAvailable:_=Oqe(x,n):_=!1,u=u&&_}}if(h||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(f._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(f._distanceToCamera,x._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=x}return u}function Bqe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Qs,a=yv.stack;for(a.push(e);a.length>0;){yv.stackMaximumLength=Math.max(yv.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?Dqe(c,a,t)&&u:!1;let h=!c._refines&&u;c.hasRenderableContent?c.refine===Uo.ADD?(yQ(c,t),o(c,t)):c.refine===Uo.REPLACE&&(o(c,t),h&&yQ(c,t)):(n._emptyTiles.push(c),o(c,t),h&&yQ(c,t)),r(c,t),s(c,t)}}function Oqe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Qs,s=!0,a=xv.stack;for(a.push(e);a.length>0;){xv.stackMaximumLength=Math.max(xv.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<u;++p){let g=d[p];a.push(g)}}return e.hasEmptyContent||s}var _v=Uhe;var tri=T(S(),1);function Dhe(){}var Tv={stack:new jc,stackMaximumLength:0},Sv={stack:new jc,stackMaximumLength:0},$b={stack:new jc,stackMaximumLength:0,ancestorStack:new jc,ancestorStackMaximumLength:0},Yqe=2;Dhe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Qs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;jqe(n,t),qqe(n,t),Tv.stack.trim(Tv.stackMaximumLength),Sv.stack.trim(Sv.stackMaximumLength),$b.stack.trim($b.stackMaximumLength),$b.ancestorStack.trim($b.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Hqe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Qs,r=Sv.stack;for(r.push(e);r.length>0;){Sv.stackMaximumLength=Math.max(Sv.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<Yqe&&r.push(d))}}}function uU(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Hqe(e,t)}function zqe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function Kqe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Jqe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Qs;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Qs.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function Qqe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function jqe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Qs,c=Tv.stack;for(c.push(e);c.length>0;){Tv.stackMaximumLength=Math.max(Tv.stackMaximumLength,c.length);let d=c.pop();zqe(d,t);let u=d.parent,h=!l(u)||u._refines;d._refines=o(d)?Jqe(d,c,t)&&h:!1;let p=!d._refines&&h;d.hasRenderableContent?d.refine===Uo.ADD?(uU(d,t),r(d,t)):d.refine===Uo.REPLACE&&(Qqe(d,i)?(r(d,t),p&&uU(d,t)):p?(uU(d,t),r(d,t)):Kqe(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&uU(d,t)),s(d,t),a(d,t)}}function qqe(e,t){let{selectTile:n,canTraverse:i}=Qs,{stack:o,ancestorStack:r}=$b,s;for(o.push(e);o.length>0||r.length>0;){if($b.stackMaximumLength=Math.max($b.stackMaximumLength,o.length),$b.ancestorStackMaximumLength=Math.max($b.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Uo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let h=d[u];h.isVisible&&o.push(h)}}}}var Cv=Dhe;function nr(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new mv,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new jc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new pv,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?A.clone(e.modelMatrix):A.clone(A.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Sh,this._statisticsLast=new Sh,this._statisticsPerPass=new Array(wo.NUMBER_OF_PASSES);for(let o=0;o<wo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Sh;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new hv(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=W.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._initialClippingPlanesOriginMatrix=A.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,W.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,Tn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Nl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Pf(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Eb,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&fs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&ah.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new M_,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Rb(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,B.BLACK),this.splitDirection=y(e.splitDirection,kr.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&_t("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(nr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){ah.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return wa("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(A.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):A.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,Qhe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});nr.fromIonAssetId=async function(e,t){let n=await pd.fromAssetId(e);return nr.fromUrl(n,t)};nr.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await nr.loadJson(n),r=await $qe(n,o),s=new nr(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,Qhe(s);let c=l(o.asset.gltfUpAxis)?Po.fromName(o.asset.gltfUpAxis):Po.Y,d=y(t.modelUpAxis,c),u=y(t.modelForwardAxis,Po.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,A.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>di._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Pt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=A.clone(s._initialClippingPlanesOriginMatrix),s};nr.loadJson=function(e){return Ze.createIfNeeded(e).fetchJson()};nr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};nr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&nr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Bhe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Uo.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let h=d[u],p=Bhe(this,e,h,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&uv.checkChildrenWithinParent(c)}return s};function Bhe(e,t,n,i){if(!(l(n.implicitTiling)||si(n,"3DTILES_implicit_tiling")))return new nm(e,t,n,i);let r=e.schema,s=new ZT(t,n,r),a=new GT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=Ye(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let h=new nm(e,t,u,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function $qe(e,t){let n=si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ri.getSchemaLoader({resource:e});else if(l(n.schema))i=Ri.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new LT({schema:i.schema,metadataJson:n});return Ri.unload(i),o}var Ohe=new m,e$e=new he,t$e=new A,n$e=new m,i$e=new m,o$e=new m,r$e=new m;function s$e(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof Md)n=m.normalize(a.positionWC,Ohe),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let x=A.inverseTransformation(c.computedTransform,t$e),_=t.mapProjection.ellipsoid,C=d.boundingVolume,V=A.multiplyByPoint(x,C.center,n$e);if(m.magnitude(V)>_.minimumRadius){let L=he.fromCartesian(V,_,e$e);n=m.normalize(a.positionWC,Ohe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=A.multiplyByPoint(x,a.positionWC,i$e);if(n=m.UNIT_Z,i=A.multiplyByPointAsVector(x,a.directionWC,o$e),i=m.normalize(i,i),o=L.z,d instanceof Kl){let R=$.getColumn(C.halfAxes,2,r$e),G=m.magnitude(R);r=V.z-G,s=V.z+G}else if(d instanceof Jb){let R=C.radius;r=V.z-R,s=V.z+R}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*u,p=s,g=W.clamp((o-h)/(p-h),0,1),f=1-Math.abs(m.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function a$e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{zhe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?T$e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Hhe(e,t){return e._priority-t._priority}nr.prototype.postPassesUpdate=function(e){l(this._root)&&(c$e(this,e),C$e(this,e),this._cache.unloadTiles(this,Jhe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};nr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;p$e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time)),this._timeSinceLoad=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&s$e(this,e),e.newFrame&&this._cache.reset()};function c$e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Bo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function l$e(e){let t=e._requestedTiles;t.sort(Hhe);for(let n=0;n<t.length;++n)a$e(e,t[n])}function zhe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function d$e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Bo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var u$e=new he,m$e=new he,h$e=new m;function f$e(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,u$e),c=he.fromCartesian(o.center,s,m$e);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,h$e);m.distance(d,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function p$e(e,t){d$e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,zhe(u,e,d)}}e.totalMemoryUsageInBytes<i?g$e(e):a&&n.length>0&&b$e(e)}function b$e(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Hhe)}function g$e(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var mU=new m,y$e={maximumFractionDigits:3};function Yhe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,y$e):Math.round(t).toLocaleString()}function xQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=m.clone(i,mU);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=m.normalize(i,mU);r=m.multiplyByScalar(r,.75*n,mU),o=m.add(r,i,mU)}return o}function _Q(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
Triangles: ${e.content.trianglesLength}`,o++),i+=`
Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
Texture Memory: ${Yhe(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${Yhe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
- ${s[a]}`;o+=s.length}else i+=`
Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function x$e(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:xQ(e.debugPickedTile),a=_Q(e.debugPickedTile,e,s);a.pixelOffset=new D(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];_Q(a,e,xQ(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&_Q(a,e,xQ(a))}}e._tileDebugLabels.update(t)}function _$e(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:Ee.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:Ut.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,h=i.length;for(let f=0;f<s.length;++f){let x=s[f];u&&d.raiseEvent(x),f$e(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,x=f.length;i.length+=x;for(let _=g-1;_>=0;--_)i[h+x+_]=i[h+_];for(let _=0;_<x;++_)i[h+_]=f[_]}g=i.length-r,c.numberOfCommands=g,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Af),x$e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Khe=[];function T$e(e,t){let n=t,i=Khe;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(S$e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Jhe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function S$e(e,t){e._cache.unloadTile(e,t,Jhe),t.destroy()}nr.prototype.trimLoadedTiles=function(){this._cache.trim()};function C$e(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Sh.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function V$e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function L$e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!A.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=A.clone(e.modelMatrix,e._previousModelMatrix)))}function R$e(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,V$e(e),L$e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&l$e(e),_$e(e,t,i),Sh.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function Qhe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Ct.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Ct(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}nr.prototype.getTraversal=function(e){let{pass:t}=e;return t===wo.MOST_DETAILED_PRELOAD||t===wo.MOST_DETAILED_PICK?gv:this.isSkippingLevelOfDetail?Cv:_v};nr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};nr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===wo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===wo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===wo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=wo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),d=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=R$e(this,e,h,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};nr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};nr.prototype.isDestroyed=function(){return!1};nr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=Khe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,me(this)};nr.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};nr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!nr.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Z$e=new pn,G$e=new m,E$e=new he;nr.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=Z$e,o=n.cartographicToCartesian(e,i.direction);m.normalize(i.direction,i.direction),i.direction=m.normalize(o,i.direction),i.direction=m.negate(o,i.direction),i.origin=m.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,G$e);if(l(r))return n.cartesianToCartographic(r,E$e)?.height};nr.prototype.updateHeight=function(e,t,n){n=y(n,ne.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var I$e=new Ga,X$e=new m;nr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let d=i[c],u=qn.raySphere(e,d.contentBoundingVolume.boundingSphere,I$e);!l(u)||!l(d.content)||r.push(d)}let s=r.length;r.sort((c,d)=>{let u=le.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-h});let a;for(let c=0;c<s;++c){let u=r[c].content.pick(e,t,X$e);if(l(u))return a=m.clone(u,n),a}};var bs=nr;var W$e=new A;function sy(e,t){t.collectionChanged.addEventListener(sy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Gt,this._onCollectionChanged(t,t.values,[],[])}sy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;u&&(h=s.computeModelMatrix(e,W$e),c=Ze.createIfNeeded(J.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],P$e(c,n,s,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=J.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};sy.prototype.isDestroyed=function(){return!1};sy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(sy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)TQ(this,e[i],t,n);return me(this)};sy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return dt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),dt.DONE):dt.FAILED:dt.PENDING};sy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(TQ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],TQ(this,r,a,c),s.remove(r.id)};function TQ(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function P$e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await bs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var Vv=sy;var Psi=T(S(),1);var v$e=B.WHITE,w$e=B.BLACK,F$e=new D(2,2);function j1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(j1.prototype,{isConstant:{get:function(){return J.isConstant(this._evenColor)&&J.isConstant(this._oddColor)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});j1.prototype.getType=function(e){return"Checkerboard"};var A$e=new q;j1.prototype.getValue=function(e,t){return l(e)||(e=q.now(A$e)),l(t)||(t={}),t.lightColor=J.getValueOrClonedDefault(this._evenColor,e,v$e,t.lightColor),t.darkColor=J.getValueOrClonedDefault(this._oddColor,e,w$e,t.darkColor),t.repeat=J.getValueOrDefault(this._repeat,e,F$e),t};j1.prototype.equals=function(e){return this===e||e instanceof j1&&J.equals(this._evenColor,e._evenColor)&&J.equals(this._oddColor,e._oddColor)&&J.equals(this._repeat,e._repeat)};var q1=j1;var jsi=T(S(),1);var Osi=T(S(),1);var jhe={id:void 0};function Lv(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function Vc(e){this._owner=e,this._entities=new Gt,this._addedEntities=new Gt,this._removedEntities=new Gt,this._changedEntities=new Gt,this._suspendCount=0,this._collectionChanged=new be,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}Vc.prototype.suspendEvents=function(){this._suspendCount++};Vc.prototype.resumeEvents=function(){this._suspendCount--,Lv(this)};Object.defineProperties(Vc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Vc.prototype.computeAvailability=function(){let e=Be.MAXIMUM_VALUE,t=Be.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;q.lessThan(a,e)&&!a.equals(Be.MINIMUM_VALUE)&&(e=a),q.greaterThan(c,t)&&!c.equals(Be.MAXIMUM_VALUE)&&(t=c)}}return Be.MAXIMUM_VALUE.equals(e)&&(e=Be.MINIMUM_VALUE),Be.MINIMUM_VALUE.equals(t)&&(t=Be.MAXIMUM_VALUE),new Ln({start:e,stop:t})};Vc.prototype.add=function(e){e instanceof $o||(e=new $o(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(Vc.prototype._onEntityDefinitionChanged,this),Lv(this),e};Vc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Vc.prototype.contains=function(e){return this._entities.get(e.id)===e};Vc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(Vc.prototype._onEntityDefinitionChanged,this),Lv(this),!0):!1};Vc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(Vc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Lv(this)};Vc.prototype.getById=function(e){return this._entities.get(e)};Vc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(jhe.id=e,t=new $o(jhe),this.add(t)),t};Vc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Lv(this)};var js=Vc;var hU={id:void 0},$1=new Array(2);function SQ(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function qhe(e,t,n,i){$1[0]=n,$1[1]=i.id,t[JSON.stringify($1)]=i.definitionChanged.addEventListener(Or.prototype._onDefinitionChanged,e)}function $he(e,t,n,i){$1[0]=n,$1[1]=i.id;let o=JSON.stringify($1);t[o](),t[o]=void 0}function ay(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,h=new js(e),p=e._eventHash,g;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Or.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--)s=a[c],$he(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Or.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],qhe(e,p,g,s);let x=h.getById(s.id);l(x)||(x=u.getById(s.id),l(x)?SQ(x):(hU.id=s.id,x=new $o(hU)),h.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=h.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Or(e,t){this._owner=t,this._composite=new js(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},ay(this),this._shouldRecomposite=!1}Object.defineProperties(Or.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Or.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),ay(this)};Or.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),ay(this),!0):!1};Or.prototype.removeAllCollections=function(){this._collections.length=0,ay(this)};Or.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Or.prototype.contains=function(e){return this._composite.contains(e)};Or.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Or.prototype.getCollection=function(e){return this._collections[e]};Or.prototype.getCollectionsLength=function(){return this._collections.length};function fU(e,t){return e.indexOf(t)}function efe(e,t,n){let i=e._collections;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,ay(e)}Or.prototype.raiseCollection=function(e){let t=fU(this._collections,e);efe(this,t,t+1)};Or.prototype.lowerCollection=function(e){let t=fU(this._collections,e);efe(this,t,t-1)};Or.prototype.raiseCollectionToTop=function(e){let t=fU(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),ay(this))};Or.prototype.lowerCollectionToBottom=function(e){let t=fU(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),ay(this))};Or.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Or.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(ay(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Or.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Or.prototype.getById=function(e){return this._composite.getById(e)};Or.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,h=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];$he(this,h,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),SQ(d)),d.merge(c));l(d)||r.removeById(x),d=void 0}let g=t.length;for(s=0;s<g;s++){let f=t[s];qhe(this,h,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),l(d)?SQ(d):(hU.id=x,d=new $o(hU),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Or.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let f=g[t];if(l(f)){if(h)if(h=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var CQ=Or;var mai=T(S(),1);var rai=T(S(),1);function M$e(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function ET(){this._eventHelper=new ar,this._definitionChanged=new be,this._intervals=new Nr,this._intervals.changedEvent.addEventListener(ET.prototype._intervalsChanged,this)}Object.defineProperties(ET.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var N$e=new q;ET.prototype.getValue=function(e,t){l(e)||(e=q.now(N$e));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};ET.prototype.equals=function(e){return this===e||e instanceof ET&&this._intervals.equals(e._intervals,J.equals)};ET.prototype._intervalsChanged=function(){M$e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Lc=ET;function cy(){this._definitionChanged=new be,this._composite=new Lc,this._composite.definitionChanged.addEventListener(cy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(cy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});cy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var k$e=new q;cy.prototype.getValue=function(e,t){l(e)||(e=q.now(k$e));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};cy.prototype.equals=function(e){return this===e||e instanceof cy&&this._composite.equals(e._composite,J.equals)};cy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var eV=cy;var Tai=T(S(),1);function ly(e){this._referenceFrame=y(e,Ui.FIXED),this._definitionChanged=new be,this._composite=new Lc,this._composite.definitionChanged.addEventListener(ly.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ly.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var U$e=new q;ly.prototype.getValue=function(e,t){return l(e)||(e=q.now(U$e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};ly.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};ly.prototype.equals=function(e){return this===e||e instanceof ly&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,J.equals)};ly.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ba=ly;var ici=T(S(),1);var vai=T(S(),1);var D$e=new Qn(0);function cl(e){ri.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(cl.prototype=Object.create(ri.prototype),cl.prototype.constructor=cl);Object.defineProperties(cl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});cl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&qc.isSupported(this._scene)};cl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};cl.prototype._computeCenter=pe.throwInstantiationError;cl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ri.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&_t(_t.geometryZIndex),this._zIndex=y(o.zIndex,D$e),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new eh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new w_(this._scene,a,r,s)}};cl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ri.prototype.destroy.call(this)};cl.getGeometryHeight=function(e,t){if(!l(e)){t!==Je.NONE&&_t(_t.geometryHeightReference);return}return Mu(t)?0:e};cl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Je.NONE&&_t(_t.geometryExtrudedHeightReference);return}return Mu(t)?cl.CLAMP_TO_GROUND:e};cl.CLAMP_TO_GROUND="clamp";cl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Je.NONE),(!l(n)||!l(i))&&(i=Je.NONE);let o=0;if(t!==Je.NONE&&o++,i===Je.RELATIVE_TO_GROUND&&o++,o===2)return rn.ALL;if(o===1)return rn.TOP};var Yn=cl;var tfe=new B,nfe=m.ZERO,ife=new m,ofe=new ce;function B$e(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Ch(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new B$e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Ch.prototype=Object.create(Yn.prototype),Ch.prototype.constructor=Ch);Ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,tfe)),l(o)||(o=B.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,nfe,ife))),new Et({id:t,geometry:new Nx(this._options),attributes:i})};Ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,tfe),o={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,nfe,ife))),new Et({id:t,geometry:new FE(this._options),attributes:o})};Ch.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};Ch.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ri.prototype._isHidden.call(this,e,t)};Ch.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.width)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.cornerType)||!J.isConstant(t.zIndex)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Ch.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Je.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Dt?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Be.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Be.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),s.cornerType=J.getValueOrUndefined(t.cornerType,Be.MINIMUM_VALUE),s.offsetAttribute=Yn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Yn.getGeometryHeight(n,i),o=Yn.getGeometryExtrudedHeight(o,r),o===Yn.CLAMP_TO_GROUND&&(o=di.getMinimumMaximumHeights(Nx.computeRectangle(s,ofe)).minimumTerrainHeight),s.extrudedHeight=o};Ch.DynamicGeometryUpdater=tV;function tV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(tV.prototype=Object.create(oi.prototype),tV.prototype.constructor=tV);tV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||oi.prototype._isHidden.call(this,e,t,n)};tV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Je.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,Je.NONE);l(s)&&!l(o)&&(o=0),i.positions=J.getValueOrUndefined(t.positions,n),i.width=J.getValueOrUndefined(t.width,n),i.granularity=J.getValueOrUndefined(t.granularity,n),i.cornerType=J.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=di.getMinimumMaximumHeights(Nx.computeRectangle(i,ofe)).minimumTerrainHeight),i.extrudedHeight=s};var Rv=Ch;var Vli=T(S(),1);var sci=T(S(),1);function pU(){pe.throwInstantiationError()}Object.defineProperties(pU.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});pU.prototype.update=function(e){pe.throwInstantiationError()};pU.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Yr=pU;var yli=T(S(),1);var Tci=T(S(),1);function Lr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=wt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=B.clone(y(e.color,B.WHITE)),this._outlineColor=B.clone(y(e.outlineColor,B.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,kr.NONE)}var rfe=Lr.SHOW_INDEX=0,cfe=Lr.POSITION_INDEX=1,O$e=Lr.COLOR_INDEX=2,Y$e=Lr.OUTLINE_COLOR_INDEX=3,H$e=Lr.OUTLINE_WIDTH_INDEX=4,z$e=Lr.PIXEL_SIZE_INDEX=5,K$e=Lr.SCALE_BY_DISTANCE_INDEX=6,J$e=Lr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Q$e=Lr.DISTANCE_DISPLAY_CONDITION_INDEX=8,j$e=Lr.DISABLE_DEPTH_DISTANCE_INDEX=9,q$e=Lr.SPLIT_DIRECTION_INDEX=10;Lr.NUMBER_OF_PROPERTIES=11;function Nd(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Lr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nd(this,rfe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Nd(this,cfe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Nd(this,K$e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Nd(this,J$e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Nd(this,z$e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Nd(this,O$e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Nd(this,Y$e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Nd(this,H$e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),Nd(this,Q$e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Nd(this,j$e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Nd(this,rfe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Nd(this,q$e))}}});Lr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Lr.prototype._getActualPosition=function(){return this._actualPosition};Lr.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Nd(this,cfe)};var sfe=new se;Lr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(A.multiplyByPoint(n,e,sfe),Di.computeActualEllipsoidPosition(t,sfe))};var afe=new se;Lr._computeScreenSpacePosition=function(e,t,n,i){let o=A.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,afe),afe);return Di.worldToWindowCoordinates(n,o,i)};Lr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new D);let i=n.modelMatrix,o=Lr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Lr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=c,n};Lr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&B.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&B.equals(this._outlineColor,e._outlineColor)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Lr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Is=Lr;var qci=T(S(),1);var Cci=T(S(),1),dy=`in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerPercent;
in float v_pixelDistance;
in vec4 v_pickColor;
in float v_splitDirection;

void main()
{
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;

    // The distance in UV space from this fragment to the center of the point, at most 0.5.
    float distanceToCenter = length(gl_PointCoord - vec2(0.5));
    // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
    float maxDistance = max(0.0, 0.5 - v_pixelDistance);
    float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
    float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);

    vec4 color = mix(v_outlineColor, v_color, innerAlpha);
    color.a *= wholeAlpha;

// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
    if (color.a < 0.005)   // matches 0/255 and 1/255
    {
        discard;
    }
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
    if (color.a < 0.995)   // matches < 254/255
    {
        discard;
    }
#else
    if (color.a >= 0.995)  // matches 254/255 and 255/255
    {
        discard;
    }
#endif
#endif

    out_FragColor = czm_gammaCorrect(color);
    czm_writeLogDepth();
}
`;var Lci=T(S(),1),Zv=`uniform float u_maxTotalPointSize;

in vec4 positionHighAndSize;
in vec4 positionLowAndOutline;
in vec4 compressedAttribute0;                                        // color, outlineColor, pick color
in vec4 compressedAttribute1;                                        // show, translucency by distance, some free space
in vec4 scaleByDistance;                                             // near, nearScale, far, farScale
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection;    // near, far, disableDepthTestDistance, splitDirection

out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerPercent;
out float v_pixelDistance;
out vec4 v_pickColor;
out float v_splitDirection;

const float SHIFT_LEFT8 = 256.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;

void main()
{
    // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition

    // unpack attributes
    vec3 positionHigh = positionHighAndSize.xyz;
    vec3 positionLow = positionLowAndOutline.xyz;
    float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
    float totalSize = positionHighAndSize.w + outlineWidthBothSides;
    float outlinePercent = outlineWidthBothSides / totalSize;
    // Scale in response to browser-zoom.
    totalSize *= czm_pixelRatio;

    float temp = compressedAttribute1.x * SHIFT_RIGHT8;
    float show = floor(temp);

#ifdef EYE_DISTANCE_TRANSLUCENCY
    vec4 translucencyByDistance;
    translucencyByDistance.x = compressedAttribute1.z;
    translucencyByDistance.z = compressedAttribute1.w;

    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;

    temp = compressedAttribute1.y * SHIFT_RIGHT8;
    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif

    ///////////////////////////////////////////////////////////////////////////

    vec4 color;
    vec4 outlineColor;
    vec4 pickColor;

    // compressedAttribute0.z => pickColor.rgb

    temp = compressedAttribute0.z * SHIFT_RIGHT8;
    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor.r = floor(temp);

    // compressedAttribute0.x => color.rgb

    temp = compressedAttribute0.x * SHIFT_RIGHT8;
    color.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    color.g = (temp - floor(temp)) * SHIFT_LEFT8;
    color.r = floor(temp);

    // compressedAttribute0.y => outlineColor.rgb

    temp = compressedAttribute0.y * SHIFT_RIGHT8;
    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.r = floor(temp);

    // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a

    temp = compressedAttribute0.w * SHIFT_RIGHT8;
    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor = pickColor / 255.0;

    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor /= 255.0;
    color.a = floor(temp);
    color /= 255.0;

    ///////////////////////////////////////////////////////////////////////////

    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;

    ///////////////////////////////////////////////////////////////////////////

#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
    float lengthSq;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        // 2D camera distance is a special case
        // treat all billboards as flattened to the z=0.0 plane
        lengthSq = czm_eyeHeight2D.y;
    }
    else
    {
        lengthSq = dot(positionEC.xyz, positionEC.xyz);
    }
#endif

#ifdef EYE_DISTANCE_SCALING
    totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
#endif
    if (totalSize > 0.0) {
        // Add padding for anti-aliasing on both sides.
        totalSize += 3.0;
    }

    // Clamp to max point size.
    totalSize = min(totalSize, u_maxTotalPointSize);
    // If size is too small, push vertex behind near plane for clipping.
    // Note that context.minimumAliasedPointSize "will be at most 1.0".
    if (totalSize < 1.0)
    {
        positionEC.xyz = vec3(0.0);
        totalSize = 1.0;
    }

    float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
    // push vertex behind near plane for clipping
    if (translucency < 0.004)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

#ifdef DISTANCE_DISPLAY_CONDITION
    float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
    float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
    if (lengthSq < nearSq || lengthSq > farSq) {
        // push vertex behind camera to force it to be clipped
        positionEC.xyz = vec3(0.0, 0.0, 1.0);
    }
#endif

    gl_Position = czm_projection * positionEC;
    czm_vertexLogDepth();

#ifdef DISABLE_DEPTH_DISTANCE
    float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
    {
        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
    }

    if (disableDepthTestDistance != 0.0)
    {
        // Don't try to "multiply both sides" by w.  Greater/less-than comparisons won't work for negative values of w.
        float zclip = gl_Position.z / gl_Position.w;
        bool clipped = (zclip < -1.0 || zclip > 1.0);
        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
        {
            // Position z on the near plane.
            gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
            czm_vertexLogDepth(vec4(czm_currentFrustum.x));
#endif
        }
    }
#endif

    v_color = color;
    v_color.a *= translucency * show;
    v_outlineColor = outlineColor;
    v_outlineColor.a *= translucency * show;

    v_innerPercent = 1.0 - outlinePercent;
    v_pixelDistance = 2.0 / totalSize;
    gl_PointSize = totalSize * show;
    gl_Position *= show;

    v_pickColor = pickColor;
    v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
}
`;var $$e=Is.SHOW_INDEX,RQ=Is.POSITION_INDEX,lfe=Is.COLOR_INDEX,eet=Is.OUTLINE_COLOR_INDEX,tet=Is.OUTLINE_WIDTH_INDEX,net=Is.PIXEL_SIZE_INDEX,dfe=Is.SCALE_BY_DISTANCE_INDEX,ufe=Is.TRANSLUCENCY_BY_DISTANCE_INDEX,mfe=Is.DISTANCE_DISPLAY_CONDITION_INDEX,iet=Is.DISABLE_DEPTH_DISTANCE_INDEX,oet=Is.SPLIT_DIRECTION_INDEX,ZQ=Is.NUMBER_OF_PROPERTIES,Rc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function im(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(ZQ),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(A.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Ro.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(im.prototype,{length:{get:function(){return GQ(this),this._pointPrimitives.length}}});function hfe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}im.prototype.add=function(e){let t=new Is(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};im.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};im.prototype.removeAll=function(){hfe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function GQ(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}im.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};im.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};im.prototype.get=function(e){return GQ(this),this._pointPrimitives[e]};im.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<ZQ;++i){let o=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function ret(e,t,n){return new Wp(e,[{index:Rc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[RQ]},{index:Rc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[RQ]},{index:Rc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[lfe]},{index:Rc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[ufe]},{index:Rc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[dfe]},{index:Rc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[mfe]}],t)}var VQ=new On;function ffe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),On.fromCartesian(r,VQ);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Rc.positionHighAndSize],d=VQ.high;c(o,d.x,d.y,d.z,s);let u=n[Rc.positionLowAndOutline],h=VQ.low;u(o,h.x,h.y,h.z,a)}var bU=65536,Gv=256;function pfe(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=B.floatToByte(r.red),d=B.floatToByte(r.green),u=B.floatToByte(r.blue),h=c*bU+d*Gv+u;c=B.floatToByte(a.red),d=B.floatToByte(a.green),u=B.floatToByte(a.blue);let p=c*bU+d*Gv+u;c=B.floatToByte(s.red),d=B.floatToByte(s.green),u=B.floatToByte(s.blue);let g=c*bU+d*Gv+u,f=B.floatToByte(r.alpha)*bU+B.floatToByte(a.alpha)*Gv+B.floatToByte(s.alpha),x=n[Rc.compressedAttribute0];x(o,h,p,g,f)}function bfe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,d=i.translucencyByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=W.clamp(s,0,1),s=s===1?255:s*255|0;let h=(u?1:0)*Gv+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Rc.compressedAttribute1];g(o,h,p,r,a)}function gfe(e,t,n,i){let o=i._index,r=n[Rc.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,d)}function yfe(e,t,n,i){let o=i._index,r=n[Rc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,h=i.splitDirection;l(h)&&(u=h),r(o,s,a,d,u)}function set(e,t,n,i){ffe(e,t,n,i),pfe(e,t,n,i),bfe(e,t,n,i),gfe(e,t,n,i),yfe(e,t,n,i)}function LQ(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,h=Is._computeActualPosition(u,i,o);l(h)&&(d._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function aet(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!A.equals(r,e.modelMatrix)?(e._mode=n,A.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&LQ(e,i,i.length,t,r,!0)):n===oe.MORPHING?LQ(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&LQ(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function cet(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var det=[];im.prototype.update=function(e){if(GQ(this),!this.show)return;this._maxTotalPointSize=At.maximumAliasedPointSize,aet(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let G=0;G<ZQ;++G)r[G]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=ret(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G<n;++G){let I=this._pointPrimitives[G];I._dirty=!1,set(this,c,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let G=det;G.length=0,(r[RQ]||r[tet]||r[net])&&G.push(ffe),(r[lfe]||r[eet])&&G.push(pfe),(r[$$e]||r[ufe])&&G.push(bfe),r[dfe]&&G.push(gfe),(r[mfe]||r[iet]||r[oet])&&G.push(yfe);let I=G.length;if(a=this._vaf.writers,o/n>.1){for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let w=0;w<I;++w)G[w](this,c,a,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let w=0;w<I;++w)G[w](this,c,a,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=A.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),cet(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Ro.OPAQUE||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ro.TRANSLUCENT||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new De({sources:[Zv]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT&&(x=new De({defines:["OPAQUE"],sources:[dy]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:Rc}),x=new De({defines:["TRANSLUCENT"],sources:[dy]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:Rc})),this._blendOption===Ro.OPAQUE&&(x=new De({sources:[dy]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:Rc})),this._blendOption===Ro.TRANSLUCENT&&(x=new De({sources:[dy]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:Rc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,R=e.commandList;if(d.render||u){let G=this._colorCommands,I=this._blendOption===Ro.OPAQUE,v=this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let P=v?C*2:C;for(L=0;L<P;++L){let w=I||v&&L%2===0;V=G[L],l(V)||(V=G[L]=new $e),V.primitiveType=we.POINTS,V.pass=w||!v?Ee.OPAQUE:Ee.TRANSLUCENT,V.owner=this;let M=v?Math.floor(L/2):L;V.boundingVolume=h,V.modelMatrix=p,V.shaderProgram=w?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=_[M].va,V.renderState=w?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",R.push(V)}}};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),hfe(this._pointPrimitives),me(this)};var nV=im;var eli=T(S(),1),xfe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],EQ=1,Ev=8,Xv=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==EQ)throw new Error(`Got v${o} data when expected v${EQ}.`);let r=xfe[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=xfe.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Ev,t),this.coords=new this.ArrayType(this.data,Ev+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Ev+s+a+c),this.ids=new this.IndexArrayType(this.data,Ev,t),this.coords=new this.ArrayType(this.data,Ev+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(EQ<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return XQ(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let _=p;_<=h;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&d.push(r[_])}continue}let g=p+h>>1,f=s[2*g],x=s[2*g+1];f>=t&&f<=i&&x>=n&&x<=o&&d.push(r[g]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(g+1),c.push(h),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let _=p;_<=h;_++)_fe(r[2*_],r[2*_+1],t,n)<=d&&c.push(o[_]);continue}let g=p+h>>1,f=r[2*g],x=r[2*g+1];_fe(f,x,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(g+1),a.push(h),a.push(1-u))}return c}};function XQ(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Tfe(e,t,s,i,o,r),XQ(e,t,n,i,s-1,1-r),XQ(e,t,n,s+1,o,1-r)}function Tfe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),x=Math.min(o,Math.floor(n+(d-u)*p/d+g));Tfe(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(Iv(e,t,i,n),t[2*o+r]>s&&Iv(e,t,i,o);a<c;){for(Iv(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?Iv(e,t,i,c):(c++,Iv(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function Iv(e,t,n,i){IQ(e,n,i),IQ(t,2*n,2*i),IQ(t,2*n+1,2*i+1)}function IQ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function _fe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Vh(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=y(e.show,!0)}function Sfe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var uet=new Ke;function Cfe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=ty.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=lo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Is.getScreenSpaceBoundingBox(e,t,o)),Sfe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Lfe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=ty.getScreenSpaceBoundingBox(s,t,uet);Sfe(a,n),o=Ke.union(o,a,o)}return o}function met(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Lfe(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Vfe(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Lfe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function WQ(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===oe.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(a.id._billboard),u=o._clusterPoints&&l(a.id._point);if(c&&(u||d))continue;let h=a.computeScreenSpacePosition(n);l(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var het=new Ke,fet=new Ke,pet=new Ke;function bet(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Af({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Fd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new nV;let d=e._pixelRange,u=e._minimumClusterSize,h=e._previousClusters,p=[],g=e._previousHeight,f=n.camera.positionCartographic.height,x=n.ellipsoid,_=n.camera.positionWC,C=new Pp(x,_),V=[];e._clusterLabels&&WQ(i,V,n,C,e),e._clusterBillboards&&WQ(o,V,n,C,e),e._clusterPoints&&WQ(r,V,n,C,e);let L,R,G,I,v,P,w,M,b,Z,E,X;if(V.length>0){let F=new Xv(V.length,64,Uint32Array);for(let N=0;N<V.length;++N)F.add(V[N].coord.x,V[N].coord.y);if(F.finish(),f<g)for(G=h.length,L=0;L<G;++L){let N=h[L];if(!C.isPointVisible(N.position))continue;let O=lo._computeScreenSpacePosition(A.IDENTITY,N.position,m.ZERO,D.ZERO,n);if(!l(O))continue;let U=1-f/g,Y=N.width=N.width*U,k=N.height=N.height*U;Y=Math.max(Y,N.minimumWidth),k=Math.max(k,N.minimumHeight);let H=O.x-Y*.5,K=O.y-k*.5,te=O.x+Y,z=O.y+k;for(v=F.range(H,K,te,z),P=v.length,Z=0,b=[],R=0;R<P;++R)w=v[R],M=V[w],M.clustered||(++Z,E=M.collection,X=M.index,b.push(E.get(X).id));if(Z>=u)for(Vfe(N.position,Z,b,e),p.push(N),R=0;R<P;++R)V[v[R]].clustered=!0}for(G=V.length,L=0;L<G;++L){let N=V[L];if(N.clustered)continue;N.clustered=!0,E=N.collection,X=N.index;let O=E.get(X);I=Cfe(O,N.coord,d,e,het);let U=Ke.clone(I,fet);v=F.range(I.x,I.y,I.x+I.width,I.y+I.height),P=v.length;let Y=m.clone(O.position);for(Z=1,b=[O.id],R=0;R<P;++R)if(w=v[R],M=V[w],!M.clustered){let k=M.collection.get(M.index),H=Cfe(k,M.coord,d,e,pet);m.add(k.position,Y,Y),Ke.union(U,H,U),++Z,b.push(k.id)}if(Z>=u){let k=m.multiplyByScalar(Y,1/Z,Y);for(Vfe(k,Z,b,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),R=0;R<P;++R)V[v[R]].clustered=!0}else met(O,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}Vh.prototype._initialize=function(e){this._scene=e;let t=bet(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Vh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function vQ(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function wQ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Vh.prototype.getLabel=vQ("_labelCollection",Af,"_unusedLabelIndices","labelIndex");Vh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,wQ(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Vh.prototype.getBillboard=vQ("_billboardCollection",Fd,"_unusedBillboardIndices","billboardIndex");Vh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,wQ(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Vh.prototype.getPoint=vQ("_pointCollection",nV,"_unusedPointIndices","pointIndex");Vh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,wQ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function PQ(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function get(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,PQ(e._labelCollection),PQ(e._billboardCollection),PQ(e._pointCollection))}Vh.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,get(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Vh.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var kd=Vh;function FQ(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new js(this),this._entityCluster=new kd}Object.defineProperties(FQ.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Yr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});FQ.prototype.update=function(e){return!0};var Wv=FQ;var Hli=T(S(),1);var Rfe=m.ZERO,Zfe=new m,yet=new m,Gfe=new B;function xet(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Ud(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new xet(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Ud.prototype=Object.create(ri.prototype),Ud.prototype.constructor=Ud);Object.defineProperties(Ud.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ud.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Gfe)),l(a)||(a=B.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Rfe,Zfe))),new Et({id:t,geometry:new AE(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Ud.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Gfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Rfe,Zfe))),new Et({id:t,geometry:new ME(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Ud.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Ud.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ri.prototype._isHidden.call(this,e,t)};Ud.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!J.isConstant(t.slices)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.numberOfVerticalLines)};Ud.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Be.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Be.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Be.MINIMUM_VALUE),i.slices=J.getValueOrUndefined(t.slices,Be.MINIMUM_VALUE),i.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Be.MINIMUM_VALUE),i.offsetAttribute=n!==Je.NONE?rn.ALL:void 0};Ud.prototype._onEntityPropertyChanged=hb;Ud.DynamicGeometryUpdater=iV;function iV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(iV.prototype=Object.create(oi.prototype),iV.prototype.constructor=iV);iV.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,yet);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||oi.prototype._isHidden.call(this,e,t,n)};iV.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,Je.NONE),o=this._options;o.length=J.getValueOrUndefined(t.length,n),o.topRadius=J.getValueOrUndefined(t.topRadius,n),o.bottomRadius=J.getValueOrUndefined(t.bottomRadius,n),o.slices=J.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Je.NONE?rn.ALL:void 0};var Pv=Ud;var Sfi=T(S(),1);var Mv=T(dd(),1);var edi=T(S(),1);function IT(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(IT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:el("startTime"),stopTime:el("stopTime"),currentTime:el("currentTime"),clockRange:el("clockRange"),clockStep:el("clockStep"),multiplier:el("multiplier")});IT.prototype.clone=function(e){return l(e)||(e=new IT),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};IT.prototype.equals=function(e){return this===e||l(e)&&q.equals(this.startTime,e.startTime)&&q.equals(this.stopTime,e.stopTime)&&q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};IT.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};IT.prototype.getValue=function(e){return l(e)||(e=new km),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var Lh=IT;var ddi=T(S(),1);var _et=B.WHITE,Tet=.1,Cet=new D(8,8),Vet=new D(0,0),Let=new D(1,1);function oV(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(oV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._cellAlpha)&&J.isConstant(this._lineCount)&&J.isConstant(this._lineThickness)&&J.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),cellAlpha:ue("cellAlpha"),lineCount:ue("lineCount"),lineThickness:ue("lineThickness"),lineOffset:ue("lineOffset")});oV.prototype.getType=function(e){return"Grid"};var Ret=new q;oV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Ret)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,_et,t.color),t.cellAlpha=J.getValueOrDefault(this._cellAlpha,e,Tet),t.lineCount=J.getValueOrClonedDefault(this._lineCount,e,Cet,t.lineCount),t.lineThickness=J.getValueOrClonedDefault(this._lineThickness,e,Let,t.lineThickness),t.lineOffset=J.getValueOrClonedDefault(this._lineOffset,e,Vet,t.lineOffset),t};oV.prototype.equals=function(e){return this===e||e instanceof oV&&J.equals(this._color,e._color)&&J.equals(this._cellAlpha,e._cellAlpha)&&J.equals(this._lineCount,e._lineCount)&&J.equals(this._lineThickness,e._lineThickness)&&J.equals(this._lineOffset,e._lineOffset)};var rV=oV;var ydi=T(S(),1);function sV(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(sV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});sV.prototype.getType=function(e){return"PolylineArrow"};var Zet=new q;sV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Zet)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};sV.prototype.equals=function(e){return this===e||e instanceof sV&&J.equals(this._color,e._color)};var aV=sV;var Zdi=T(S(),1);var Get=B.WHITE,Eet=B.TRANSPARENT,Iet=16,Xet=255;function cV(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(cV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._gapColor)&&J.isConstant(this._dashLength)&&J.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),gapColor:ue("gapColor"),dashLength:ue("dashLength"),dashPattern:ue("dashPattern")});cV.prototype.getType=function(e){return"PolylineDash"};var Wet=new q;cV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Wet)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Get,t.color),t.gapColor=J.getValueOrClonedDefault(this._gapColor,e,Eet,t.gapColor),t.dashLength=J.getValueOrDefault(this._dashLength,e,Iet,t.dashLength),t.dashPattern=J.getValueOrDefault(this._dashPattern,e,Xet,t.dashPattern),t};cV.prototype.equals=function(e){return this===e||e instanceof cV&&J.equals(this._color,e._color)&&J.equals(this._gapColor,e._gapColor)&&J.equals(this._dashLength,e._dashLength)&&J.equals(this._dashPattern,e._dashPattern)};var lV=cV;var Fdi=T(S(),1);var Pet=B.WHITE,vet=.25,wet=1;function dV(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(dV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),glowPower:ue("glowPower"),taperPower:ue("taperPower")});dV.prototype.getType=function(e){return"PolylineGlow"};var Fet=new q;dV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Fet)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Pet,t.color),t.glowPower=J.getValueOrDefault(this._glowPower,e,vet,t.glowPower),t.taperPower=J.getValueOrDefault(this._taperPower,e,wet,t.taperPower),t};dV.prototype.equals=function(e){return this===e||e instanceof dV&&J.equals(this._color,e._color)&&J.equals(this._glowPower,e._glowPower)&&J.equals(this._taperPower,e._taperPower)};var uV=dV;var Ydi=T(S(),1);var Aet=B.WHITE,Met=B.BLACK,Net=1;function mV(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(mV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._outlineColor)&&J.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth")});mV.prototype.getType=function(e){return"PolylineOutline"};var ket=new q;mV.prototype.getValue=function(e,t){return l(e)||(e=q.now(ket)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Aet,t.color),t.outlineColor=J.getValueOrClonedDefault(this._outlineColor,e,Met,t.outlineColor),t.outlineWidth=J.getValueOrDefault(this._outlineWidth,e,Net),t};mV.prototype.equals=function(e){return this===e||e instanceof mV&&J.equals(this._color,e._color)&&J.equals(this._outlineColor,e._outlineColor)&&J.equals(this._outlineWidth,e._outlineWidth)};var uy=mV;var eui=T(S(),1);function e0(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new ar,this._referenceFrame=y(t,Ui.FIXED),this.setValue(e)}Object.defineProperties(e0.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!J.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Uet=new q;e0.prototype.getValue=function(e,t){return l(e)||(e=q.now(Uet)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};e0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};e0.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,e0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};e0.prototype.equals=function(e){return this===e||e instanceof e0&&this._referenceFrame===e._referenceFrame&&J.arrayEquals(this._value,e._value)};e0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var t0=e0;var aui=T(S(),1);function my(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new ar,this.setValue(e)}Object.defineProperties(my.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!J.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Det=new q;my.prototype.getValue=function(e,t){l(e)||(e=q.now(Det));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};my.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,my.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};my.prototype.equals=function(e){return this===e||e instanceof my&&J.arrayEquals(this._value,e._value)};my.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var hV=my;var hui=T(S(),1);function XT(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Dd.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Dd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(Dd.prototype._onCollectionChanged,this)}Object.defineProperties(Dd.prototype,{isConstant:{get:function(){return J.isConstant(XT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=XT(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return XT(this)}}});Dd.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Dd(e,n,i)};var Bet=new q;Dd.prototype.getValue=function(e,t){let n=XT(this);return l(e)||(e=q.now(Bet)),l(n)?n.getValue(e,t):void 0};Dd.prototype.getValueInReferenceFrame=function(e,t,n){let i=XT(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Dd.prototype.getType=function(e){let t=XT(this);return l(t)?t.getType(e):void 0};Dd.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};Dd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Dd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Dd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=XT(this),l(i)&&this._definitionChanged.raiseEvent(this))};var n0=Dd;var yui=T(S(),1);var Oet={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-W.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+W.TWO_PI:o}},om=Oet;var Mui=T(S(),1);var Zui=T(S(),1);var Efe={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function Ife(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Xfe(e,t){return e instanceof q?e:typeof e=="string"?q.fromIso8601(e):q.addSeconds(t,e,new q)}var AQ=[],MQ=[];function gU(e,t,n,i,o){let r=0,s,a,c,d,u,h;for(;r<i.length;){u=Xfe(i[r],e),c=Xo(t,u,q.compare);let p=0,g=0;if(c<0){for(c=~c,d=c*o,a=void 0,h=t[c];r<i.length&&(u=Xfe(i[r],e),!(l(a)&&q.compare(a,u)>=0||l(h)&&q.compare(u,h)>=0));){for(AQ[p++]=u,r=r+1,s=0;s<o;s++)MQ[g++]=i[r],r=r+1;a=u}p>0&&(MQ.length=g,Ife(n,d,MQ),AQ.length=p,Ife(t,c,AQ))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function rm(e,t){let n=e;n===Number&&(n=Efe);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=Efe);let u=d.packedLength;i+=u,o+=y(d.packedInterpolationLength,u),s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Jx,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=_d.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=_d.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(rm.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var Yet=new q;rm.prototype.getValue=function(e,t){l(e)||(e=q.now(Yet));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Xo(n,e,q.compare);if(a<0){if(a=~a,a===0){let R=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===_d.NONE||o!==0&&q.secondsDifference(R,e)>o)return;if(this._backwardExtrapolationType===_d.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let R=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===_d.NONE||o!==0&&q.secondsDifference(e,R)>o)return;if(this._forwardExtrapolationType===_d.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let R=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);R!==this._numberOfPoints&&(this._numberOfPoints=R,c.length=R,d.length=R*h)}let g=this._numberOfPoints-1;if(g<1)return;let f=0,x=i-1;if(x-f+1>=g+1){let R=a-(g/2|0)-1;R<f&&(R=f);let G=R+g;G>x&&(G=x,R=G-g,R<f&&(R=f)),f=R,x=G}let C=x-f+1;for(let R=0;R<C;++R)c[R]=q.secondsDifference(n[f+R],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,x,d);else{let R=0,G=this._packedLength,I=f*G,v=(x+1)*G;for(;I<v;)d[R]=s[I],I++,R++}let V=q.secondsDifference(e,n[x]),L;if(p===0||!l(u.interpolate))L=u.interpolateOrderZero(V,c,d,h,this._interpolationResult);else{let R=Math.floor(h/(p+1));L=u.interpolate(V,c,d,R,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(L,s,f,x,t):r.unpack(L,0,t)}return r.unpack(s,a*this._packedLength,t)};rm.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};rm.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}gU(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};rm.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let h=0;h<u;h++)i[h].pack(d[h],a,a.length)}gU(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};rm.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};rm.prototype.addSamplesPackedArray=function(e,t){gU(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};rm.prototype.removeSample=function(e){let t=Xo(this._times,e,q.compare);return t<0?!1:(Wfe(this,t,1),!0)};function Wfe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}rm.prototype.removeSamples=function(e){let t=this._times,n=Xo(t,e.start,q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Xo(t,e.stop,q.compare);i<0?i=~i:e.isStopIncluded&&++i,Wfe(this,n,i-n)};rm.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!q.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};rm._mergeNewSamples=gU;var Bd=rm;function sm(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new Bd(m,n),this._definitionChanged=new be,this._referenceFrame=y(e,Ui.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(sm.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var Het=new q;sm.prototype.getValue=function(e,t){return l(e)||(e=q.now(Het)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};sm.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Qm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};sm.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};sm.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};sm.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};sm.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};sm.prototype.removeSample=function(e){return this._property.removeSample(e)};sm.prototype.removeSamples=function(e){this._property.removeSamples(e)};sm.prototype.equals=function(e){return this===e||e instanceof sm&&J.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ga=sm;var Qui=T(S(),1);var kui=T(S(),1),zet={HORIZONTAL:0,VERTICAL:1},Rh=Object.freeze(zet);var Ket=Rh.HORIZONTAL,Jet=B.WHITE,Qet=B.BLACK,jet=0,qet=1;function fV(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(fV.prototype,{isConstant:{get:function(){return J.isConstant(this._orientation)&&J.isConstant(this._evenColor)&&J.isConstant(this._oddColor)&&J.isConstant(this._offset)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:ue("orientation"),evenColor:ue("evenColor"),oddColor:ue("oddColor"),offset:ue("offset"),repeat:ue("repeat")});fV.prototype.getType=function(e){return"Stripe"};var $et=new q;fV.prototype.getValue=function(e,t){return l(e)||(e=q.now($et)),l(t)||(t={}),t.horizontal=J.getValueOrDefault(this._orientation,e,Ket)===Rh.HORIZONTAL,t.evenColor=J.getValueOrClonedDefault(this._evenColor,e,Jet,t.evenColor),t.oddColor=J.getValueOrClonedDefault(this._oddColor,e,Qet,t.oddColor),t.offset=J.getValueOrDefault(this._offset,e,jet),t.repeat=J.getValueOrDefault(this._repeat,e,qet),t};fV.prototype.equals=function(e){return this===e||e instanceof fV&&J.equals(this._orientation,e._orientation)&&J.equals(this._evenColor,e._evenColor)&&J.equals(this._oddColor,e._oddColor)&&J.equals(this._offset,e._offset)&&J.equals(this._repeat,e._repeat)};var pV=fV;var smi=T(S(),1);function hy(e){this._definitionChanged=new be,this._intervals=new Nr,this._intervals.changedEvent.addEventListener(hy.prototype._intervalsChanged,this),this._referenceFrame=y(e,Ui.FIXED)}Object.defineProperties(hy.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var ett=new q;hy.prototype.getValue=function(e,t){return l(e)||(e=q.now(ett)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};hy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Qm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};hy.prototype.equals=function(e){return this===e||e instanceof hy&&this._intervals.equals(e._intervals,J.equals)&&this._referenceFrame===e._referenceFrame};hy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var i0=hy;var hmi=T(S(),1);function WT(){this._definitionChanged=new be,this._intervals=new Nr,this._intervals.changedEvent.addEventListener(WT.prototype._intervalsChanged,this)}Object.defineProperties(WT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var ttt=new q;WT.prototype.getValue=function(e,t){l(e)||(e=q.now(ttt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};WT.prototype.equals=function(e){return this===e||e instanceof WT&&this._intervals.equals(e._intervals,J.equals)};WT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var o0=WT;var vmi=T(S(),1);var Tmi=T(S(),1);function bV(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=y(t,!0),this.position=e}Object.defineProperties(bV.prototype,{isConstant:{get:function(){return J.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var ntt=new m,Pfe=new m,vfe=new q,itt=new q,NQ=1/60;bV.prototype.getValue=function(e,t){return this._getValue(e,t)};bV.prototype._getValue=function(e,t,n){l(e)||(e=q.now(itt)),l(t)||(t=new m);let i=this._position;if(J.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let o=i.getValue(e,ntt),r=i.getValue(q.addSeconds(e,NQ,vfe),Pfe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(q.addSeconds(e,-NQ,vfe),Pfe),!l(o)))return;if(m.equals(o,r))return this._normalize?void 0:m.clone(m.ZERO,t);l(n)&&o.clone(n);let s=m.subtract(r,o,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,NQ,t)};bV.prototype.equals=function(e){return this===e||e instanceof bV&&J.equals(this._position,e._position)};var r0=bV;function vv(e,t){this._velocityVectorProperty=new r0(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=y(t,ne.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(vv.prototype,{isConstant:{get:function(){return J.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var wfe=new m,ott=new m,Ffe=new $,rtt=new q;vv.prototype.getValue=function(e,t){l(e)||(e=q.now(rtt));let n=this._velocityVectorProperty._getValue(e,ott,wfe);if(l(n))return Pt.rotationMatrixFromPositionVelocity(wfe,n,this._ellipsoid,Ffe),ve.fromRotationMatrix(Ffe,t)};vv.prototype.equals=function(e){return this===e||e instanceof vv&&J.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var wv=vv;var Ami=T(S(),1);var s0={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};s0.validate=function(e){return e===s0.COMPLETE||e===s0.BELOW_ELLIPSOID_HORIZON||e===s0.ABOVE_ELLIPSOID_HORIZON};s0.toString=function(e){switch(e){case s0.COMPLETE:return"COMPLETE";case s0.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case s0.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var gV=s0;function fy(){}fy.packedLength=m.packedLength;fy.unpack=m.unpack;fy.pack=m.pack;var kQ;function Fv(e,t){return t[0]==="#"&&(t=kQ+t),n0.fromString(e,t)}function Afe(e,t,n){if(l(n.reference))return Fv(t,n.reference);if(l(n.velocityReference)){let i=Fv(t,n.velocityReference);switch(e){case m:case fy:return new r0(i,e===fy);case ve:return new wv(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function stt(e,t){return new eh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Oi=new m,ll=new TI,Zc=new he,PT=new Ln,yU=new ve;function att(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===B.packedLength)return[B.byteToFloat(n[0]),B.byteToFloat(n[1]),B.byteToFloat(n[2]),B.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=B.byteToFloat(n[o+1]),t[o+2]=B.byteToFloat(n[o+2]),t[o+3]=B.byteToFloat(n[o+3]),t[o+4]=B.byteToFloat(n[o+4]);return t}function Mfe(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Ze.createIfNeeded(n)}function ctt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[W.toRadians(n[0]),W.toRadians(n[1]),W.toRadians(n[2]),W.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=W.toRadians(n[o+1]),t[o+2]=W.toRadians(n[o+2]),t[o+3]=W.toRadians(n[o+3]),t[o+4]=W.toRadians(n[o+4]);return t}function ltt(e){let t=e.length;if(ll.magnitude=1,t===2)return ll.clock=e[0],ll.cone=e[1],m.fromSpherical(ll,Oi),[Oi.x,Oi.y,Oi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],ll.clock=e[i+1],ll.cone=e[i+2],m.fromSpherical(ll,Oi),n[o+1]=Oi.x,n[o+2]=Oi.y,n[o+3]=Oi.z;return n}function dtt(e){let t=e.length;if(t===3)return ll.clock=e[0],ll.cone=e[1],ll.magnitude=e[2],m.fromSpherical(ll,Oi),[Oi.x,Oi.y,Oi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ll.clock=e[i+1],ll.cone=e[i+2],ll.magnitude=e[i+3],m.fromSpherical(ll,Oi),n[i+1]=Oi.x,n[i+2]=Oi.y,n[i+3]=Oi.z;return n}function utt(e){let t=e.length;if(t===3)return Zc.longitude=e[0],Zc.latitude=e[1],Zc.height=e[2],ne.default.cartographicToCartesian(Zc,Oi),[Oi.x,Oi.y,Oi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Zc.longitude=e[i+1],Zc.latitude=e[i+2],Zc.height=e[i+3],ne.default.cartographicToCartesian(Zc,Oi),n[i+1]=Oi.x,n[i+2]=Oi.y,n[i+3]=Oi.z;return n}function mtt(e){let t=e.length;if(t===3)return Zc.longitude=W.toRadians(e[0]),Zc.latitude=W.toRadians(e[1]),Zc.height=e[2],ne.default.cartographicToCartesian(Zc,Oi),[Oi.x,Oi.y,Oi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Zc.longitude=W.toRadians(e[i+1]),Zc.latitude=W.toRadians(e[i+2]),Zc.height=e[i+3],ne.default.cartographicToCartesian(Zc,Oi),n[i+1]=Oi.x,n[i+2]=Oi.y,n[i+3]=Oi.z;return n}function UQ(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return ltt(o);let r=e.spherical;if(l(r))return dtt(r);let s=e.cartographicRadians;if(l(s))return utt(s);let a=e.cartographicDegrees;if(l(a))return mtt(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Nfe(e,t){m.unpack(e,t,Oi),m.normalize(Oi,Oi),m.pack(Oi,e,t)}function htt(e){let t=UQ(e);if(t.length===3)return Nfe(t,0),t;for(let n=1;n<t.length;n+=4)Nfe(t,n);return t}function kfe(e,t){ve.unpack(e,t,yU),ve.normalize(yU,yU),ve.pack(yU,e,t)}function ftt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return kfe(t,0),t;for(let n=1;n<t.length;n+=5)kfe(t,n)}return t}function Ufe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ke:e.hasOwnProperty("cartesian2")?D:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?fy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?B:e.hasOwnProperty("arcType")?en:e.hasOwnProperty("classificationType")?Dn:e.hasOwnProperty("colorBlendMode")?Tc:e.hasOwnProperty("cornerType")?Pi:e.hasOwnProperty("heightReference")?Je:e.hasOwnProperty("horizontalOrigin")?_i:e.hasOwnProperty("date")?q:e.hasOwnProperty("labelStyle")?Do:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?kt:e.hasOwnProperty("distanceDisplayCondition")?wt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?ve:e.hasOwnProperty("shadowMode")?Tn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Rh:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?Mv.default:e.hasOwnProperty("verticalOrigin")?An:Object}function ptt(e,t,n){switch(e){case en:return en[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ke:return t.boundingRectangle;case D:return t.cartesian2;case m:return UQ(t);case fy:return htt(t);case B:return att(t);case Dn:return Dn[y(t.classificationType,t)];case Tc:return Tc[y(t.colorBlendMode,t)];case Pi:return Pi[y(t.cornerType,t)];case Je:return Je[y(t.heightReference,t)];case _i:return _i[y(t.horizontalOrigin,t)];case Image:return Mfe(t,n);case q:return q.fromIso8601(y(t.date,t));case Do:return Do[y(t.labelStyle,t)];case Number:return y(t.number,t);case kt:return t.nearFarScalar;case wt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case ve:return ftt(t);case om:return y(t.number,t);case gV:return gV[y(t.portionToDisplay,t)];case Tn:return Tn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case Rh:return Rh[y(t.stripeOrientation,t)];case ce:return ctt(t);case Mv.default:return Mfe(t,n);case An:return An[y(t.verticalOrigin,t)];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var btt={HERMITE:JE,LAGRANGE:tI,LINEAR:Jx};function xU(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:btt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=_d[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=_d[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Dfe={iso8601:void 0};function mr(e){if(l(e))return Dfe.iso8601=e,Ln.fromIso8601(Dfe)}function DQ(e){let t=Be.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Bfe(e){let t=new Lc;return t.intervals.addInterval(DQ(e)),t}function Ofe(e){let t=new ba(e.referenceFrame);return t.intervals.addInterval(DQ(e)),t}function _U(e,t,n,i,o,r,s){let a=mr(i.interval);l(o)&&(l(a)?a=Ln.intersect(a,o,PT):a=o);let c,d,u,h=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Be.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return tpe(t[n],a)}let g=!1;if(h){if(d=ptt(e,i,r),!l(d))return;c=y(e.packedLength,1),u=y(d.length,1),g=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==om;if(!g&&!p){h?t[n]=new Qn(f?e.unpack(d,0):d):t[n]=Afe(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=q.fromIso8601(C)),g&&!p){x instanceof Bd||(t[n]=x=new Bd(e)),x.addSamplesPackedArray(d,_),xU(i,x);return}let V;if(!g&&p){a=a.clone(),h?a.data=f?e.unpack(d,0):d:a.data=Afe(e,s,i),l(x)||(t[n]=x=h?new o0:new Lc),h&&x instanceof o0?x.intervals.addInterval(a):x instanceof Lc?(h&&(a.data=new Qn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Bfe(x),h&&(a.data=new Qn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new Lc),x instanceof Lc||(t[n]=x=Bfe(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof Bd))&&(V=a.clone(),V.data=new Bd(e),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),xU(i,V.data)}function tpe(e,t){if(e instanceof Bd){e.removeSamples(t);return}else if(e instanceof o0){e.intervals.removeInterval(t);return}else if(e instanceof Lc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Ln.intersect(n.get(i),t,PT);o.isEmpty||tpe(o.data,t)}n.removeInterval(t);return}}function _e(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)_U(e,t,n,i[a],o,r,s);else _U(e,t,n,i,o,r,s)}function Yfe(e,t,n,i,o,r){let s=mr(n.interval);l(i)&&(l(s)?s=Ln.intersect(s,i,PT):s=i);let a=l(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),d,u,h=!l(n.reference),p=l(s)&&!s.equals(Be.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return npe(e[t],s)}let g,f=!1;if(h&&(l(n.referenceFrame)&&(g=Ui[n.referenceFrame]),g=y(g,Ui.FIXED),d=UQ(n),u=y(d.length,1),f=u>c),!f&&!p){h?e[t]=new $c(m.unpack(d),g):e[t]=Fv(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=q.fromIso8601(C)),f&&!p){(!(x instanceof ga)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new ga(g,a)),x.addSamplesPackedArray(d,_),xU(n,x);return}let V;if(!f&&p){s=s.clone(),h?s.data=m.unpack(d):s.data=Fv(r,n.reference),l(x)||(h?x=new i0(g):x=new ba(g),e[t]=x),h&&x instanceof i0&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof ba?(h&&(s.data=new $c(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=Ofe(x),h&&(s.data=new $c(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof ba||(e[t]=x=Ofe(x)):e[t]=x=new ba(g);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof ga)||l(g)&&V.data.referenceFrame!==g)&&(V=s.clone(),V.data=new ga(g,a),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),xU(n,V.data)}function npe(e,t){if(e instanceof ga){e.removeSamples(t);return}else if(e instanceof i0){e.intervals.removeInterval(t);return}else if(e instanceof ba){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Ln.intersect(n.get(i),t,PT);o.isEmpty||npe(o.data,t)}n.removeInterval(t);return}}function ipe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Yfe(e,t,n[s],i,o,r);else Yfe(e,t,n,i,o,r)}function Hfe(e,t,n,i){l(n.references)?TU(e,t,n.references,n.interval,i,hV,Lc):(l(n.cartesian2)?n.array=D.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=D.unpackArray(n.cartesian)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function zfe(e,t,n,i,o,r){let s=mr(n.interval);l(i)&&(l(s)?s=Ln.intersect(s,i,PT):s=i);let a=e[t],c,d;if(l(s)){a instanceof eV||(a=new eV,e[t]=a);let h=a.intervals;d=h.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),h.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Dt||(c=new Dt),u=n.solidColor,_e(B,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof rV||(c=new rV),u=n.grid,_e(B,c,"color",u.color,void 0,o,r),_e(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),_e(D,c,"lineCount",u.lineCount,void 0,o,r),_e(D,c,"lineThickness",u.lineThickness,void 0,o,r),_e(D,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Ig||(c=new Ig),u=n.image,_e(Image,c,"image",u.image,void 0,o,r),_e(D,c,"repeat",u.repeat,void 0,o,r),_e(B,c,"color",u.color,void 0,o,r),_e(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof pV||(c=new pV),u=n.stripe,_e(Rh,c,"orientation",u.orientation,void 0,o,r),_e(B,c,"evenColor",u.evenColor,void 0,o,r),_e(B,c,"oddColor",u.oddColor,void 0,o,r),_e(Number,c,"offset",u.offset,void 0,o,r),_e(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof uy||(c=new uy),u=n.polylineOutline,_e(B,c,"color",u.color,void 0,o,r),_e(B,c,"outlineColor",u.outlineColor,void 0,o,r),_e(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof uV||(c=new uV),u=n.polylineGlow,_e(B,c,"color",u.color,void 0,o,r),_e(Number,c,"glowPower",u.glowPower,void 0,o,r),_e(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof aV||(c=new aV),u=n.polylineArrow,_e(B,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof lV||(c=new lV),u=n.polylineDash,_e(B,c,"color",u.color,void 0,void 0,r),_e(B,c,"gapColor",u.gapColor,void 0,void 0,r),_e(Number,c,"dashLength",u.dashLength,void 0,o,r),_e(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof q1||(c=new q1),u=n.checkerboard,_e(B,c,"evenColor",u.evenColor,void 0,o,r),_e(B,c,"oddColor",u.oddColor,void 0,o,r),_e(D,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Od(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)zfe(e,t,n[s],i,o,r);else zfe(e,t,n,i,o,r)}function gtt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function ytt(e,t,n,i){let o=t.description;l(o)&&_e(String,e,"description",o,void 0,i,n)}function xtt(e,t,n,i){let o=t.position;l(o)&&ipe(e,"position",o,void 0,i,n)}function _tt(e,t,n,i){let o=t.viewFrom;l(o)&&_e(m,e,"viewFrom",o,void 0,i,n)}function Ttt(e,t,n,i){let o=t.orientation;l(o)&&_e(ve,e,"orientation",o,void 0,i,n)}function Stt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new tl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)_U(Ufe(s[a]),e.properties,r,s[a],void 0,i,n);else _U(Ufe(s),e.properties,r,s,void 0,i,n)}}}function TU(e,t,n,i,o,r,s){let a=n.map(function(c){return Fv(o,c)});if(l(i)){i=mr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(DQ(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Kfe(e,t,n,i){let o=n.references;l(o)?TU(e,t,o,n.interval,i,hV,Lc):_e(Array,e,t,n,void 0,void 0,i)}function Jfe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Kfe(e,t,n[o],i);else Kfe(e,t,n,i)}function Qfe(e,t,n,i){let o=n.references;l(o)?TU(e,t,o,n.interval,i,t0,ba):(l(n.cartesian)?n.array=m.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function Nv(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Qfe(e,t,n[o],i);else Qfe(e,t,n,i)}function Ctt(e){return m.unpackArray(e)}function Vtt(e){return m.fromRadiansArrayHeights(e,ne.default)}function Ltt(e){return m.fromDegreesArrayHeights(e,ne.default)}function jfe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return TU(a,"positions",s,n.interval,i,t0,ba),a.positions});e[t]=new t0(r)}else l(n.cartesian)?n.array=n.cartesian.map(Ctt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Vtt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(Ltt)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i)}function Rtt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)jfe(e,t,n[o],i);else jfe(e,t,n,i)}function Ztt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Hfe(e,t,n[o],i);else Hfe(e,t,n,i)}function Gtt(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Nr),r.addInterval(mr(o[s]));else r=new Nr,r.addInterval(mr(o));e.availability=r}function Ett(e,t,n,i,o){l(t)&&_e(fy,e,"alignedAxis",t,n,i,o)}function Itt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=mr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new pc),_e(Boolean,s,"show",o.show,r,i,n),_e(Image,s,"image",o.image,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(D,s,"pixelOffset",o.pixelOffset,r,i,n),_e(m,s,"eyeOffset",o.eyeOffset,r,i,n),_e(_i,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(An,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(B,s,"color",o.color,r,i,n),_e(om,s,"rotation",o.rotation,r,i,n),Ett(s,o.alignedAxis,r,i,n),_e(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Xtt(e,t,n,i){let o=t.box;if(!l(o))return;let r=mr(o.interval),s=e.box;l(s)||(e.box=s=new L_),_e(Boolean,s,"show",o.show,r,i,n),_e(m,s,"dimensions",o.dimensions,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Wtt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=mr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Z_),_e(Boolean,s,"show",o.show,r,i,n),Nv(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Pi,s,"cornerType",o.cornerType,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Dn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Ptt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=mr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new G_),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"length",o.length,r,i,n),_e(Number,s,"topRadius",o.topRadius,r,i,n),_e(Number,s,"bottomRadius",o.bottomRadius,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(Number,s,"slices",o.slices,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function vtt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new ae("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ae("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function wtt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=mr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new E_),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),_e(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(om,s,"rotation",o.rotation,r,i,n),_e(om,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Dn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Ftt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=mr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new I_),_e(Boolean,s,"show",o.show,r,i,n),_e(m,s,"radii",o.radii,r,i,n),_e(m,s,"innerRadii",o.innerRadii,r,i,n),_e(Number,s,"minimumClock",o.minimumClock,r,i,n),_e(Number,s,"maximumClock",o.maximumClock,r,i,n),_e(Number,s,"minimumCone",o.minimumCone,r,i,n),_e(Number,s,"maximumCone",o.maximumCone,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"stackPartitions",o.stackPartitions,r,i,n),_e(Number,s,"slicePartitions",o.slicePartitions,r,i,n),_e(Number,s,"subdivisions",o.subdivisions,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Att(e,t,n,i){let o=t.label;if(!l(o))return;let r=mr(o.interval),s=e.label;l(s)||(e.label=s=new jm),_e(Boolean,s,"show",o.show,r,i,n),_e(String,s,"text",o.text,r,i,n),_e(String,s,"font",o.font,r,i,n),_e(Do,s,"style",o.style,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Boolean,s,"showBackground",o.showBackground,r,i,n),_e(B,s,"backgroundColor",o.backgroundColor,r,i,n),_e(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),_e(D,s,"pixelOffset",o.pixelOffset,r,i,n),_e(m,s,"eyeOffset",o.eyeOffset,r,i,n),_e(_i,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(An,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(B,s,"fillColor",o.fillColor,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Mtt(e,t,n,i){let o=t.model;if(!l(o))return;let r=mr(o.interval),s=e.model;l(s)||(e.model=s=new db),_e(Boolean,s,"show",o.show,r,i,n),_e(Mv.default,s,"uri",o.gltf,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),_e(Number,s,"maximumScale",o.maximumScale,r,i,n),_e(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),_e(Boolean,s,"runAnimations",o.runAnimations,r,i,n),_e(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(B,s,"silhouetteColor",o.silhouetteColor,r,i,n),_e(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),_e(B,s,"color",o.color,r,i,n),_e(Tc,s,"colorBlendMode",o.colorBlendMode,r,i,n),_e(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)qfe(s,d[a],r,i,n);else qfe(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)$fe(s,u[a],r,i,n);else $fe(s,u,r,i,n)}function qfe(e,t,n,i,o){let r=mr(t.interval);l(n)&&(l(r)?r=Ln.intersect(r,n,PT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let h=t[u];if(!l(h))continue;l(s)||(e.nodeTransformations=s=new tl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new X_),_e(m,p,"translation",h.translation,r,i,o),_e(ve,p,"rotation",h.rotation,r,i,o),_e(m,p,"scale",h.scale,r,i,o)}}function $fe(e,t,n,i,o){let r=mr(t.interval);l(n)&&(l(r)?r=Ln.intersect(r,n,PT):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let h=t[u];l(h)&&(l(s)||(e.articulations=s=new tl),s.hasProperty(u)||s.addProperty(u),_e(Number,s,u,h,r,i,o))}}function Ntt(e,t,n,i){let o=t.path;if(!l(o))return;let r=mr(o.interval),s=e.path;l(s)||(e.path=s=new ub),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"leadTime",o.leadTime,r,i,n),_e(Number,s,"trailTime",o.trailTime,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"resolution",o.resolution,r,i,n),Od(s,"material",o.material,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ktt(e,t,n,i){let o=t.point;if(!l(o))return;let r=mr(o.interval),s=e.point;l(s)||(e.point=s=new P_),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"pixelSize",o.pixelSize,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(B,s,"color",o.color,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Av(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(Av.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});Av.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new va(o)}))),l(t)?(t.positions=n,t.holes=i,t):new va(n,i)};Av.prototype.equals=function(e){return this===e||e instanceof Av&&J.equals(this.polygon._positions,e.polygon._positions)&&J.equals(this.polygon._holes,e.polygon._holes)};function Utt(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=mr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new qm),_e(Boolean,s,"show",o.show,r,i,n),Nv(s,"_positions",o.positions,n),Rtt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new Av(s)),_e(Number,s,"height",o.height,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(om,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),_e(Boolean,s,"closeTop",o.closeTop,r,i,n),_e(Boolean,s,"closeBottom",o.closeBottom,r,i,n),_e(en,s,"arcType",o.arcType,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Dn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Dtt(e){return e?en.GEODESIC:en.NONE}function Btt(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=mr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new gc),_e(Boolean,s,"show",o.show,r,i,n),Nv(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),Od(s,"material",o.material,r,i,n),Od(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),_e(en,s,"arcType",o.arcType,r,i,n),_e(Boolean,s,"clampToGround",o.clampToGround,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Dn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};_e(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=stt(a.followSurface,Dtt)}}function Ott(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=mr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new v_),Nv(s,"positions",o.positions,n),Ztt(s,"shape",o.shape,n),_e(Boolean,s,"show",o.show,r,i,n),_e(Pi,s,"cornerType",o.cornerType,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Ytt(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=mr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new $m),_e(Boolean,s,"show",o.show,r,i,n),_e(ce,s,"coordinates",o.coordinates,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(om,s,"rotation",o.rotation,r,i,n),_e(om,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Dn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Htt(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=mr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new W_),_e(Boolean,s,"show",o.show,r,i,n),_e(Mv.default,s,"uri",o.uri,r,i,n),_e(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function ztt(e,t,n,i){let o=t.wall;if(!l(o))return;let r=mr(o.interval),s=e.wall;l(s)||(e.wall=s=new mb),_e(Boolean,s,"show",o.show,r,i,n),Nv(s,"positions",o.positions,n),Jfe(s,"minimumHeights",o.minimumHeights,n),Jfe(s,"maximumHeights",o.maximumHeights,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Od(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function epe(e,t,n,i,o){let r=e.id;if(l(r)||(r=Hn()),kQ=r,!l(o._version)&&r!=="document")throw new ae("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")vtt(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}kQ=void 0}function Ktt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Be.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=q.secondsDifference(s,r),c=Math.round(a/120);return t=new Lh,t.startTime=q.clone(r),t.stopTime=q.clone(s),t.clockRange=vr.LOOP_STOP,t.multiplier=c,t.currentTime=q.clone(r),t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Lh,t.startTime=Be.MINIMUM_VALUE.clone(),t.stopTime=Be.MAXIMUM_VALUE.clone(),t.currentTime=Be.MINIMUM_VALUE.clone(),t.clockRange=vr.LOOP_STOP,t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=mr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(vr[n.range],vr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(fo[n.step],fo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function ope(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Ct(s)),e._credit=s,typeof t=="string"||t instanceof Ze){t=Ze.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=Ze.createIfNeeded(r),Yr.setLoading(e,!0),Promise.resolve(o).then(function(a){return Jtt(e,a,r,i)}).catch(function(a){return Yr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function Jtt(e,t,n,i){Yr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new rpe,o.removeAll()),gs._processCzml(t,o,n,void 0,e);let r=Ktt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=ib(n.getUrlComponent()),r=!0),Yr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function rpe(){this.name=void 0,this.clock=void 0}function gs(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new rpe,this._version=void 0,this._entityCollection=new js(this),this._entityCluster=new kd,this._credit=void 0,this._resourceCredits=[]}gs.load=function(e,t){return new gs().load(e,t)};Object.defineProperties(gs.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});gs.updaters=[Itt,Xtt,Wtt,Ptt,wtt,Ftt,Att,Mtt,gtt,ytt,Ntt,ktt,Utt,Btt,Ott,Stt,Ytt,xtt,Htt,_tt,ztt,Ttt,Gtt];gs.registerUpdater=function(e){gs.updaters.includes(e)||gs.updaters.push(e)};gs.unregisterUpdater=function(e){if(gs.updaters.includes(e)){let t=gs.updaters.indexOf(e);gs.updaters.splice(t,1)}};gs.prototype.process=function(e,t){return ope(this,e,t,!1)};gs.prototype.load=function(e,t){return ope(this,e,t,!0)};gs.prototype.update=function(e){return!0};gs.processPacketData=_e;gs.processPositionPacketData=ipe;gs.processMaterialPacketData=Od;gs._processCzml=function(e,t,n,i,o){if(i=y(i,gs.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)epe(e[r],t,i,n,o);else epe(e,t,i,n,o)};var kv=gs;var Gfi=T(S(),1);function dl(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(dl.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});dl.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};dl.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};dl.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};dl.prototype.contains=function(e){return this.indexOf(e)!==-1};dl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};dl.prototype.get=function(e){return this._dataSources[e]};dl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function SU(e,t){return e.indexOf(t)}function spe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=W.clamp(t,0,o),n=W.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}dl.prototype.raise=function(e){let t=SU(this._dataSources,e);spe(this,t,t+1)};dl.prototype.lower=function(e){let t=SU(this._dataSources,e);spe(this,t,t-1)};dl.prototype.raiseToTop=function(e){let t=SU(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};dl.prototype.lowerToBottom=function(e){let t=SU(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};dl.prototype.isDestroyed=function(){return!1};dl.prototype.destroy=function(){return this.removeAll(!0),me(this)};var Uv=dl;var tSi=T(S(),1);var Ufi=T(S(),1);var wfi=T(S(),1);function ya(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=Hn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(ya.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});ya.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};ya.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};ya.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};ya.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};ya.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function CU(e,t){return e._primitives.indexOf(t)}ya.prototype.raise=function(e){if(l(e)){let t=CU(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};ya.prototype.raiseToTop=function(e){if(l(e)){let t=CU(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};ya.prototype.lower=function(e){if(l(e)){let t=CU(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};ya.prototype.lowerToBottom=function(e){if(l(e)){let t=CU(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};ya.prototype.get=function(e){return this._primitives[e]};ya.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};ya.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};ya.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};ya.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};ya.prototype.isDestroyed=function(){return!1};ya.prototype.destroy=function(){return this.removeAll(),me(this)};var ul=ya;function Uf(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Uf.prototype,{length:{get:function(){return this._length}}});Uf.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new ul({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Uf.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Uf.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};Uf.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Uf.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Uf.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Uf.prototype.isDestroyed=function(){return!1};Uf.prototype.destroy=function(){return this.removeAll(),me(this)};var Dv=Uf;var Hyi=T(S(),1);var Hfi=T(S(),1);function yV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Gt}yV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};yV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};yV.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};yV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};yV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):dt.FAILED};var vT=yV;var rgi=T(S(),1);var ppi=T(S(),1);var ape=new B,cpe=m.ZERO,lpe=new m,dpe=new ce;function Qtt(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Zh(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new Qtt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Zh.prototype=Object.create(Yn.prototype),Zh.prototype.constructor=Zh);Zh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,ape)),l(o)||(o=B.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,cpe,lpe))),new Et({id:t,geometry:new Hc(this._options),attributes:i})};Zh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,ape),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,cpe,lpe))),new Et({id:t,geometry:new bd(this._options),attributes:r})};Zh.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Zh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ri.prototype._isHidden.call(this,e,t)};Zh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!J.isConstant(t.rotation)||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.stRotation)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.numberOfVerticalLines)||!J.isConstant(t.zIndex)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Zh.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Je.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Dt?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Be.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Be.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Be.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=J.getValueOrUndefined(t.rotation,Be.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),s.stRotation=J.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),s.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Be.MINIMUM_VALUE),s.offsetAttribute=Yn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Yn.getGeometryHeight(n,i),o=Yn.getGeometryExtrudedHeight(o,r),o===Yn.CLAMP_TO_GROUND&&(o=di.getMinimumMaximumHeights(Hc.computeRectangle(s,dpe)).minimumTerrainHeight),s.extrudedHeight=o};Zh.DynamicGeometryUpdater=xV;function xV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(xV.prototype=Object.create(oi.prototype),xV.prototype.constructor=xV);xV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t,n)};xV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Je.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,Je.NONE);l(s)&&!l(o)&&(o=0),i.center=J.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=J.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=J.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=J.getValueOrUndefined(t.rotation,n),i.granularity=J.getValueOrUndefined(t.granularity,n),i.stRotation=J.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=di.getMinimumMaximumHeights(Hc.computeRectangle(i,dpe)).minimumTerrainHeight),i.extrudedHeight=s};var Bv=Zh;var Bpi=T(S(),1);var jtt=new Dt(B.WHITE),BQ=m.ZERO,OQ=new m,qtt=new m,$tt=new m,YQ=new B,ent=new m(1,1,1);function tnt(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Yd(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new tnt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Yd.prototype=Object.create(ri.prototype),Yd.prototype.constructor=Yd);Object.defineProperties(Yd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Yd.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new _n(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Un.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,YQ)),l(u)||(u=B.WHITE),r=Yt.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,BQ,OQ))),new Et({id:i,geometry:new Us(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};Yd.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,YQ),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new _n(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(r),distanceDisplayCondition:Un.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,BQ,OQ))),new Et({id:i,geometry:new xd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Yd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Yd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ri.prototype._isHidden.call(this,e,t)};Yd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.radii.isConstant||!J.isConstant(t.innerRadii)||!J.isConstant(t.stackPartitions)||!J.isConstant(t.slicePartitions)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.minimumClock)||!J.isConstant(t.maximumClock)||!J.isConstant(t.minimumCone)||!J.isConstant(t.maximumCone)||!J.isConstant(t.subdivisions)};Yd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Be.MINIMUM_VALUE,i.radii),i.innerRadii=J.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=J.getValueOrUndefined(t.minimumClock,Be.MINIMUM_VALUE),i.maximumClock=J.getValueOrUndefined(t.maximumClock,Be.MINIMUM_VALUE),i.minimumCone=J.getValueOrUndefined(t.minimumCone,Be.MINIMUM_VALUE),i.maximumCone=J.getValueOrUndefined(t.maximumCone,Be.MINIMUM_VALUE),i.stackPartitions=J.getValueOrUndefined(t.stackPartitions,Be.MINIMUM_VALUE),i.slicePartitions=J.getValueOrUndefined(t.slicePartitions,Be.MINIMUM_VALUE),i.subdivisions=J.getValueOrUndefined(t.subdivisions,Be.MINIMUM_VALUE),i.offsetAttribute=n!==Je.NONE?rn.ALL:void 0};Yd.prototype._onEntityPropertyChanged=hb;Yd.DynamicGeometryUpdater=Ov;function Ov(e,t,n){oi.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new A,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new m,this._material={}}l(Object.create)&&(Ov.prototype=Object.create(oi.prototype),Ov.prototype.constructor=Ov);Ov.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!J.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=J.getValueOrUndefined(n.radii,e,qtt),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=J.getValueOrDefault(n.fill,e,!0),s=J.getValueOrDefault(n.outline,e,!1),a=J.getValueOrClonedDefault(n.outlineColor,e,B.BLACK,YQ),c=qo.getValue(e,y(n.material,jtt),this._material),d=J.getValueOrUndefined(n.innerRadii,e,$tt),u=J.getValueOrUndefined(n.minimumClock,e),h=J.getValueOrUndefined(n.maximumClock,e),p=J.getValueOrUndefined(n.minimumCone,e),g=J.getValueOrUndefined(n.maximumCone,e),f=J.getValueOrUndefined(n.stackPartitions,e),x=J.getValueOrUndefined(n.slicePartitions,e),_=J.getValueOrUndefined(n.subdivisions,e),C=J.getValueOrDefault(n.outlineWidth,e,1),V=J.getValueOrDefault(n.heightReference,e,Je.NONE),L=V!==Je.NONE?rn.ALL:void 0,R=this._scene.mode,G=R===oe.SCENE3D&&V===Je.NONE,I=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),w=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),M=J.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,BQ,OQ);if(!G||this._lastSceneMode!==R||!l(this._primitive)||I.stackPartitions!==f||I.slicePartitions!==x||l(d)&&!m.equals(I.innerRadii!==d)||I.minimumClock!==u||I.maximumClock!==h||I.minimumCone!==p||I.maximumCone!==g||I.subdivisions!==_||this._lastOutlineWidth!==C||I.offsetAttribute!==L){let Z=this._primitives;Z.removeAndDestroy(this._primitive),Z.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=C,I.stackPartitions=f,I.slicePartitions=x,I.subdivisions=_,I.offsetAttribute=L,I.radii=m.clone(G?ent:i,I.radii),l(d)?G?I.innerRadii=m.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,I.innerRadii):I.innerRadii=m.clone(d,I.innerRadii):I.innerRadii=void 0,I.minimumClock=u,I.maximumClock=h,I.minimumCone=p,I.maximumCone=g;let E=new ao({material:c,translucent:c.isTranslucent(),closed:!0});I.vertexFormat=E.vertexFormat;let X=this._geometryUpdater.createFillGeometryInstance(e,G,this._modelMatrix);this._primitive=Z.add(new In({geometryInstances:X,appearance:E,asynchronous:!1,shadows:v}));let F=this._geometryUpdater.createOutlineGeometryInstance(e,G,this._modelMatrix);this._outlinePrimitive=Z.add(new In({geometryInstances:F,appearance:new dn({flat:!0,translucent:F.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=B.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=w,this._lastOffset=m.clone(M,this._lastOffset)}else if(this._primitive.ready){let Z=this._primitive,E=this._outlinePrimitive;Z.show=!0,E.show=!0,Z.appearance.material=c;let X=this._attributes;l(X)||(X=Z.getGeometryInstanceAttributes(t),this._attributes=X),r!==this._lastShow&&(X.show=_n.toValue(r,X.show),this._lastShow=r);let F=this._outlineAttributes;l(F)||(F=E.getGeometryInstanceAttributes(t),this._outlineAttributes=F),s!==this._lastOutlineShow&&(F.show=_n.toValue(s,F.show),this._lastOutlineShow=s),B.equals(a,this._lastOutlineColor)||(F.color=Yt.toValue(a,F.color),B.clone(a,this._lastOutlineColor)),wt.equals(w,this._lastDistanceDisplayCondition)||(X.distanceDisplayCondition=Un.toValue(w,X.distanceDisplayCondition),F.distanceDisplayCondition=Un.toValue(w,F.distanceDisplayCondition),wt.clone(w,this._lastDistanceDisplayCondition)),m.equals(M,this._lastOffset)||(X.offset=$i.toValue(M,X.offset),F.offset=$i.toValue(M,X.offset),m.clone(M,this._lastOffset))}G&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=A.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var Yv=Yd;var dbi=T(S(),1);var nnt=new m,upe=new B;function int(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function am(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new int(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(am.prototype=Object.create(ri.prototype),am.prototype.constructor=am);am.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Dt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,upe)),l(g)||(g=B.WHITE),o=Yt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),h=J.getValueOrDefault(c.plane,e,d.plane),p=J.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=h,d.dimensions=p,u=HQ(h,p,u,u),new Et({id:t,geometry:new aI(this._options),modelMatrix:u,attributes:i})};am.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,upe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=J.getValueOrDefault(r.plane,e,s.plane),d=J.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=HQ(c,d,a,a),new Et({id:t,geometry:new cI,modelMatrix:a,attributes:{show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};am.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ri.prototype._isHidden.call(this,e,t)};am.prototype._getIsClosed=function(e){return!1};am.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};am.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Dt,i=this._options;i.vertexFormat=n?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Be.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Be.MINIMUM_VALUE,i.dimensions)};am.DynamicGeometryUpdater=_V;function _V(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(_V.prototype=Object.create(oi.prototype),_V.prototype.constructor=_V);_V.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,nnt);return!l(o)||!l(i.plane)||!l(i.dimensions)||oi.prototype._isHidden.call(this,e,t,n)};_V.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=J.getValueOrDefault(t.plane,n,i.plane),i.dimensions=J.getValueOrUndefined(t.dimensions,n,i.dimensions)};var ont=new m,rnt=new m,snt=new m,ant=new m,cnt=new $,lnt=new $,dnt=new A;function HQ(e,t,n,i){let o=e.normal,r=e.distance,s=m.multiplyByScalar(o,-r,snt),a=m.clone(m.UNIT_Z,rnt);W.equalsEpsilon(Math.abs(m.dot(a,o)),1,W.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,o,ont);a=m.cross(o,c,a),m.normalize(c,c),m.normalize(a,a);let d=cnt;$.setColumn(d,0,c,d),$.setColumn(d,1,a,d),$.setColumn(d,2,o,d);let u=m.fromElements(t.x,t.y,1,ant),h=$.multiplyByScale(d,u,lnt),p=A.fromRotationTranslation(h,s,dnt);return A.multiplyTransformation(n,p,i)}am.createPrimitiveMatrix=HQ;var Hv=am;var Nbi=T(S(),1);var mpe="Entity polygons cannot have both height and perPositionHeight.  height will be ignored",hpe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",fpe=new B,ppe=m.ZERO,bpe=new m,gpe=new ce,unt=[],mnt=new D;function hnt(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function Hd(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new hnt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Hd.prototype=Object.create(Yn.prototype),Hd.prototype.constructor=Hd);Hd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,fpe)),l(s)||(s=B.WHITE),o.color=Yt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ppe,bpe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new GE(i):r=new qp(i),new Et({id:t,geometry:r,attributes:o})};Hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,fpe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(o),distanceDisplayCondition:Un.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ppe,bpe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Eu(i):a=new lI(i),new Et({id:t,geometry:a,attributes:s})};Hd.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Qr.fromPoints(i,o),s=r.projectPointsOntoPlane(i,unt),a=s.length,c=0,d=a-1,u=new D;for(let p=0;p<a;d=p++){let g=s[p],f=s[d],x=g.x*f.y-f.x*g.y,_=D.add(g,f,mnt);_=D.multiplyByScalar(_,x,_),u=D.add(u,_,u),c+=x}let h=1/(c*3);return u=D.multiplyByScalar(u,h,u),r.projectPointOntoEllipsoid(u,t)};Hd.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ri.prototype._isHidden.call(this,e,t)};Hd.prototype._isOnTerrain=function(e,t){let n=Yn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Be.MINIMUM_VALUE):!0);return n&&!o};Hd.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.stRotation)||!J.isConstant(t.textureCoordinates)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.perPositionHeight)||!J.isConstant(t.closeTop)||!J.isConstant(t.closeBottom)||!J.isConstant(t.zIndex)||!J.isConstant(t.arcType)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Hd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Dt,i=this._options;i.vertexFormat=n?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Be.MINIMUM_VALUE),r=J.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),s=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),a=J.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),c=J.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Je.NONE),d=J.getValueOrDefault(t.perPositionHeight,Be.MINIMUM_VALUE,!1);r=Yn.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,_t(mpe)),s!==Je.NONE&&d&&(r=void 0,_t(hpe))):(l(a)&&!l(r)&&(r=0),u=Yn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=J.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),i.stRotation=J.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=J.getValueOrDefault(t.closeTop,Be.MINIMUM_VALUE,!0),i.closeBottom=J.getValueOrDefault(t.closeBottom,Be.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=J.getValueOrDefault(t.arcType,Be.MINIMUM_VALUE,en.GEODESIC),i.textureCoordinates=J.getValueOrUndefined(t.textureCoordinates,Be.MINIMUM_VALUE),a=Yn.getGeometryExtrudedHeight(a,c),a===Yn.CLAMP_TO_GROUND){let h=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,gpe);a=di.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};Hd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};Hd.DynamicGeometryUpdater=TV;function TV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(TV.prototype=Object.create(oi.prototype),TV.prototype.constructor=TV);TV.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||oi.prototype._isHidden.call(this,e,t,n)};TV.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=J.getValueOrUndefined(t.hierarchy,n);let o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Je.NONE),s=J.getValueOrDefault(t.extrudedHeightReference,n,Je.NONE),a=J.getValueOrUndefined(t.extrudedHeight,n),c=J.getValueOrUndefined(t.perPositionHeight,n);o=Yn.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,_t(mpe)),r!==Je.NONE&&c&&(o=void 0,_t(hpe))):(l(a)&&!l(o)&&(o=0),d=Yn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=J.getValueOrUndefined(t.granularity,n),i.stRotation=J.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=J.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=J.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=J.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=J.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=J.getValueOrDefault(t.arcType,n,en.GEODESIC),a=Yn.getGeometryExtrudedHeight(a,s),a===Yn.CLAMP_TO_GROUND){let u=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,gpe);a=di.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var zv=Hd;var n0i=T(S(),1);var ype=new B;function fnt(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Df(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new fnt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Df.prototype=Object.create(ri.prototype),Df.prototype.constructor=Df);Df.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Dt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,ype)),l(c)||(c=B.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Et({id:t,geometry:new hI(this._options),attributes:i})};Df.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,ype),o=this._distanceDisplayConditionProperty.getValue(e);return new Et({id:t,geometry:new bI(this._options),attributes:{show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Df.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ri.prototype._isHidden.call(this,e,t)};Df.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!J.isConstant(t.granularity)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.cornerType)};Df.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Dt;o.vertexFormat=r?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Be.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Be.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Be.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Be.MINIMUM_VALUE):void 0};Df.DynamicGeometryUpdater=SV;function SV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(SV.prototype=Object.create(oi.prototype),SV.prototype.constructor=SV);SV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||oi.prototype._isHidden.call(this,e,t,n)};SV.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=J.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=J.getValueOrUndefined(t.shape,n),i.granularity=J.getValueOrUndefined(t.granularity,n),i.cornerType=J.getValueOrUndefined(t.cornerType,n)};var Kv=Df;var Z0i=T(S(),1);var xpe=new B,_pe=m.ZERO,Tpe=new m,Spe=new ce,pnt=new ce,bnt=new he;function gnt(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Gh(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new gnt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Gh.prototype=Object.create(Yn.prototype),Gh.prototype.constructor=Gh);Gh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,xpe)),l(o)||(o=B.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,_pe,Tpe))),new Et({id:t,geometry:new n_(this._options),attributes:i})};Gh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,xpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,_pe,Tpe))),new Et({id:t,geometry:new i_(this._options),attributes:r})};Gh.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.rectangle.coordinates,e,pnt);if(!l(n))return;let i=ce.center(n,bnt);return he.toCartesian(i,ne.default,t)};Gh.prototype._isHidden=function(e,t){return!l(t.coordinates)||ri.prototype._isHidden.call(this,e,t)};Gh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.stRotation)||!J.isConstant(t.rotation)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.zIndex)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Gh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Dt,i=J.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),o=J.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Je.NONE),r=J.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),s=J.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Je.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Be.MINIMUM_VALUE,a.rectangle),a.granularity=J.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),a.stRotation=J.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),a.rotation=J.getValueOrUndefined(t.rotation,Be.MINIMUM_VALUE),a.offsetAttribute=Yn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Yn.getGeometryHeight(i,o),r=Yn.getGeometryExtrudedHeight(r,s),r===Yn.CLAMP_TO_GROUND&&(r=di.getMinimumMaximumHeights(n_.computeRectangle(a,Spe)).minimumTerrainHeight),a.extrudedHeight=r};Gh.DynamicGeometryUpdater=CV;function CV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(CV.prototype=Object.create(oi.prototype),CV.prototype.constructor=CV);CV.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||oi.prototype._isHidden.call(this,e,t,n)};CV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Je.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,Je.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=J.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=J.getValueOrUndefined(t.granularity,n),i.stRotation=J.getValueOrUndefined(t.stRotation,n),i.rotation=J.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=di.getMinimumMaximumHeights(n_.computeRectangle(i,Spe)).minimumTerrainHeight),i.extrudedHeight=s};var Jv=Gh;var O0i=T(S(),1);var Cpe=new B;function ynt(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Eh(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new ynt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Eh.prototype=Object.create(ri.prototype),Eh.prototype.constructor=Eh);Eh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Dt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Cpe)),l(c)||(c=B.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Et({id:t,geometry:new RI(this._options),attributes:i})};Eh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Cpe),o=this._distanceDisplayConditionProperty.getValue(e);return new Et({id:t,geometry:new GI(this._options),attributes:{show:new _n(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Eh.prototype._isHidden=function(e,t){return!l(t.positions)||ri.prototype._isHidden.call(this,e,t)};Eh.prototype._getIsClosed=function(e){return!1};Eh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!J.isConstant(t.minimumHeights)||!J.isConstant(t.maximumHeights)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.granularity)};Eh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Dt,s=this._options;s.vertexFormat=r?dn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Be.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Be.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Be.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Be.MINIMUM_VALUE):void 0};Eh.DynamicGeometryUpdater=VV;function VV(e,t,n){oi.call(this,e,t,n)}l(Object.create)&&(VV.prototype=Object.create(oi.prototype),VV.prototype.constructor=VV);VV.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||oi.prototype._isHidden.call(this,e,t,n)};VV.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=J.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=J.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=J.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=J.getValueOrUndefined(t.granularity,n)};var Qv=Eh;var wT=[UX,Pv,Rv,Bv,Yv,Hv,zv,Kv,Jv,Qv];function FT(e,t){this.entity=e,this.scene=t;let n=new Array(wT.length),i=new be,o=new ar;for(let r=0;r<n.length;r++){let s=new wT[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(FT.prototype._onEntityPropertyChanged,this)}FT.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};FT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};FT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),me(this)};FT.registerUpdater=function(e){wT.includes(e)||wT.push(e)};FT.unregisterUpdater=function(e){if(wT.includes(e)){let t=wT.indexOf(e);wT.splice(t,1)}};var AT=FT;var Tgi=T(S(),1);var Vpe=new B,xnt=new wt,_nt=new wt,Tnt=m.ZERO,Snt=new m;function Ih(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.updaters=new Gt,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.subscriptions=new Gt,this.showsUpdated=new Gt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Ih.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Ih.prototype.onMaterialChanged=function(){this.invalidated=!0};Ih.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Ih.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!J.isConstant(e.distanceDisplayConditionProperty)||!J.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Ih.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Ih.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Dt)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.fillMaterialProperty.isConstant||c){let _=d.fillMaterialProperty.color,C=J.getValueOrDefault(_,e,B.WHITE,Vpe);B.equals(h._lastColor,C)||(h._lastColor=B.clone(C,h._lastColor),h.color=Yt.toValue(C,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Dt&&(!d.depthFailMaterialProperty.isConstant||c)){let _=d.depthFailMaterialProperty.color,C=J.getValueOrDefault(_,e,B.WHITE,Vpe);B.equals(h._lastDepthFailColor,C)||(h._lastDepthFailColor=B.clone(C,h._lastDepthFailColor),h.depthFailColor=Yt.toValue(C,h.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=_n.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!J.isConstant(f)){let _=J.getValueOrDefault(f,e,_nt,xnt);wt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=wt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Un.toValue(_,h.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!J.isConstant(x)){let _=J.getValueOrDefault(x,e,Tnt,Snt);m.equals(_,h._lastOffset)||(h._lastOffset=m.clone(_,h._lastOffset),h.offset=$i.toValue(_,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Ih.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=_n.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Ih.prototype.contains=function(e){return this.updaters.contains(e.id)};Ih.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return dt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?dt.FAILED:(i.boundingSphere.clone(t),dt.DONE)};Ih.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function LV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}LV.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Ih(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Lpe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}LV.prototype.remove=function(e){Lpe(this._solidItems,e)||Lpe(this._translucentItems,e)};function Rpe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function VU(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d<c;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}LV.prototype.update=function(e){let t=VU(this,this._solidItems,e,!0);t=VU(this,this._translucentItems,e,t)&&t;let n=Rpe(this,this._solidItems,e),i=Rpe(this,this._translucentItems,e);return(n||i)&&(t=VU(this,this._solidItems,e,t)&&t,t=VU(this,this._translucentItems,e,t)&&t),t};function Zpe(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return dt.FAILED}LV.prototype.getBoundingSphere=function(e,t){let n=Zpe(this._solidItems,e,t);return n===dt.FAILED?Zpe(this._translucentItems,e,t):n};function Gpe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}LV.prototype.removeAllPrimitives=function(){Gpe(this._solidItems),Gpe(this._translucentItems)};var cm=LV;var Agi=T(S(),1);var Cnt=new wt,Vnt=new wt,Lnt=m.ZERO,Rnt=new m;function Xh(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Gt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Xh.prototype.onMaterialChanged,this),this.subscriptions=new Gt,this.showsUpdated=new Gt}Xh.prototype.onMaterialChanged=function(){this.invalidated=!0};Xh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};Xh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!J.isConstant(t.distanceDisplayConditionProperty)||!J.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Xh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Znt=new B;Xh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Dt)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Dt&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,C=J.getValueOrDefault(_,e,B.WHITE,Znt);B.equals(h._lastDepthFailColor,C)||(h._lastDepthFailColor=B.clone(C,h._lastDepthFailColor),h.depthFailColor=Yt.toValue(C,h.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=_n.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!J.isConstant(f)){let _=J.getValueOrDefault(f,e,Vnt,Cnt);wt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=wt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Un.toValue(_,h.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!J.isConstant(x)){let _=J.getValueOrDefault(x,e,Lnt,Rnt);m.equals(_,h._lastOffset)||(h._lastOffset=m.clone(_,h._lastOffset),h.offset=$i.toValue(_,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Xh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=_n.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Xh.prototype.contains=function(e){return this.updaters.contains(e.id)};Xh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return dt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?dt.FAILED:(i.boundingSphere.clone(t),dt.DONE)};Xh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function RV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}RV.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new Xh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};RV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};RV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};RV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return dt.FAILED};RV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var lm=RV;var Qgi=T(S(),1);var Gnt=new B,Ent=new wt,Int=new wt;function a0(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.updaters=new Gt,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.subscriptions=new Gt,this.showsUpdated=new Gt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new t_}a0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};a0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!J.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};a0.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};a0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new qc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.fillMaterialProperty.isConstant||c){let x=d.fillMaterialProperty.color,_=J.getValueOrDefault(x,e,B.WHITE,Gnt);B.equals(h._lastColor,_)||(h._lastColor=B.clone(_,h._lastColor),h.color=Yt.toValue(_,h.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=_n.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!J.isConstant(f)){let x=J.getValueOrDefault(f,e,Int,Ent);wt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=wt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Un.toValue(x,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};a0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=_n.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};a0.prototype.contains=function(e){return this.updaters.contains(e.id)};a0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return dt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),dt.DONE):dt.FAILED};a0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function ZV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}ZV.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=J.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new a0(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};ZV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};ZV.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let d=0;d<c;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};ZV.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return dt.FAILED};ZV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var GV=ZV;var dyi=T(S(),1);var Xnt=new wt,Wnt=new wt;function dm(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Gt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.material=void 0,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(dm.prototype.onMaterialChanged,this),this.subscriptions=new Gt,this.showsUpdated=new Gt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new t_}dm.prototype.onMaterialChanged=function(){this.invalidated=!0};dm.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};dm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Dt&&t instanceof Dt?!0:l(t)&&t.equals(n)};dm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!J.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};dm.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};dm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material),n=new qc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=_n.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!J.isConstant(f)){let x=J.getValueOrDefault(f,e,Wnt,Xnt);wt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=wt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Un.toValue(x,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};dm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=_n.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};dm.prototype.contains=function(e){return this.updaters.contains(e.id)};dm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return dt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?dt.FAILED:(i.boundingSphere.clone(t),dt.DONE)};dm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function EV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}EV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Ld.shouldUseSphericalCoordinates(o.geometry.rectangle),s=J.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let d=n[c];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new dm(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};EV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};EV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};EV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return dt.FAILED};EV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var jv=EV;var Lyi=T(S(),1);var Pnt=new B,vnt=new wt,wnt=new wt,Fnt=m.ZERO,Ant=new m;function c0(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.updaters=new Gt,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.itemsToRemove=[],this.subscriptions=new Gt,this.showsUpdated=new Gt}c0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!J.isConstant(e.distanceDisplayConditionProperty)||!J.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};c0.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};c0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new dn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.outlineColorProperty.isConstant||c){let _=d.outlineColorProperty,C=J.getValueOrDefault(_,e,B.WHITE,Pnt);B.equals(h._lastColor,C)||(h._lastColor=B.clone(C,h._lastColor),h.color=Yt.toValue(C,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),g=h.show[0]===1;p!==g&&(h.show=_n.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!J.isConstant(f)){let _=J.getValueOrDefault(f,e,wnt,vnt);wt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=wt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Un.toValue(_,h.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!J.isConstant(x)){let _=J.getValueOrDefault(x,e,Fnt,Ant);m.equals(_,h._lastOffset)||(h._lastOffset=m.clone(_,h._lastOffset),h.offset=$i.toValue(_,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};c0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=_n.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};c0.prototype.contains=function(e){return this.updaters.contains(e.id)};c0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return dt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?dt.FAILED:(i.boundingSphere.clone(t),dt.DONE)};c0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function IV(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Gt,this._translucentBatches=new Gt}IV.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new c0(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new c0(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};IV.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};IV.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,d,u=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(h=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(h=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(h);return u};IV.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return dt.FAILED};IV.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var XV=IV;var Mnt=[];function Jl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Gt,this._removedObjects=new Gt,this._changedObjects=new Gt;let o=Tn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=$o.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new XV(n,e,s,!1),this._outlineBatches[o+s]=new XV(n,e,s,!0),this._closedColorBatches[s]=new cm(n,dn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new cm(n,dn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new lm(n,ao,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new lm(n,ao,void 0,!0,s,!1),this._openColorBatches[s]=new cm(n,dn,void 0,!1,s,!0),this._openColorBatches[o+s]=new cm(n,dn,void 0,!1,s,!1),this._openMaterialBatches[s]=new lm(n,ao,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new lm(n,ao,void 0,!1,s,!1);let a=Dn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new jv(i,s,ao)),c[s]=new GV(i,s);else for(s=0;s<a;++s)c[s]=new GV(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new vT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Gt,this._updaterSets=new Gt,this._entityCollection=t,t.collectionChanged.addEventListener(Jl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Mnt)}Jl.registerUpdater=function(e){AT.registerUpdater(e)};Jl.unregisterUpdater=function(e){AT.unregisterUpdater(e)};Jl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u,h=this;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(x){h._removeUpdater(x),h._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new AT(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(x){h._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Jl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a<f;a++)p=g[a].update(e)&&p;return p};var Nnt=[],knt=new le;Jl.prototype.getBoundingSphere=function(e,t){let n=Nnt,i=knt,o=0,r=dt.DONE,s=this._batches,a=s.length,c=e.id,d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let h=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===dt.PENDING)return dt.PENDING;r===dt.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?dt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),dt.DONE)};Jl.prototype.isDestroyed=function(){return!1};Jl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Jl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),me(this)};Jl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Jl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Tn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Dt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Dt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Dt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Jl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Jl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var qv=Jl;var lxi=T(S(),1);var Unt=1,Dnt="30px sans-serif",Bnt=Do.FILL,Ont=B.WHITE,Ynt=B.BLACK,Hnt=1,znt=!1,Knt=new B(.165,.165,.165,.8),Jnt=new D(7,5),Qnt=D.ZERO,jnt=m.ZERO,qnt=Je.NONE,$nt=_i.CENTER,eit=An.CENTER,tit=new m,nit=new B,iit=new B,oit=new B,rit=new D,sit=new m,ait=new D,cit=new kt,lit=new kt,dit=new kt,uit=new wt;function Epe(e){this.entity=e,this.label=void 0,this.index=void 0}function py(e,t){t.collectionChanged.addEventListener(py.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}py.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,d=r.label,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;if(u&&(h=J.getValueOrUndefined(s._position,e,tit),c=J.getValueOrUndefined(a._text,e),u=l(h)&&l(c)),!u){zQ(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=J.getValueOrDefault(a._heightReference,e,qnt);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=m.equals(d.position,h)&&d.heightReference===g),d.show=!0,d.position=h,d.text=c,d.scale=J.getValueOrDefault(a._scale,e,Unt),d.font=J.getValueOrDefault(a._font,e,Dnt),d.style=J.getValueOrDefault(a._style,e,Bnt),d.fillColor=J.getValueOrDefault(a._fillColor,e,Ont,nit),d.outlineColor=J.getValueOrDefault(a._outlineColor,e,Ynt,iit),d.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,Hnt),d.showBackground=J.getValueOrDefault(a._showBackground,e,znt),d.backgroundColor=J.getValueOrDefault(a._backgroundColor,e,Knt,oit),d.backgroundPadding=J.getValueOrDefault(a._backgroundPadding,e,Jnt,rit),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,Qnt,ait),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,jnt,sit),d.heightReference=g,d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,$nt),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,eit),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,cit),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,lit),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,dit),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,uit),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};py.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return dt.FAILED;let i=n.label;return t.center=m.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,dt.DONE};py.prototype.isDestroyed=function(){return!1};py.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(py.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return me(this)};py.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Epe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Epe(r)):(zQ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],zQ(s.get(r.id),r,a),s.remove(r.id)};function zQ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var $v=py;var Ixi=T(S(),1);var mit=1,hit=!0,fit=0,pit=!0,bit=!0,git=Tn.ENABLED,yit=Je.NONE,xit=B.RED,_it=0,Tit=B.WHITE,Sit=Tc.HIGHLIGHT,Cit=.5,Vit=new D(1,1),Ipe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Lit=new A,Rit=new A,Xpe=new B,Wpe=new Array(4),Zit=new m;function by(e,t){t.collectionChanged.addEventListener(by.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Gt,this._onCollectionChanged(t,t.values,[],[])}async function Git(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await fh.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}by.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;if(u&&(h=s.computeModelMatrix(e,Lit),c=Ze.createIfNeeded(J.getValueOrUndefined(a._uri,e)),u=l(h)&&l(c)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!l(d)||c.url!==d.url){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Ipe}},n[s.id]=d;let f=J.getValueOrDefault(a._incrementallyLoadTextures,e,pit),x=J.getValueOrDefault(a._environmentMapOptions,e,Ipe,d.environmentMapOptionsScratch);Git(this,s,c,f,x)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=J.getValueOrDefault(a._scale,e,mit),p.enableVerticalExaggeration=J.getValueOrDefault(a._enableVerticalExaggeration,e,hit),p.minimumPixelSize=J.getValueOrDefault(a._minimumPixelSize,e,fit),p.maximumScale=J.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=A.clone(h,p.modelMatrix),p.shadows=J.getValueOrDefault(a._shadows,e,git),p.heightReference=J.getValueOrDefault(a._heightReference,e,yit),p.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=J.getValueOrDefault(a._silhouetteColor,e,xit,Xpe),p.silhouetteSize=J.getValueOrDefault(a._silhouetteSize,e,_it),p.color=J.getValueOrDefault(a._color,e,Tit,Xpe),p.colorBlendMode=J.getValueOrDefault(a._colorBlendMode,e,Sit),p.colorBlendAmount=J.getValueOrDefault(a._colorBlendAmount,e,Cit),p.clippingPlanes=J.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=J.getValueOrDefault(a._clampAnimations,e,bit),p.imageBasedLighting.imageBasedLightingFactor=J.getValueOrDefault(a._imageBasedLightingFactor,e,Vit);let g=J.getValueOrUndefined(a._lightColor,e);if(l(g)&&(B.pack(g,Wpe,0),g=m.unpack(Wpe,0,Zit)),p.lightColor=g,p.customShader=J.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let f=J.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:Ol.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let x=J.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(x)){let V=Object.keys(x);for(let L=0,R=V.length;L<R;++L){let G=V[L],I=x[G];if(!l(I))continue;let v=p.getNode(G);if(!l(v))continue;let P=A.fromTranslationRotationScale(I,Rit);v.matrix=A.multiply(v.originalMatrix,P,P)}}let _=!1,C=J.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(C)){let V=Object.keys(C);for(let L=0,R=V.length;L<R;++L){let G=V[L],I=C[G];l(I)&&(_=!0,p.setArticulationStage(G,I))}}_&&p.applyArticulations()}}return!0};by.prototype.isDestroyed=function(){return!1};by.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(by.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)KQ(this,e[i],t,n);return me(this)};var LU=new m,Eit=new he;by.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return dt.FAILED;if(n.loadFailed)return dt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return dt.PENDING;if(!i.ready||!n.modelUpdated)return dt.PENDING;let o=this._scene,r=y(o.ellipsoid,ne.default);if(i.heightReference!==Je.NONE){let a=i.modelMatrix;LU.x=a[12],LU.y=a[13],LU.z=a[14];let c=r.cartesianToCartographic(LU,Eit),d=o.getHeight(c,i.heightReference);return l(d)&&(Mu(i.heightReference)?c.height=d:c.height+=d),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),dt.DONE}return le.clone(i.boundingSphere,t),dt.DONE};by.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(Iit(r,a),s.set(r.id,r)):(KQ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],KQ(this,r,a,c),s.remove(r.id)};function KQ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Iit(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var ew=by;var a_i=T(S(),1);var Mxi=T(S(),1);function gy(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(gy.prototype,{isConstant:{get:function(){return J.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ui.FIXED}}});var Xit=new q;gy.prototype.getValue=function(e,t){return l(e)||(e=q.now(Xit)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};gy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};gy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};gy.prototype.equals=function(e){return this===e||e instanceof gy&&this._value===e._value};gy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Bf=gy;var Wit=60,Pit=1,vpe=new Ln,JQ=new Ln,QQ=new Ln;function Ppe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function vit(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let h=!l(o)||q.lessThanOrEquals(o,t)||q.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p<g;){if(!h&&q.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[d]),l(u)&&(c[d++]=u),h=!0),q.greaterThan(f,t)&&q.lessThan(f,x)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[d]),l(u)&&(c[d++]=u)),p<g-1){if(s>0&&!_){let R=i[p+1],G=q.secondsDifference(R,f);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V<C){f=q.addSeconds(f,L,new q),V++;continue}}_=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[d]),l(u)&&(c[d++]=u),d}function wit(e,t,n,i,o,r,s,a){let c,d=0,u=s,h=t,p=!l(i)||q.lessThanOrEquals(i,t)||q.greaterThanOrEquals(i,n);for(;q.lessThan(h,n);)!p&&q.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(h,o,a[u]),l(c)&&(a[u]=c,u++),d++,h=q.addSeconds(t,r*d,new q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Fit(e,t,n,i,o,r,s,a){let c,d=0,u=s,h=t,p=Math.max(r,60),g=!l(i)||q.lessThanOrEquals(i,t)||q.greaterThanOrEquals(i,n);for(;q.lessThan(h,n);)!g&&q.greaterThanOrEquals(h,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(h,o,a[u]),l(c)&&(a[u]=c,u++),d++,h=q.addSeconds(t,p*d,new q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Ait(e,t,n,i,o,r,s,a){QQ.start=t,QQ.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let h=d.get(u);if(!Ln.intersect(h,QQ,vpe).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=q.addSeconds(h.start,q.secondsDifference(h.stop,h.start)/2,new q));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function Mit(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Nit(e,t,n,i,o,r,s,a){JQ.start=t,JQ.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let h=d.get(u);if(!Ln.intersect(h,JQ,vpe).isEmpty){let p=h.start,g=h.stop,f=t;q.greaterThan(p,f)&&(f=p);let x=n;q.lessThan(g,x)&&(x=g),c=wpe(h.data,f,x,i,o,r,c,a)}}return c}function wpe(e,t,n,i,o,r,s,a){for(;e instanceof n0;)e=e.resolvedProperty;if(e instanceof ga){let c=e._property._times;s=vit(e,t,n,c,i,o,r,s,a)}else e instanceof DX?s=wit(e,t,n,i,o,r,s,a):e instanceof ba?s=Nit(e,t,n,i,o,r,s,a):e instanceof i0?s=Ait(e,t,n,i,o,r,s,a):e instanceof $c||e instanceof Bf&&J.isConstant(e)?s=Mit(e,t,n,i,o,r,s,a):s=Fit(e,t,n,i,o,r,s,a);return s}function Fpe(e,t,n,i,o,r,s){l(s)||(s=[]);let a=wpe(e,t,n,i,o,r,0,s);return s.length=a,s}var kit=new $;function tw(e,t){this._unusedIndexes=[],this._polylineCollection=new gh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}tw.prototype.update=function(e){if(this._referenceFrame===Ui.INERTIAL){let t=Pt.computeIcrfToCentralBodyFixedMatrix(e,kit);A.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};tw.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let h=J.getValueOrUndefined(i._leadTime,e),p=J.getValueOrUndefined(i._trailTime,e),g=n._availability,f=l(g),x=l(h),_=l(p);if(d=f||x&&_,d){if(_&&(r=q.addSeconds(e,-p,new q)),x&&(s=q.addSeconds(e,h,new q)),f){let C=g.start,V=g.stop;(!_||q.greaterThan(C,r))&&(r=C),(!x||q.lessThan(V,s))&&(s=V)}d=q.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let h=this._unusedIndexes;if(h.length>0){let g=h.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=J.getValueOrDefault(i._resolution,e,Wit);c.show=!0,c.positions=Fpe(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=qo.getValue(e,i._material,c.material),c.width=J.getValueOrDefault(i._width,e,Pit),c.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};tw.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};tw.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function yy(e,t){t.collectionChanged.addEventListener(yy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}yy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,d=Ui.FIXED;this._scene.mode===oe.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(c===u&&l(u)){u.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(u)||(u=new tw(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,l(u)&&u.updateObject(e,r)}return!0};yy.prototype.isDestroyed=function(){return!1};yy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(yy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return me(this)};yy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Ppe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Ppe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};yy._subSample=Fpe;var nw=yy;var T_i=T(S(),1);var Ape=B.WHITE,Mpe=B.BLACK,Npe=0,kpe=1,Upe=0,Dpe=kr.NONE,Bpe=new B,Uit=new m,Ope=new B,Ype=new kt,Hpe=new kt,zpe=new wt;function Kpe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function xy(e,t){t.collectionChanged.addEventListener(xy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}xy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=J.getValueOrDefault(a._heightReference,e,Je.NONE),h=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),p;if(h&&(p=J.getValueOrUndefined(s._position,e,Uit),h=l(p)),!h){iw(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,f=!1;if(u!==Je.NONE&&!l(d)?(l(c)&&(iw(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,g=!0,f=m.equals(d.position,p)&&d.heightReference===u):u===Je.NONE&&!l(c)&&(l(d)&&(iw(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,Ype),c.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Hpe),c.color=J.getValueOrDefault(a._color,e,Ape,Bpe),c.outlineColor=J.getValueOrDefault(a._outlineColor,e,Mpe,Ope),c.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,Npe),c.pixelSize=J.getValueOrDefault(a._pixelSize,e,kpe),c.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,zpe),c.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,Upe),c.splitDirection=J.getValueOrDefault(a._splitDirection,e,Dpe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,Ype),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Hpe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,zpe),d.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,Upe),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,Dpe),d.heightReference=u;let x=J.getValueOrDefault(a._color,e,Ape,Bpe),_=J.getValueOrDefault(a._outlineColor,e,Mpe,Ope),C=Math.round(J.getValueOrDefault(a._outlineWidth,e,Npe)),V=Math.max(1,Math.round(J.getValueOrDefault(a._pixelSize,e,kpe)));if(C>0?(d.scale=1,g=g||C!==r.outlineWidth||V!==r.pixelSize||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)):(d.scale=V/50,V=50,g=g||C!==r.outlineWidth||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)),g){r.color=B.clone(x,r.color),r.outlineColor=B.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,R=x.toCssColorString(),G=_.toCssColorString(),I=JSON.stringify([R,V,G,C]);d.setImage(I,pT(L,R,G,C,V))}f&&d._updateClamping()}}return!0};xy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return dt.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return dt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,dt.DONE};xy.prototype.isDestroyed=function(){return!1};xy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(xy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return me(this)};xy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new Kpe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Kpe(r)):(iw(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],iw(s.get(r.id),r,a),s.remove(r.id)};function iw(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var ow=xy;var PTi=T(S(),1);var q_i=T(S(),1);var Dit=new Qn(0),RU={},Jpe=new B,Bit=new Dt(B.WHITE),Oit=new Qn(!0),Yit=new Qn(Tn.DISABLED),Hit=new Qn(new wt),zit=new Qn(Dn.BOTH);function Kit(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Jit(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Wh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Wh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Kit,this._groundGeometryOptions=new Jit,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=$o.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Wh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&J.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Wh.prototype.isOutlineVisible=function(e){return!1};Wh.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};Wh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new _n(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Dt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Jpe)),l(a)||(a=B.WHITE),s.color=Yt.fromColor(a)),this.clampToGround?new Et({id:t,geometry:new zx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Dt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Jpe)),l(a)||(a=B.WHITE),s.depthFailColor=Yt.fromColor(a)),new Et({id:t,geometry:new $p(this._geometryOptions),attributes:s}))};Wh.prototype.createOutlineGeometryInstance=function(e){};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){this._entitySubscription(),me(this)};Wh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(Be.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,Bit),d=c instanceof Dt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,Oit),this._shadowsProperty=y(o.shadows,Yit),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,Hit),this._classificationTypeProperty=y(o.classificationType,zit),this._fillEnabled=!0,this._zIndex=y(a,Dit);let u=o.width,h=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!J.isConstant(u)||!J.isConstant(h)||!J.isConstant(g)||!J.isConstant(p)||!J.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,x=r.getValue(Be.MINIMUM_VALUE,f.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Dt)?_=es.VERTEX_FORMAT:_=ua.VERTEX_FORMAT,f.vertexFormat=_,f.positions=x,f.width=l(u)?u.getValue(Be.MINIMUM_VALUE):void 0,f.arcType=l(h)?h.getValue(Be.MINIMUM_VALUE):void 0,f.granularity=l(g)?g.getValue(Be.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=x,C.width=f.width,C.arcType=f.arcType,C.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(Be.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&_t("Entity polylines must have clampToGround: true when using zIndex.  zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Wh.prototype.createDynamicUpdater=function(e,t){return new rw(e,t,this)};var WV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function rw(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Qpe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=RU[n];!l(i)||i.isDestroyed()?(i=new gh,RU[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}rw.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=J.getValueOrUndefined(o,e,this._positions);t._clampToGround=J.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=J.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=J.getValueOrDefault(i._arcType,e,en.GEODESIC),t._groundGeometryOptions.granularity=J.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Dt)p=new es;else{let g=qo.getValue(e,h,this._material);p=new ua({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Jm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),J.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Qpe(this);if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=en.GEODESIC;c=J.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==en.NONE&&l(d)&&(WV.ellipsoid=u,WV.positions=r,WV.granularity=J.getValueOrUndefined(i._granularity,e),WV.height=vi.extractHeights(r,u),c===en.GEODESIC?r=vi.generateCartesianArc(WV):r=vi.generateCartesianRhumbArc(WV)),a.show=!0,a.positions=r.slice(),a.material=qo.getValue(e,t.fillMaterialProperty,a.material),a.width=J.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};rw.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return le.clone(n.boundingSphere,e),dt.DONE}return l(t)&&!t.ready?dt.PENDING:dt.DONE}else{let t=Qpe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),dt.DONE}return dt.FAILED};rw.prototype.isDestroyed=function(){return!1};rw.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=RU[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete RU[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var sw=Wh;var pTi=T(S(),1);var Qit=new B,jit=new wt,qit=new wt;function Ph(e,t,n,i,o){let r;n instanceof Dt?r=es:r=ua,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Gt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.material=void 0,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ph.prototype.onMaterialChanged,this),this.subscriptions=new Gt,this.showsUpdated=new Gt,this.zIndex=i,this._asynchronous=o}Ph.prototype.onMaterialChanged=function(){this.invalidated=!0};Ph.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Dt&&t instanceof Dt?!0:l(t)&&t.equals(n)};Ph.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!J.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ph.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Ph.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Jm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ua&&(this.material=qo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ua&&(this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,_=J.getValueOrDefault(x,e,B.WHITE,Qit);B.equals(h._lastColor,_)||(h._lastColor=B.clone(_,h._lastColor),h.color=Yt.toValue(_,h.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=_n.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!J.isConstant(f)){let x=J.getValueOrDefault(f,e,qit,jit);wt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=wt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Un.toValue(x,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ph.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=_n.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ph.prototype.contains=function(e){return this.updaters.contains(e.id)};Ph.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return dt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?dt.FAILED:(i.boundingSphere.clone(t),dt.DONE)};Ph.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function PV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}PV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=J.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Ph(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};PV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};PV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};PV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return dt.FAILED};PV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var aw=PV;var $it=[];function jpe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function qpe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Dt?1:2);let r;l(i)&&(r=i+o*Tn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Dt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Of(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Gt,this._removedObjects=new Gt,this._changedObjects=new Gt;let o,r=Tn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new cm(n,es,void 0,!1,o),this._materialBatches[o]=new lm(n,ua,void 0,!1,o),this._colorBatches[o+r]=new cm(n,es,es,!1,o),this._materialBatches[o+r]=new lm(n,ua,es,!1,o),this._colorBatches[o+r*2]=new cm(n,es,ua,!1,o),this._materialBatches[o+r*2]=new lm(n,ua,ua,!1,o);this._dynamicBatch=new vT(n,i);let s=Dn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new aw(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Gt,this._updaters=new Gt,this._entityCollection=t,t.collectionChanged.addEventListener(Of.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,$it)}Of.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(jpe(this,u),qpe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),jpe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new sw(c,this._scene),this._updaters.set(d,u),qpe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Of._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)h=p[a].update(e)&&h;return h};var eot=[],tot=new le;Of.prototype.getBoundingSphere=function(e,t){let n=eot,i=tot,o=0,r=dt.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===dt.PENDING)return dt.PENDING;r===dt.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?dt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),dt.DONE)};Of.prototype.isDestroyed=function(){return!1};Of.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Of.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),me(this)};Of._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Of.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var cw=Of;function Ql(e){qc.initializeTerrainHeights(),Jm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new ar,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Ql.defaultVisualizersCallback);let i=!1,o=new ul,r=new ul;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new Wv;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var vV=[];Ql.registerVisualizer=function(e){vV.includes(e)||vV.push(e)};Ql.unregisterVisualizer=function(e){if(vV.includes(e)){let t=vV.indexOf(e);vV.splice(t,1)}};Ql.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new AI(t,i),new qv(e,i,n._primitives,n._groundPrimitives),new $v(t,i),new ew(e,i),new Vv(e,i),new ow(t,i),new nw(e,i),new cw(e,i,n._primitives,n._groundPrimitives),...vV.map(o=>new o(e,i))]};Object.defineProperties(Ql.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Ql.prototype.isDestroyed=function(){return!1};Ql.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),me(this)};Ql.prototype.update=function(e){if(!di.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Ql.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var not=[],iot=new le;Ql.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return dt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return dt.FAILED;let s=not,a=iot,c=0,d=dt.DONE,u=r._visualizers,h=u.length;for(i=0;i<h;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===dt.PENDING)return dt.PENDING;d===dt.DONE&&(s[c]=le.clone(a,s[c]),c++)}}return c===0?dt.FAILED:(s.length=c,le.fromBoundingSpheres(s,n),dt.DONE)};Ql.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new ul),s=o.add(new Dv);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Ql.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Ql.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var lw=Ql;var gSi=T(S(),1);var $pe=new $,ebe=new $,tbe=new $,oot=new A,ZU=new m,nbe=new m,jQ=new m,qQ=new m,ibe=new m,obe=new m,rot=new ve,sot=new m,aot=new $,wV=new q,cot=1.25;function lot(e,t,n,i,o,r,s,a,c,d){let u=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,g=!1,f,x,_;if(u===oe.SCENE3D){q.addSeconds(c,.001,wV);let v=o.getValue(wV,ZU);if(l(v)||(q.addSeconds(c,-.001,wV),v=o.getValue(wV,ZU),g=!0),l(v)){let P=Pt.computeFixedToIcrfMatrix(c,$pe),w=Pt.computeFixedToIcrfMatrix(wV,ebe),M;!l(P)||!l(w)?(M=Pt.computeTemeToPseudoFixedMatrix(c,tbe),P=$.transpose(M,$pe),w=Pt.computeTemeToPseudoFixedMatrix(wV,ebe),$.transpose(w,w)):M=$.transpose(P,tbe);let b=$.multiplyByVector(P,h,ibe),Z=$.multiplyByVector(w,v,obe);m.subtract(b,Z,qQ);let E=m.magnitude(qQ)*1e3,X=W.GRAVITATIONALPARAMETER,F=-X/(E*E-2*X/m.magnitude(b));F<0||F>cot*d.maximumRadius?(f=nbe,m.normalize(h,f),m.negate(f,f),_=m.clone(m.UNIT_Z,jQ),x=m.cross(_,f,ZU),m.magnitude(x)>W.EPSILON7&&(m.normalize(f,f),m.normalize(x,x),_=m.cross(f,x,jQ),m.normalize(_,_),p=!0)):m.equalsEpsilon(h,v,W.EPSILON7)||(_=nbe,m.normalize(b,_),m.normalize(Z,Z),x=m.cross(_,Z,jQ),g&&(x=m.multiplyByScalar(x,-1,x)),m.equalsEpsilon(x,m.ZERO,W.EPSILON7)||(f=m.cross(x,_,ZU),$.multiplyByVector(M,f,f),$.multiplyByVector(M,x,x),$.multiplyByVector(M,_,_),m.normalize(f,f),m.normalize(x,x),m.normalize(_,_),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let C,V,L;i&&(C=m.clone(t.position,qQ),V=m.clone(t.direction,ibe),L=m.clone(t.up,obe));let R=oot,G;l(s)&&(G=s.getValue(c,rot));let I=r.getValue(c,sot);if(a===nb.INERTIAL&&l(G))A.fromTranslationQuaternionRotationScale(h,G,m.ONE,R);else if(a===nb.VELOCITY&&l(I)){let v=Pt.rotationMatrixFromPositionVelocity(h,I,d,aot);A.fromRotationTranslation(v,h,R)}else a===nb.ENU||!p?Pt.eastNorthUpToFixedFrame(h,d,R):(R[0]=f.x,R[1]=f.y,R[2]=f.z,R[3]=0,R[4]=x.x,R[5]=x.y,R[6]=x.z,R[7]=0,R[8]=_.x,R[9]=_.y,R[10]=_.z,R[11]=0,R[12]=h.x,R[13]=h.y,R[14]=h.z,R[15]=0);t._setTransform(R),i&&(m.clone(C,t.position),m.clone(V,t.direction),m.clone(L,t.up),m.cross(V,L,t.right))}if(n){let p=u===oe.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function dw(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ne.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new r0(e.position,!0),this._offset3D=new m}Object.defineProperties(dw,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});dw.defaultOffset3D=new m(-14e3,3500,3500);var GU=new Pu,dot=new m;dw.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=u||h,f=!0;if(u){let x=r.viewFrom,_=l(x);if(!_&&l(t)){GU.pitch=-W.PI_OVER_FOUR,GU.range=0;let C=a.getValue(e,dot);if(l(C)){let V=2-1/Math.max(1,m.magnitude(C)/i.maximumRadius);GU.pitch*=V}p.viewBoundingSphere(t,GU),this.boundingSphere=t,g=!1,f=!1}else(!_||!l(x.getValue(e,this._offset3D)))&&m.clone(dw._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,lot(this,p,g,f,a,c,d,s,e,i)};var uw=dw;var DCi=T(S(),1);var aCi=T(S());var LSi=T(S());var SSi=T(S());var xSi=T(S());function $Q(e){return e}function EU(e){if(e==null)return $Q;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,h=new Array(u);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;d<u;)h[d]=a[d],++d;return h}}var XSi=T(S());var ZSi=T(S());function rbe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function e4(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return sbe(e,n)})}:sbe(e,t)}function sbe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=t4(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function t4(e,t){var n=EU(e.transform),i=e.arcs;function o(u,h){h.length&&h.pop();for(var p=i[u<0?~u:u],g=0,f=p.length;g<f;++g)h.push(n(p[g],g));u<0&&rbe(h,f)}function r(u){return n(u)}function s(u){for(var h=[],p=0,g=u.length;p<g;++p)o(u[p],h);return h.length<2&&h.push(h[0]),h}function a(u){for(var h=s(u);h.length<4;)h.push(h[0]);return h}function c(u){return u.map(a)}function d(u){var h=u.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:h,coordinates:p}}return d(t)}var ASi=T(S());var PSi=T(S());var USi=T(S());var zSi=T(S());var BSi=T(S());var eCi=T(S());var QSi=T(S());function IU(e){return m.fromDegrees(e[0],e[1],e[2])}var n4={"urn:ogc:def:crs:OGC:1.3:CRS84":IU,"EPSG:4326":IU,"urn:ogc:def:crs:EPSG::4326":IU},abe={},cbe={},i4=48,o4,r4=B.ROYALBLUE,s4=B.YELLOW,a4=2,c4=B.fromBytes(255,255,0,100),l4=!1,pot={small:24,medium:48,large:64},bot=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function lbe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||bot.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${lbe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function got(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function yot(e,t){return new eh(got(lbe,e,t),!0)}function XU(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Hn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let h=u.toLowerCase();if(d>1&&h==="title"){d=1,s=u;break}else d>2&&h==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Qn(c):n(r,s))}return o}function d4(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var dbe={Feature:mbe,FeatureCollection:xot,GeometryCollection:hbe,LineString:ybe,MultiLineString:xbe,MultiPoint:bbe,MultiPolygon:Sbe,Point:pbe,Polygon:Tbe,Topology:Cbe},ube={GeometryCollection:hbe,LineString:ybe,MultiLineString:xbe,MultiPoint:bbe,MultiPolygon:Sbe,Point:pbe,Polygon:Tbe,Topology:Cbe};function mbe(e,t,n,i,o){if(t.geometry===null){XU(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=ube[r];if(!l(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function xot(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)mbe(e,r[s],void 0,i,o)}function hbe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=ube[d];if(!l(u))throw new ae(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function fbe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=B.fromCssColorString(g)),a=y(pot[c["marker-size"]],a);let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new pc;u.verticalOrigin=new Qn(An.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=Je.CLAMP_TO_GROUND);let h=XU(t,e._entityCollection,o.describe);h.billboard=u,h.position=new $c(n(i));let p=Promise.resolve(d).then(function(g){u.image=new Qn(g)}).catch(function(){u.image=new Qn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function pbe(e,t,n,i,o){fbe(e,t,i,n.coordinates,o)}function bbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)fbe(e,t,i,r[s],o)}function gbe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new Qn(u));let h,p=a.stroke;l(p)&&(h=B.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=g),l(h)&&(r=new Dt(h))}let c=XU(t,e._entityCollection,o.describe),d=new gc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new Qn(d4(i,n)),d.arcType=en.RHUMB}function ybe(e,t,n,i,o){gbe(e,t,i,n.coordinates,o)}function xbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)gbe(e,t,i,r[s],o)}function _be(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new Qn(g));let f,x=c.stroke;l(x)&&(f=B.fromCssColorString(x));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new Qn(f));let C,V=c.fill,L=s.color.getValue();l(V)&&(C=B.fromCssColorString(V),C.alpha=L.alpha),_=c["fill-opacity"],l(_)&&_!==L.alpha&&(l(C)||(C=L.clone()),C.alpha=_),l(C)&&(s=new Dt(C))}let d=new qm;d.outline=new Qn(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=en.RHUMB;let u=[];for(let g=1,f=i.length;g<f;g++)u.push(new va(d4(i[g],n)));let h=i[0];d.hierarchy=new Qn(new va(d4(h,n),u)),h[0].length>2?d.perPositionHeight=new Qn(!0):o.clampToGround||(d.height=0);let p=XU(t,e._entityCollection,o.describe);p.polygon=d}function Tbe(e,t,n,i,o){_be(e,t,i,n.coordinates,o)}function Sbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)_be(e,t,i,r[s],o)}function Cbe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=e4(n,n.objects[r]),a=dbe[s.type];a(e,s,s,i,o)}}function _y(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new js(this),this._promises=[],this._pinBuilder=new jp,this._entityCluster=new kd,this._credit=void 0,this._resourceCredits=[]}_y.load=function(e,t){return new _y().load(e,t)};Object.defineProperties(_y,{markerSize:{get:function(){return i4},set:function(e){i4=e}},markerSymbol:{get:function(){return o4},set:function(e){o4=e}},markerColor:{get:function(){return r4},set:function(e){r4=e}},stroke:{get:function(){return s4},set:function(e){s4=e}},strokeWidth:{get:function(){return a4},set:function(e){a4=e}},fill:{get:function(){return c4},set:function(e){c4=e}},clampToGround:{get:function(){return l4},set:function(e){l4=e}},crsNames:{get:function(){return n4}},crsLinkHrefs:{get:function(){return abe}},crsLinkTypes:{get:function(){return cbe}}});Object.defineProperties(_y.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});_y.prototype.load=function(e,t){return Vbe(this,e,t,!0)};_y.prototype.process=function(e,t){return Vbe(this,e,t,!1)};function Vbe(e,t,n,i){Yr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new Ct(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ze){t=Ze.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:y(n.describe,yot),markerSize:y(n.markerSize,i4),markerSymbol:y(n.markerSymbol,o4),markerColor:y(n.markerColor,r4),strokeWidthProperty:new Qn(y(n.strokeWidth,a4)),strokeMaterialProperty:new Dt(y(n.stroke,s4)),fillMaterialProperty:new Dt(y(n.fill,c4)),clampToGround:y(n.clampToGround,l4)},Promise.resolve(r).then(function(a){return _ot(e,a,n,s,i)}).catch(function(a){throw Yr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}_y.prototype.update=function(e){return!0};function _ot(e,t,n,i,o){let r;l(i)&&(r=ib(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=dbe[t.type];if(!l(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?IU:null;if(l(a)){if(!l(a.properties))throw new ae("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=n4[d.name],!l(c))throw new ae(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=abe[d.href];if(l(u)||(u=cbe[d.type]),!l(u))throw new ae(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=n4[`EPSG:${d.code}`],!l(c))throw new ae(`Unknown crs EPSG code: ${d.code}`)}else throw new ae(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Yr.setLoading(e,!1),e})})}var Ty=_y;var WLi=T(S(),1);var HVi=T(S());var IVi=T(S());var OCi=T(S()),Lbe="4.1.0";var HCi=T(S());function Tot(e){return e===void 0}function zd(e){return typeof e=="boolean"}function Rbe(e,t){for(var n in t)t.hasOwnProperty(n)&&Tot(e[n])&&(e[n]=t[n]);return e}function Zbe(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Yo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Sy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Yf(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var u1i=T(S());var qCi=T(S());var JCi=T(S()),Cy=/[A-Za-z]/,qs=/[\d]/;var Kd=/\s/,WU=/['"]/,Gbe=/[\x00-\x1F\x7F]/,Ebe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Sot=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,Cot=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Vot=Ebe+Sot+Cot,Ibe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,zCi=new RegExp("[".concat(Ebe+Ibe,"]")),u4=Vot+Ibe,vh=new RegExp("[".concat(u4,"]"));var PU=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Kd):[],o=t.split(Kd),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Kd):[],o=t.split(Kd),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var e1i=T(S());function Xbe(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},R=V,G=R.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],R=R.substr(G[0].length)),G=R.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],R=R.substr(G[0].length)),G=R.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],R=R.substr(G[0].length)),G=R.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],R=R.substr(G[0].length)),G=R.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var R=L/2,G=Math.ceil(R),I=-1*Math.floor(R),v="";return I<0&&(v=V.substr(I)),V.substr(0,G)+n+v};if(e.length<=t)return e;var c=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var h="";if(d.host&&(h+=d.host),h.length>=c)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,c+i):a(h,c).substr(0,c+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var g=c-h.length;return(h+a(p,g)).substr(0,c+i)}else h+=p;if(d.fragment){var f="#"+d.fragment;if((h+f).length>=c){if((h+f).length==t)return(h+f).substr(0,t);var x=c-h.length;return(h+a(f,x)).substr(0,c+i)}else h+=f}if(d.scheme&&d.host){var _=d.scheme+"://";if((h+_).length<c)return(_+h).substr(0,t)}if(h.length<=t)return h;var C="";return c>0&&(C=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var n1i=T(S());function Wbe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var r1i=T(S());function Pbe(e,t,n){return Zbe(e,t,n)}var vbe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new PU({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?Xbe(t,i):o==="middle"?Wbe(t,i):Pbe(t,i)},e}();var pVi=T(S());var R1i=T(S());var h1i=T(S(),1),m4=function(e,t){return m4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},m4(e,t)};function Hf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");m4(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var $s=function(){return $s=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$s.apply(this,arguments)};var p1i=T(S()),zf=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var T1i=T(S());var g1i=T(S()),Lot="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bentley|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|lipsy|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",wbe=new RegExp("^"+Lot+"$");var Rot=/[\/?#]/,Zot=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Fbe=/[?!:,.;^]/,h4=/https?:\/\//i,Abe=new RegExp("^"+h4.source,"i"),Mbe=new RegExp(Fbe.source+"$"),Got=/^(javascript|vbscript):/i,Eot=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,Iot=/^(?:\/\/)?([^/#?:]+)/;function FV(e){return Cy.test(e)}function f4(e){return Cy.test(e)||qs.test(e)||e==="+"||e==="-"||e==="."}function l0(e){return vh.test(e)}function vU(e){return e==="_"||l0(e)}function p4(e){return vh.test(e)||Zot.test(e)||Fbe.test(e)}function wU(e){return Rot.test(e)}function b4(e){return wbe.test(e.toLowerCase())}function Nbe(e){if(Got.test(e))return!1;var t=e.match(Eot);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!Cy.test(i))}function kbe(e){var t=e.match(Iot);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!b4(o)}var Xot=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,Wot=/[:/?#]/;function Ube(e){var t=e.split(Wot,1)[0];return Xot.test(t)}var Pot=/^(https?:\/\/)?(www\.)?/i,vot=/^\/\//,Dbe=function(e){Hf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Aot(n)),this.stripPrefix.scheme&&(n=wot(n)),this.stripPrefix.www&&(n=Fot(n)),this.stripTrailingSlash&&(n=Mot(n)),this.decodePercentEncoding&&(n=Not(n)),n},t}(zf);function wot(e){return e.replace(Abe,"")}function Fot(e){return e.replace(Pot,"$1")}function Aot(e){return e.replace(vot,"")}function Mot(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Not(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch{return t}}var I1i=T(S());var Bbe=/^mailto:/i,kot=new RegExp("[".concat(u4,"!#$%&'*+/=?^_`{|}~-]"));function Obe(e){return vh.test(e)}function FU(e){return kot.test(e)}function Ybe(e){var t=e.split(".").pop()||"";return b4(t)}var v1i=T(S());var Hbe=function(e){Hf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(zf);var A1i=T(S());function g4(e){return e==="_"||vh.test(e)}function zbe(e){return e.length<=140}var Kbe=["twitter","facebook","instagram","tiktok","youtube"];var D1i=T(S());var Jbe=function(e){Hf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:throw Yf(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(zf);var O1i=T(S()),Uot={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},Dot=/[-\w.]/;function y4(e){return Dot.test(e)}function Qbe(e,t){var n=Uot[t];return n.test(e)}var jbe=["twitter","instagram","soundcloud","tiktok","youtube"];var J1i=T(S());var qbe=function(e){Hf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:throw Yf(this.serviceName),new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(zf);var j1i=T(S()),Bot=/[-. ]/,Oot=/[-. ()]/,Yot=/[,;]/,Hot=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,zot=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Kot=new RegExp("^".concat(Hot.source,"|").concat(zot.source,"$"));function x4(e){return Bot.test(e)}function AU(e){return Yot.test(e)}function $be(e){var t=e.charAt(0)==="+"||Oot.test(e);return t&&Kot.test(e)}var tVi=T(S());var e0e=function(e){Hf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(zf);function i0e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],d=e.length,u=[],h=0;h<d;h++){var p=e.charAt(h);if(u.length===0)C(p);else{for(var g=u.length-1;g>=0;g--){var f=u[g];switch(f.state){case 11:v(f,p);break;case 12:P(f,p);break;case 0:V(f,p);break;case 1:L(f,p);break;case 2:R(f,p);break;case 3:G(f,p);break;case 4:I(f,p);break;case 5:w(f,p);break;case 6:M(f,p);break;case 7:b(f,p);break;case 13:Z(f,p);break;case 14:E(f,p);break;case 8:X(f,p);break;case 9:F(f,p);break;case 10:N(f,p);break;case 15:O(f,p);break;case 16:U(f,p);break;case 17:Y(f,p);break;case 18:k(f,p);break;case 19:H(f,p);break;case 20:K(f,p);break;case 21:te(f,p);break;case 22:z(f,p);break;case 23:j(f,p);break;case 24:ee(f,p);break;case 25:fe(f,p);break;case 26:Te(f,p);break;case 27:de(f,p);break;case 28:xe(f,p);break;case 29:Ce(f,p);break;case 30:Ie(f,p);break;case 31:Le(f,p);break;case 32:Oe(f,p);break;case 33:qe(f,p);break;case 34:Rt(f,p);break;case 35:Lt(f,p);break;case 36:ke(f,p);break;case 37:Ne(f,p);break;case 38:zt(f,p);break;case 39:ut(f,p);break;case 40:mt(f,p);break;case 41:Pn(f,p);break;default:Yf(f.state)}}if(h>0&&FV(p)){var x=e.charAt(h-1);!FV(x)&&!u.some(trt)&&u.push(MU(h,0))}}}for(var _=u.length-1;_>=0;_--)u.forEach(function(ge){return cn(ge)});return c;function C(ge){if(ge==="#")u.push($ot(h,28));else if(ge==="@")u.push(ert(h,30));else if(ge==="/")u.push(_4(h,11));else if(ge==="+")u.push(T4(h,37));else if(ge==="(")u.push(T4(h,32));else{if(qs.test(ge)&&(u.push(T4(h,38)),u.push(jot(h,13))),Obe(ge)){var Ve=ge.toLowerCase()==="m"?15:22;u.push(qot(h,Ve))}FV(ge)&&u.push(MU(h,0)),vh.test(ge)&&u.push(_4(h,5))}}function V(ge,Ve){Ve===":"?ge.state=2:Ve==="-"?ge.state=1:f4(Ve)||Yo(u,ge)}function L(ge,Ve){Ve==="-"||(Ve==="/"?(Yo(u,ge),u.push(_4(h,11))):f4(Ve)?ge.state=0:Yo(u,ge))}function R(ge,Ve){Ve==="/"?ge.state=3:Ve==="."?Yo(u,ge):l0(Ve)?(ge.state=5,FV(Ve)&&u.push(MU(h,0))):Yo(u,ge)}function G(ge,Ve){Ve==="/"?ge.state=4:p4(Ve)?(ge.state=10,ge.acceptStateReached=!0):cn(ge)}function I(ge,Ve){Ve==="/"?ge.state=10:l0(Ve)?(ge.state=5,ge.acceptStateReached=!0):Yo(u,ge)}function v(ge,Ve){Ve==="/"?ge.state=12:Yo(u,ge)}function P(ge,Ve){l0(Ve)?ge.state=5:Yo(u,ge)}function w(ge,Ve){Ve==="."?ge.state=7:Ve==="-"?ge.state=6:Ve===":"?ge.state=8:wU(Ve)?ge.state=10:vU(Ve)||cn(ge)}function M(ge,Ve){Ve==="-"||(Ve==="."?cn(ge):l0(Ve)?ge.state=5:cn(ge))}function b(ge,Ve){Ve==="."?cn(ge):l0(Ve)?(ge.state=5,ge.acceptStateReached=!0):cn(ge)}function Z(ge,Ve){Ve==="."?ge.state=14:Ve===":"?ge.state=8:qs.test(Ve)||(wU(Ve)?ge.state=10:vh.test(Ve)?Yo(u,ge):cn(ge))}function E(ge,Ve){qs.test(Ve)?(ge.octetsEncountered++,ge.octetsEncountered===4&&(ge.acceptStateReached=!0),ge.state=13):cn(ge)}function X(ge,Ve){qs.test(Ve)?ge.state=9:cn(ge)}function F(ge,Ve){qs.test(Ve)||(wU(Ve)?ge.state=10:cn(ge))}function N(ge,Ve){p4(Ve)||cn(ge)}function O(ge,Ve){Ve.toLowerCase()==="a"?ge.state=16:z(ge,Ve)}function U(ge,Ve){Ve.toLowerCase()==="i"?ge.state=17:z(ge,Ve)}function Y(ge,Ve){Ve.toLowerCase()==="l"?ge.state=18:z(ge,Ve)}function k(ge,Ve){Ve.toLowerCase()==="t"?ge.state=19:z(ge,Ve)}function H(ge,Ve){Ve.toLowerCase()==="o"?ge.state=20:z(ge,Ve)}function K(ge,Ve){Ve.toLowerCase()===":"?ge.state=21:z(ge,Ve)}function te(ge,Ve){FU(Ve)?ge.state=22:Yo(u,ge)}function z(ge,Ve){Ve==="."?ge.state=23:Ve==="@"?ge.state=24:FU(Ve)?ge.state=22:Yo(u,ge)}function j(ge,Ve){Ve==="."?Yo(u,ge):Ve==="@"?Yo(u,ge):FU(Ve)?ge.state=22:Yo(u,ge)}function ee(ge,Ve){l0(Ve)?ge.state=25:Yo(u,ge)}function fe(ge,Ve){Ve==="."?ge.state=27:Ve==="-"?ge.state=26:vU(Ve)||cn(ge)}function Te(ge,Ve){Ve==="-"||Ve==="."?cn(ge):vU(Ve)?ge.state=25:cn(ge)}function de(ge,Ve){Ve==="."||Ve==="-"?cn(ge):l0(Ve)?(ge.state=25,ge.acceptStateReached=!0):cn(ge)}function xe(ge,Ve){g4(Ve)?(ge.state=29,ge.acceptStateReached=!0):Yo(u,ge)}function Ce(ge,Ve){g4(Ve)||cn(ge)}function Ie(ge,Ve){y4(Ve)?(ge.state=31,ge.acceptStateReached=!0):Yo(u,ge)}function Le(ge,Ve){y4(Ve)||(vh.test(Ve)?Yo(u,ge):cn(ge))}function Ne(ge,Ve){qs.test(Ve)?ge.state=38:(Yo(u,ge),C(Ve))}function Oe(ge,Ve){qs.test(Ve)?ge.state=33:Yo(u,ge),C(Ve)}function qe(ge,Ve){qs.test(Ve)?ge.state=34:Yo(u,ge)}function Rt(ge,Ve){qs.test(Ve)?ge.state=35:Yo(u,ge)}function Lt(ge,Ve){Ve===")"?ge.state=36:Yo(u,ge)}function ke(ge,Ve){qs.test(Ve)?ge.state=38:x4(Ve)?ge.state=39:Yo(u,ge)}function zt(ge,Ve){ge.acceptStateReached=!0,AU(Ve)?ge.state=40:Ve==="#"?ge.state=41:qs.test(Ve)||(Ve==="("?ge.state=32:x4(Ve)?ge.state=39:(cn(ge),FV(Ve)&&u.push(MU(h,0))))}function ut(ge,Ve){qs.test(Ve)?ge.state=38:Ve==="("?ge.state=32:(cn(ge),C(Ve))}function mt(ge,Ve){AU(Ve)||(Ve==="#"?ge.state=41:qs.test(Ve)?ge.state=38:cn(ge))}function Pn(ge,Ve){AU(Ve)?ge.state=40:qs.test(Ve)?Yo(u,ge):cn(ge)}function cn(ge){if(Yo(u,ge),!!ge.acceptStateReached){var Ve=ge.startIdx,bn=e.slice(ge.startIdx,h);if(bn=Qot(bn),ge.type==="url"){var pt=e.charAt(ge.startIdx-1);if(pt==="@")return;var so=ge.matchType;if(so==="scheme"){var Eo=h4.exec(bn);if(Eo&&(Ve=Ve+Eo.index,bn=bn.slice(Eo.index)),!Nbe(bn))return}else if(so==="tld"){if(!kbe(bn))return}else if(so==="ipV4"){if(!Ube(bn))return}else Yf(so);c.push(new Dbe({tagBuilder:n,matchedText:bn,offset:Ve,urlMatchType:so,url:bn,protocolRelativeMatch:bn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(ge.type==="email")Ybe(bn)&&c.push(new Hbe({tagBuilder:n,matchedText:bn,offset:Ve,email:bn.replace(Bbe,"")}));else if(ge.type==="hashtag")zbe(bn)&&c.push(new Jbe({tagBuilder:n,matchedText:bn,offset:Ve,serviceName:s,hashtag:bn.slice(1)}));else if(ge.type==="mention")Qbe(bn,a)&&c.push(new qbe({tagBuilder:n,matchedText:bn,offset:Ve,serviceName:a,mention:bn.slice(1)}));else if(ge.type==="phone"){if(bn=bn.replace(/ +$/g,""),$be(bn)){var oa=bn.replace(/[^0-9,;#]/g,"");c.push(new e0e({tagBuilder:n,matchedText:bn,offset:Ve,number:oa,plusSign:bn.charAt(0)==="+"}))}}else Yf(ge)}}}var Jot=/[\(\{\[]/,t0e=/[\)\}\]]/,n0e={")":"(","}":"{","]":"["};function Qot(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Jot.test(i)?t[i]++:t0e.test(i)&&t[n0e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),t0e.test(r)){var s=n0e[r];if(t[s]<0)t[s]++,o--;else break}else if(Mbe.test(r))o--;else break;return e.slice(0,o+1)}function MU(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function _4(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function jot(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function qot(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function $ot(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function ert(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function T4(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function trt(e){return e.type==="url"&&e.matchType==="scheme"}var _Vi=T(S());function o0e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Kf,c=0,d=e.length,u=0,h=0,p=a;c<d;){var g=e.charAt(c);switch(u){case 0:f(g);break;case 1:x(g);break;case 2:C(g);break;case 3:_(g);break;case 4:V(g);break;case 5:L(g);break;case 6:R(g);break;case 7:G(g);break;case 8:I(g);break;case 9:v(g);break;case 10:P(g);break;case 11:w(g);break;case 12:M(g);break;case 13:b(g);break;case 14:Z(g);break;case 15:E(g);break;case 16:X(g);break;case 17:F(g);break;case 18:N(g);break;case 19:O(g);break;case 20:U(g);break;default:Yf(u)}c++}h<c&&K();function f(j){j==="<"&&k()}function x(j){j==="!"?u=13:j==="/"?(u=2,p=new Kf($s($s({},p),{isClosing:!0}))):j==="<"?k():Cy.test(j)?(u=3,p=new Kf($s($s({},p),{isOpening:!0}))):(u=0,p=a)}function _(j){Kd.test(j)?(p=new Kf($s($s({},p),{name:te()})),u=4):j==="<"?k():j==="/"?(p=new Kf($s($s({},p),{name:te()})),u=12):j===">"?(p=new Kf($s($s({},p),{name:te()})),H()):!Cy.test(j)&&!qs.test(j)&&j!==":"&&Y()}function C(j){j===">"?Y():Cy.test(j)?u=3:Y()}function V(j){Kd.test(j)||(j==="/"?u=12:j===">"?H():j==="<"?k():j==="="||WU.test(j)||Gbe.test(j)?Y():u=5)}function L(j){Kd.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?H():j==="<"?k():WU.test(j)&&Y()}function R(j){Kd.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?H():j==="<"?k():WU.test(j)?Y():u=5)}function G(j){Kd.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?Y():j==="<"?k():u=10)}function I(j){j==='"'&&(u=11)}function v(j){j==="'"&&(u=11)}function P(j){Kd.test(j)?u=4:j===">"?H():j==="<"&&k()}function w(j){Kd.test(j)?u=4:j==="/"?u=12:j===">"?H():j==="<"?k():(u=4,z())}function M(j){j===">"?(p=new Kf($s($s({},p),{isClosing:!0})),H()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new Kf($s($s({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Kf($s($s({},p),{type:"doctype"})),u=20):Y()}function Z(j){j==="-"?u=15:j===">"?Y():u=16}function E(j){j==="-"?u=18:j===">"?Y():u=16}function X(j){j==="-"&&(u=17)}function F(j){j==="-"?u=18:u=16}function N(j){j===">"?H():j==="!"?u=19:j==="-"||(u=16)}function O(j){j==="-"?u=17:j===">"?H():u=16}function U(j){j===">"?H():j==="<"&&k()}function Y(){u=0,p=a}function k(){u=1,p=new Kf({idx:c})}function H(){var j=e.slice(h,p.idx);j&&o(j,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),h=c+1}function K(){var j=e.slice(h,c);o(j,h),h=c+1}function te(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function z(){c--}}var Kf=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var nrt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=irt(t.urls),this.email=zd(t.email)?t.email:this.email,this.phone=zd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=zd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=ort(t.stripPrefix),this.stripTrailingSlash=zd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=zd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&jbe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Kbe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=rrt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return o0e(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,d=s.split(c),u=a;d.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,u);r.push.apply(r,g)}u+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,d){return c.getOffset()-d.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Sy(t,function(n){return n.getType()==="hashtag"}),this.email||Sy(t,function(n){return n.getType()==="email"}),this.phone||Sy(t,function(n){return n.getType()==="phone"}),this.mention||Sy(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Sy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Sy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Sy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=i0e(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof PU)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new vbe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Lbe,e}(),r0e=nrt;function irt(e){return e==null&&(e=!0),zd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:zd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:zd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:zd(e.ipV4Matches)?e.ipV4Matches:!0}}function ort(e){return e==null&&(e=!0),zd(e)?{scheme:e,www:e}:{scheme:zd(e.scheme)?e.scheme:!0,www:zd(e.www)?e.www:!0}}function rrt(e){return typeof e=="number"?{length:e,location:"end"}:Rbe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var PVi=T(S());var XVi=T(S());var DVi=T(S());var NU=r0e;var f0e;typeof DOMParser<"u"&&(f0e=new DOMParser);var srt=new NU({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),kU=32,s0e=2414016,a0e=1,c0e=16093e3,l0e=.1,art=[null,void 0,"http://www.topografix.com/GPX/1/1"],Zo={gpx:art};function crt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function S4(e,t){let n=fw(e,"id");return n=l(n)?n:Hn(),t.getOrCreateEntity(n)}function C4(e){let t=d0e(e,"lon"),n=d0e(e,"lat"),i=mw(e,"ele",Zo.gpx);return m.fromDegrees(t,n,i)}function d0e(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function fw(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Vy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function V4(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function mw(e,t,n){let i=Vy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function jl(e,t,n){let i=Vy(e,t,n);if(l(i))return i.textContent.trim()}function p0e(e){let t=new pc;return t.width=kU,t.height=kU,t.scaleByDistance=new kt(s0e,a0e,c0e,l0e),t.pixelOffsetScaleByDistance=new kt(s0e,a0e,c0e,l0e),t.verticalOrigin=new Qn(An.BOTTOM),t.image=e,t}function lrt(){let e=new jm;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=Do.FILL_AND_OUTLINE,e}function b0e(e){let t=new gc;return t.width=4,t.material=new uy,t.material.color=l(e)?e:B.RED,t.material.outlineWidth=2,t.material.outlineColor=B.BLACK,t}var u0e={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},hw;typeof document<"u"&&(hw=document.createElement("div"));function L4(e,t){let n,i="",o=Object.keys(u0e),r=o.length;for(n=0;n<r;n++){let u=o[n],h=u0e[u];h.value=y(jl(e,h.tag,Zo.gpx),""),l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=srt.link(i),hw.innerHTML=i;let s=hw.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=B.WHITE,c=B.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${hw.innerHTML}</div>`,hw.innerHTML="",d}function g0e(e,t,n,i){let o=C4(t),r=S4(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,kU);r.billboard=p0e(s);let a=jl(t,"name",Zo.gpx);r.name=a,r.label=lrt(),r.label.text=a,r.description=L4(t,r),i.clampToGround&&(r.billboard.heightReference=Je.CLAMP_TO_GROUND,r.label.heightReference=Je.CLAMP_TO_GROUND)}function drt(e,t,n,i){let o=S4(t,n);o.description=L4(t,o);let r=V4(t,"rtept",Zo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)g0e(e,r[a],n,i),s[a]=C4(r[a]);o.polyline=b0e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function urt(e,t,n,i){let o=S4(t,n);o.description=L4(t,o);let r=V4(t,"trkseg",Zo.gpx),s=[],a=[],c,d=!0,u=new ga;for(let h=0;h<r.length;h++)c=mrt(r[h]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,kU);o.billboard=p0e(h),o.position=u,i.clampToGround&&(o.billboard.heightReference=Je.CLAMP_TO_GROUND),o.availability=new Nr,o.availability.addInterval(new Ln({start:a[0],stop:a[a.length-1]}))}o.polyline=b0e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function mrt(e){let t={positions:[],times:[]},n=V4(e,"trkpt",Zo.gpx),i;for(let o=0;o<n.length;o++){let r=C4(n[o]);t.positions.push(r),i=jl(n[o],"time",Zo.gpx),l(i)&&t.times.push(q.fromIso8601(i))}return t}function hrt(e){let t=Vy(e,"metadata",Zo.gpx);if(l(t)){let n={name:jl(t,"name",Zo.gpx),desc:jl(t,"desc",Zo.gpx),author:frt(t),copyright:brt(t),link:y0e(t),time:jl(t,"time",Zo.gpx),keywords:jl(t,"keywords",Zo.gpx),bounds:grt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function frt(e){let t=Vy(e,"author",Zo.gpx);if(l(t)){let n={name:jl(t,"name",Zo.gpx),email:prt(t),link:y0e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function prt(e){let t=Vy(e,"email",Zo.gpx);if(l(t)){let n=jl(t,"id",Zo.gpx),i=jl(t,"domain",Zo.gpx);return`${n}@${i}`}}function y0e(e){let t=Vy(e,"link",Zo.gpx);if(l(t)){let n={href:fw(t,"href"),text:jl(t,"text",Zo.gpx),mimeType:jl(t,"type",Zo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function brt(e){let t=Vy(e,"copyright",Zo.gpx);if(l(t)){let n={author:fw(t,"author"),year:jl(t,"year",Zo.gpx),license:jl(t,"license",Zo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function grt(e){let t=Vy(e,"bounds",Zo.gpx);if(l(t)){let n={minLat:mw(t,"minlat",Zo.gpx),maxLat:mw(t,"maxlat",Zo.gpx),minLon:mw(t,"minlon",Zo.gpx),maxLon:mw(t,"maxlon",Zo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var m0e={wpt:g0e,rte:drt,trk:urt};function yrt(e,t,n,i){let o=Object.keys(m0e),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=m0e[a],d=t.childNodes,u=d.length;for(let h=0;h<u;h++){let p=d[h];p.localName===a&&Zo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function h0e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=fw(o,"version"),s=fw(o,"creator"),a,c=hrt(o);l(c)&&(a=c.name),o.localName==="gpx"?yrt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),h=u.start,p=u.stop,g=q.equals(h,Be.MINIMUM_VALUE),f=q.equals(p,Be.MAXIMUM_VALUE);if(!g||!f){let _;g&&(_=new Date,_.setHours(0,0,0,0),h=q.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=q.fromDate(_)),d=new Lh,d.startTime=h,d.stopTime=p,d.currentTime=q.clone(h),d.clockRange=vr.LOOP_STOP,d.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(q.secondsDifference(p,h)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),xrt(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),d!==e._clock&&(x=!0,e._clock=d),x&&e._changed.raiseEvent(e),Yr.setLoading(e,!1),e}function xrt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function _rt(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Ze){n=Ze.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?crt(r).then(function(s){let a,c;try{a=f0e.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new ae(d)}return h0e(e,a,i)}):h0e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function AV(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new js(this),this._entityCluster=new kd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new jp}AV.load=function(e,t){return new AV().load(e,t)};Object.defineProperties(AV.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});AV.prototype.update=function(e){return!0};AV.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=y(t,y.EMPTY_OBJECT),Yr.setLoading(this,!0);let n=this._name,i=this;return _rt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=q.equals(s,Be.MINIMUM_VALUE),d=q.equals(a,Be.MAXIMUM_VALUE);if(!c||!d){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=q.fromDate(h)),d&&(h=new Date,h.setHours(24,0,0,0),a=q.fromDate(h)),o=new Lh,o.startTime=s,o.stopTime=a,o.currentTime=q.clone(s),o.clockRange=vr.LOOP_STOP,o.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(q.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Yr.setLoading(i,!1),i}).catch(function(o){return Yr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var pw=AV;var vLi=T(S(),1);function Trt(e,t){this.position=e,this.headingPitchRoll=t}var bw=Trt;var iEi=T(S(),1);var Nw=T(dd(),1);var CZi=T(S(),1);var FLi=T(S(),1);function zU(e){return KU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function KU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?KU(n):n),[])}var x0e=[0,1,2,3].concat(...zU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function hr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,h,p,g,f,x,_=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)h=o.heap[u],g=r[r[h*2+1]*2+1]+1,g>d&&(g=d,_++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,f=0,h>=c&&(f=a[h-c]),x=r[h*2],o.opt_len+=x*(g+f),s&&(o.static_len+=x*(s[h*2+1]+f)));if(_!==0){do{for(g=d-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[d]--,_-=2}while(_>0);for(g=d;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,d,u,h;for(d=1;d<=15;d++)a[d]=c=c+s[d-1]<<1;for(u=0;u<=r;u++)h=o[u*2+1],h!==0&&(o[u*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,d,u=-1,h;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=u=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=u<2?++u:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=u,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);h=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=d,r[h*2]=r[c*2]+r[d*2],o.depth[h]=Math.max(o.depth[c],o.depth[d])+1,r[c*2+1]=r[d*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}hr._length_code=[0,1,2,3,4,5,6,7].concat(...zU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));hr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];hr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];hr.d_code=function(e){return e<256?x0e[e]:x0e[256+(e>>>7)]};hr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];hr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];hr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];hr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ua(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var Srt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Crt=zU([[144,8],[112,9],[24,7],[8,8]]);Ua.static_ltree=KU(Srt.map((e,t)=>[e,Crt[t]]));var Vrt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Lrt=zU([[30,5]]);Ua.static_dtree=KU(Vrt.map((e,t)=>[e,Lrt[t]]));Ua.static_l_desc=new Ua(Ua.static_ltree,hr.extra_lbits,257,286,15);Ua.static_d_desc=new Ua(Ua.static_dtree,hr.extra_dbits,0,30,15);Ua.static_bl_desc=new Ua(null,hr.extra_blbits,0,19,7);var Rrt=9,Zrt=8;function Jf(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var T0e=0,YU=1,MT=2,wh=[new Jf(0,0,0,0,T0e),new Jf(4,4,8,4,YU),new Jf(4,5,16,8,YU),new Jf(4,6,32,32,YU),new Jf(4,4,16,16,MT),new Jf(8,16,32,32,MT),new Jf(8,16,128,128,MT),new Jf(8,32,128,256,MT),new Jf(32,128,258,1024,MT),new Jf(32,258,258,4096,MT)],UU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],um=0,DU=1,gw=2,BU=3,Grt=32,R4=42,OU=113,yw=666,Z4=8,Ert=0,G4=1,Irt=2,Rr=3,HU=258,Jd=HU+Rr+1;function _0e(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Xrt(){let e=this,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x,_,C,V,L,R,G,I,v,P,w,M,b,Z,E,X,F,N,O,U=new hr,Y=new hr,k=new hr;e.depth=[];let H,K,te,z,j,ee;e.bl_count=[],e.heap=[],F=[],N=[],O=[];function fe(){d=2*r,h[g-1]=0;for(let Fe=0;Fe<g-1;Fe++)h[Fe]=0;M=wh[b].max_lazy,E=wh[b].good_length,X=wh[b].nice_length,w=wh[b].max_chain,G=0,C=0,v=0,V=P=Rr-1,R=0,p=0}function Te(){let Fe;for(Fe=0;Fe<286;Fe++)F[Fe*2]=0;for(Fe=0;Fe<30;Fe++)N[Fe*2]=0;for(Fe=0;Fe<19;Fe++)O[Fe*2]=0;F[256*2]=1,e.opt_len=e.static_len=0,K=te=0}function de(){U.dyn_tree=F,U.stat_desc=Ua.static_l_desc,Y.dyn_tree=N,Y.stat_desc=Ua.static_d_desc,k.dyn_tree=O,k.stat_desc=Ua.static_bl_desc,j=0,ee=0,z=8,Te()}e.pqdownheap=function(Fe,rt){let ze=e.heap,Qe=ze[rt],bt=rt<<1;for(;bt<=e.heap_len&&(bt<e.heap_len&&_0e(Fe,ze[bt+1],ze[bt],e.depth)&&bt++,!_0e(Fe,Qe,ze[bt],e.depth));)ze[rt]=ze[bt],rt=bt,bt<<=1;ze[rt]=Qe};function xe(Fe,rt){let ze=-1,Qe,bt=Fe[0*2+1],Ot=0,Cn=7,Io=4;bt===0&&(Cn=138,Io=3),Fe[(rt+1)*2+1]=65535;for(let So=0;So<=rt;So++)Qe=bt,bt=Fe[(So+1)*2+1],!(++Ot<Cn&&Qe==bt)&&(Ot<Io?O[Qe*2]+=Ot:Qe!==0?(Qe!=ze&&O[Qe*2]++,O[16*2]++):Ot<=10?O[17*2]++:O[18*2]++,Ot=0,ze=Qe,bt===0?(Cn=138,Io=3):Qe==bt?(Cn=6,Io=3):(Cn=7,Io=4))}function Ce(){let Fe;for(xe(F,U.max_code),xe(N,Y.max_code),k.build_tree(e),Fe=18;Fe>=3&&O[hr.bl_order[Fe]*2+1]===0;Fe--);return e.opt_len+=3*(Fe+1)+5+5+4,Fe}function Ie(Fe){e.pending_buf[e.pending++]=Fe}function Le(Fe){Ie(Fe&255),Ie(Fe>>>8&255)}function Ne(Fe){Ie(Fe>>8&255),Ie(Fe&255&255)}function Oe(Fe,rt){let ze,Qe=rt;ee>16-Qe?(ze=Fe,j|=ze<<ee&65535,Le(j),j=ze>>>16-ee,ee+=Qe-16):(j|=Fe<<ee&65535,ee+=Qe)}function qe(Fe,rt){let ze=Fe*2;Oe(rt[ze]&65535,rt[ze+1]&65535)}function Rt(Fe,rt){let ze,Qe=-1,bt,Ot=Fe[0*2+1],Cn=0,Io=7,So=4;for(Ot===0&&(Io=138,So=3),ze=0;ze<=rt;ze++)if(bt=Ot,Ot=Fe[(ze+1)*2+1],!(++Cn<Io&&bt==Ot)){if(Cn<So)do qe(bt,O);while(--Cn!==0);else bt!==0?(bt!=Qe&&(qe(bt,O),Cn--),qe(16,O),Oe(Cn-3,2)):Cn<=10?(qe(17,O),Oe(Cn-3,3)):(qe(18,O),Oe(Cn-11,7));Cn=0,Qe=bt,Ot===0?(Io=138,So=3):bt==Ot?(Io=6,So=3):(Io=7,So=4)}}function Lt(Fe,rt,ze){let Qe;for(Oe(Fe-257,5),Oe(rt-1,5),Oe(ze-4,4),Qe=0;Qe<ze;Qe++)Oe(O[hr.bl_order[Qe]*2+1],3);Rt(F,Fe-1),Rt(N,rt-1)}function ke(){ee==16?(Le(j),j=0,ee=0):ee>=8&&(Ie(j&255),j>>>=8,ee-=8)}function zt(){Oe(G4<<1,3),qe(256,Ua.static_ltree),ke(),1+z+10-ee<9&&(Oe(G4<<1,3),qe(256,Ua.static_ltree),ke()),z=7}function ut(Fe,rt){let ze,Qe,bt;if(e.dist_buf[K]=Fe,e.lc_buf[K]=rt&255,K++,Fe===0?F[rt*2]++:(te++,Fe--,F[(hr._length_code[rt]+256+1)*2]++,N[hr.d_code(Fe)*2]++),(K&8191)===0&&b>2){for(ze=K*8,Qe=G-C,bt=0;bt<30;bt++)ze+=N[bt*2]*(5+hr.extra_dbits[bt]);if(ze>>>=3,te<Math.floor(K/2)&&ze<Math.floor(Qe/2))return!0}return K==H-1}function mt(Fe,rt){let ze,Qe,bt=0,Ot,Cn;if(K!==0)do ze=e.dist_buf[bt],Qe=e.lc_buf[bt],bt++,ze===0?qe(Qe,Fe):(Ot=hr._length_code[Qe],qe(Ot+256+1,Fe),Cn=hr.extra_lbits[Ot],Cn!==0&&(Qe-=hr.base_length[Ot],Oe(Qe,Cn)),ze--,Ot=hr.d_code(ze),qe(Ot,rt),Cn=hr.extra_dbits[Ot],Cn!==0&&(ze-=hr.base_dist[Ot],Oe(ze,Cn)));while(bt<K);qe(256,Fe),z=Fe[256*2+1]}function Pn(){ee>8?Le(j):ee>0&&Ie(j&255),j=0,ee=0}function cn(Fe,rt,ze){Pn(),z=8,ze&&(Le(rt),Le(~rt)),e.pending_buf.set(c.subarray(Fe,Fe+rt),e.pending),e.pending+=rt}function ge(Fe,rt,ze){Oe((Ert<<1)+(ze?1:0),3),cn(Fe,rt,!0)}function Ve(Fe,rt,ze){let Qe,bt,Ot=0;b>0?(U.build_tree(e),Y.build_tree(e),Ot=Ce(),Qe=e.opt_len+3+7>>>3,bt=e.static_len+3+7>>>3,bt<=Qe&&(Qe=bt)):Qe=bt=rt+5,rt+4<=Qe&&Fe!=-1?ge(Fe,rt,ze):bt==Qe?(Oe((G4<<1)+(ze?1:0),3),mt(Ua.static_ltree,Ua.static_dtree)):(Oe((Irt<<1)+(ze?1:0),3),Lt(U.max_code+1,Y.max_code+1,Ot+1),mt(F,N)),Te(),ze&&Pn()}function bn(Fe){Ve(C>=0?C:-1,G-C,Fe),C=G,t.flush_pending()}function pt(){let Fe,rt,ze,Qe;do{if(Qe=d-v-G,Qe===0&&G===0&&v===0)Qe=r;else if(Qe==-1)Qe--;else if(G>=r+r-Jd){c.set(c.subarray(r,r+r),0),I-=r,G-=r,C-=r,Fe=g,ze=Fe;do rt=h[--ze]&65535,h[ze]=rt>=r?rt-r:0;while(--Fe!==0);Fe=r,ze=Fe;do rt=u[--ze]&65535,u[ze]=rt>=r?rt-r:0;while(--Fe!==0);Qe+=r}if(t.avail_in===0)return;Fe=t.read_buf(c,G+v,Qe),v+=Fe,v>=Rr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(v<Jd&&t.avail_in!==0)}function so(Fe){let rt=65535,ze;for(rt>i-5&&(rt=i-5);;){if(v<=1){if(pt(),v===0&&Fe==0)return um;if(v===0)break}if(G+=v,v=0,ze=C+rt,(G===0||G>=ze)&&(v=G-ze,G=ze,bn(!1),t.avail_out===0)||G-C>=r-Jd&&(bn(!1),t.avail_out===0))return um}return bn(Fe==4),t.avail_out===0?Fe==4?gw:um:Fe==4?BU:DU}function Eo(Fe){let rt=w,ze=G,Qe,bt,Ot=P,Cn=G>r-Jd?G-(r-Jd):0,Io=X,So=a,Ka=G+HU,Ja=c[ze+Ot-1],Ci=c[ze+Ot];P>=E&&(rt>>=2),Io>v&&(Io=v);do if(Qe=Fe,!(c[Qe+Ot]!=Ci||c[Qe+Ot-1]!=Ja||c[Qe]!=c[ze]||c[++Qe]!=c[ze+1])){ze+=2,Qe++;do;while(c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&c[++ze]==c[++Qe]&&ze<Ka);if(bt=HU-(Ka-ze),ze=Ka-HU,bt>Ot){if(I=Fe,Ot=bt,bt>=Io)break;Ja=c[ze+Ot-1],Ci=c[ze+Ot]}}while((Fe=u[Fe&So]&65535)>Cn&&--rt!==0);return Ot<=v?Ot:v}function oa(Fe){let rt=0,ze;for(;;){if(v<Jd){if(pt(),v<Jd&&Fe==0)return um;if(v===0)break}if(v>=Rr&&(p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G),rt!==0&&(G-rt&65535)<=r-Jd&&Z!=2&&(V=Eo(rt)),V>=Rr)if(ze=ut(G-I,V-Rr),v-=V,V<=M&&v>=Rr){V--;do G++,p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else ze=ut(0,c[G]&255),v--,G++;if(ze&&(bn(!1),t.avail_out===0))return um}return bn(Fe==4),t.avail_out===0?Fe==4?gw:um:Fe==4?BU:DU}function Gr(Fe){let rt=0,ze,Qe;for(;;){if(v<Jd){if(pt(),v<Jd&&Fe==0)return um;if(v===0)break}if(v>=Rr&&(p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G),P=V,L=I,V=Rr-1,rt!==0&&P<M&&(G-rt&65535)<=r-Jd&&(Z!=2&&(V=Eo(rt)),V<=5&&(Z==1||V==Rr&&G-I>4096)&&(V=Rr-1)),P>=Rr&&V<=P){Qe=G+v-Rr,ze=ut(G-1-L,P-Rr),v-=P-1,P-=2;do++G<=Qe&&(p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G);while(--P!==0);if(R=0,V=Rr-1,G++,ze&&(bn(!1),t.avail_out===0))return um}else if(R!==0){if(ze=ut(0,c[G-1]&255),ze&&bn(!1),G++,v--,t.avail_out===0)return um}else R=1,G++,v--}return R!==0&&(ze=ut(0,c[G-1]&255),R=0),bn(Fe==4),t.avail_out===0?Fe==4?gw:um:Fe==4?BU:DU}function _s(Fe){return Fe.total_in=Fe.total_out=0,Fe.msg=null,e.pending=0,e.pending_out=0,n=OU,o=0,de(),fe(),0}e.deflateInit=function(Fe,rt,ze,Qe,bt,Ot){return Qe||(Qe=Z4),bt||(bt=Zrt),Ot||(Ot=0),Fe.msg=null,rt==-1&&(rt=6),bt<1||bt>Rrt||Qe!=Z4||ze<9||ze>15||rt<0||rt>9||Ot<0||Ot>2?-2:(Fe.dstate=e,s=ze,r=1<<s,a=r-1,f=bt+7,g=1<<f,x=g-1,_=Math.floor((f+Rr-1)/Rr),c=new Uint8Array(r*2),u=[],h=[],H=1<<bt+6,e.pending_buf=new Uint8Array(H*4),i=H*4,e.dist_buf=new Uint16Array(H),e.lc_buf=new Uint8Array(H),b=rt,Z=Ot,_s(Fe))},e.deflateEnd=function(){return n!=R4&&n!=OU&&n!=yw?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,u=null,c=null,e.dstate=null,n==OU?-3:0)},e.deflateParams=function(Fe,rt,ze){let Qe=0;return rt==-1&&(rt=6),rt<0||rt>9||ze<0||ze>2?-2:(wh[b].func!=wh[rt].func&&Fe.total_in!==0&&(Qe=Fe.deflate(1)),b!=rt&&(b=rt,M=wh[b].max_lazy,E=wh[b].good_length,X=wh[b].nice_length,w=wh[b].max_chain),Z=ze,Qe)},e.deflateSetDictionary=function(Fe,rt,ze){let Qe=ze,bt,Ot=0;if(!rt||n!=R4)return-2;if(Qe<Rr)return 0;for(Qe>r-Jd&&(Qe=r-Jd,Ot=ze-Qe),c.set(rt.subarray(Ot,Ot+Qe),0),G=Qe,C=Qe,p=c[0]&255,p=(p<<_^c[1]&255)&x,bt=0;bt<=Qe-Rr;bt++)p=(p<<_^c[bt+(Rr-1)]&255)&x,u[bt&a]=h[p],h[p]=bt;return 0},e.deflate=function(Fe,rt){let ze,Qe,bt,Ot,Cn;if(rt>4||rt<0)return-2;if(!Fe.next_out||!Fe.next_in&&Fe.avail_in!==0||n==yw&&rt!=4)return Fe.msg=UU[4],-2;if(Fe.avail_out===0)return Fe.msg=UU[7],-5;if(t=Fe,Ot=o,o=rt,n==R4&&(Qe=Z4+(s-8<<4)<<8,bt=(b-1&255)>>1,bt>3&&(bt=3),Qe|=bt<<6,G!==0&&(Qe|=Grt),Qe+=31-Qe%31,n=OU,Ne(Qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&rt<=Ot&&rt!=4)return t.msg=UU[7],-5;if(n==yw&&t.avail_in!==0)return Fe.msg=UU[7],-5;if(t.avail_in!==0||v!==0||rt!=0&&n!=yw){switch(Cn=-1,wh[b].func){case T0e:Cn=so(rt);break;case YU:Cn=oa(rt);break;case MT:Cn=Gr(rt);break;default:}if((Cn==gw||Cn==BU)&&(n=yw),Cn==um||Cn==gw)return t.avail_out===0&&(o=-1),0;if(Cn==DU){if(rt==1)zt();else if(ge(0,0,!1),rt==3)for(ze=0;ze<g;ze++)h[ze]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return rt!=4?0:1}}function S0e(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}S0e.prototype={deflateInit(e,t){let n=this;return n.dstate=new Xrt,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function C0e(e){let t=this,n=new S0e,i=Wrt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let d,u,h=0,p=0,g=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=h&&(c(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(g),f.forEach(function(x){u.set(x,p),p+=x.length})):u=f[0]?new Uint8Array(f[0]):new Uint8Array,u}},t.flush=function(){let a,c,d=0,u=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),h.forEach(function(p){c.set(p,d),d+=p.length}),c}}function Wrt(e){return e+5*(Math.floor(e/16383)+1)}var MLi=T(S(),1);var Qd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B0e=1440,Prt=0,vrt=4,wrt=9,Frt=5,Art=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Mrt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Nrt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],krt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Urt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Drt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ly=15;function W4(){let e=this,t,n,i,o,r,s;function a(d,u,h,p,g,f,x,_,C,V,L){let R,G,I,v,P,w,M,b,Z,E,X,F,N,O,U;E=0,P=h;do i[d[u+E]]++,E++,P--;while(P!==0);if(i[0]==h)return x[0]=-1,_[0]=0,0;for(b=_[0],w=1;w<=Ly&&i[w]===0;w++);for(M=w,b<w&&(b=w),P=Ly;P!==0&&i[P]===0;P--);for(I=P,b>P&&(b=P),_[0]=b,O=1<<w;w<P;w++,O<<=1)if((O-=i[w])<0)return-3;if((O-=i[P])<0)return-3;for(i[P]+=O,s[1]=w=0,E=1,N=2;--P!==0;)s[N]=w+=i[E],N++,E++;P=0,E=0;do(w=d[u+E])!==0&&(L[s[w]++]=P),E++;while(++P<h);for(h=s[I],s[0]=P=0,E=0,v=-1,F=-b,r[0]=0,X=0,U=0;M<=I;M++)for(R=i[M];R--!==0;){for(;M>F+b;){if(v++,F+=b,U=I-F,U=U>b?b:U,(G=1<<(w=M-F))>R+1&&(G-=R+1,N=M,w<U))for(;++w<U&&!((G<<=1)<=i[++N]);)G-=i[N];if(U=1<<w,V[0]+U>B0e)return-3;r[v]=X=V[0],V[0]+=U,v!==0?(s[v]=P,o[0]=w,o[1]=b,w=P>>>F-b,o[2]=X-r[v-1]-w,C.set(o,(r[v-1]+w)*3)):x[0]=X}for(o[1]=M-F,E>=h?o[0]=192:L[E]<p?(o[0]=L[E]<256?0:96,o[2]=L[E++]):(o[0]=f[L[E]-p]+16+64,o[2]=g[L[E++]-p]),G=1<<M-F,w=P>>>F;w<U;w+=G)C.set(o,(X+w)*3);for(w=1<<M-1;(P&w)!==0;w>>>=1)P^=w;for(P^=w,Z=(1<<F)-1;(P&Z)!=s[v];)v--,F-=b,Z=(1<<F)-1}return O!==0&&I!=1?-5:0}function c(d){let u;for(t||(t=[],n=[],i=new Int32Array(Ly+1),o=[],r=new Int32Array(Ly),s=new Int32Array(Ly+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<Ly+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,Ly),0),s.set(i.subarray(0,Ly+1),0)}e.inflate_trees_bits=function(d,u,h,p,g){let f;return c(19),t[0]=0,f=a(d,0,19,19,null,null,h,u,p,t,n),f==-3?g.msg="oversubscribed dynamic bit lengths tree":(f==-5||u[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",f=-3),f},e.inflate_trees_dynamic=function(d,u,h,p,g,f,x,_,C){let V;return c(288),t[0]=0,V=a(h,0,d,257,Nrt,krt,f,p,_,t,n),V!=0||p[0]===0?(V==-3?C.msg="oversubscribed literal/length tree":V!=-4&&(C.msg="incomplete literal/length tree",V=-3),V):(c(288),V=a(h,d,u,0,Urt,Drt,x,g,_,t,n),V!=0||g[0]===0&&d>257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}W4.inflate_trees_fixed=function(e,t,n,i){return e[0]=wrt,t[0]=Frt,n[0]=Art,i[0]=Mrt,0};var JU=0,V0e=1,L0e=2,R0e=3,Z0e=4,G0e=5,E0e=6,E4=7,I0e=8,QU=9;function Brt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,h,p=0,g,f=0;function x(_,C,V,L,R,G,I,v){let P,w,M,b,Z,E,X,F,N,O,U,Y,k,H,K,te;X=v.next_in_index,F=v.avail_in,Z=I.bitb,E=I.bitk,N=I.write,O=N<I.read?I.read-N-1:I.end-N,U=Qd[_],Y=Qd[C];do{for(;E<20;)F--,Z|=(v.read_byte(X++)&255)<<E,E+=8;if(P=Z&U,w=V,M=L,te=(M+P)*3,(b=w[te])===0){Z>>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;continue}do{if(Z>>=w[te+1],E-=w[te+1],(b&16)!==0){for(b&=15,k=w[te+2]+(Z&Qd[b]),Z>>=b,E-=b;E<15;)F--,Z|=(v.read_byte(X++)&255)<<E,E+=8;P=Z&Y,w=R,M=G,te=(M+P)*3,b=w[te];do if(Z>>=w[te+1],E-=w[te+1],(b&16)!==0){for(b&=15;E<b;)F--,Z|=(v.read_byte(X++)&255)<<E,E+=8;if(H=w[te+2]+(Z&Qd[b]),Z>>=b,E-=b,O-=k,N>=H)K=N-H,N-K>0&&2>N-K?(I.win[N++]=I.win[K++],I.win[N++]=I.win[K++],k-=2):(I.win.set(I.win.subarray(K,K+2),N),N+=2,K+=2,k-=2);else{K=N-H;do K+=I.end;while(K<0);if(b=I.end-K,k>b){if(k-=b,N-K>0&&b>N-K)do I.win[N++]=I.win[K++];while(--b!==0);else I.win.set(I.win.subarray(K,K+b),N),N+=b,K+=b,b=0;K=0}}if(N-K>0&&k>N-K)do I.win[N++]=I.win[K++];while(--k!==0);else I.win.set(I.win.subarray(K,K+k),N),N+=k,K+=k,k=0;break}else if((b&64)===0)P+=w[te+2],P+=Z&Qd[b],te=(M+P)*3,b=w[te];else return v.msg="invalid distance code",k=v.avail_in-F,k=E>>3<k?E>>3:k,F+=k,X-=k,E-=k<<3,I.bitb=Z,I.bitk=E,v.avail_in=F,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3;while(!0);break}if((b&64)===0){if(P+=w[te+2],P+=Z&Qd[b],te=(M+P)*3,(b=w[te])===0){Z>>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;break}}else return(b&32)!==0?(k=v.avail_in-F,k=E>>3<k?E>>3:k,F+=k,X-=k,E-=k<<3,I.bitb=Z,I.bitk=E,v.avail_in=F,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,1):(v.msg="invalid literal/length code",k=v.avail_in-F,k=E>>3<k?E>>3:k,F+=k,X-=k,E-=k<<3,I.bitb=Z,I.bitk=E,v.avail_in=F,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3)}while(!0)}while(O>=258&&F>=10);return k=v.avail_in-F,k=E>>3<k?E>>3:k,F+=k,X-=k,E-=k<<3,I.bitb=Z,I.bitk=E,v.avail_in=F,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,0}e.init=function(_,C,V,L,R,G){t=JU,d=_,u=C,h=V,p=L,g=R,f=G,i=null},e.proc=function(_,C,V){let L,R,G,I=0,v=0,P=0,w,M,b,Z;for(P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M;;)switch(t){case JU:if(b>=258&&w>=10&&(_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,V=x(d,u,h,p,g,f,_,C),P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M,V!=0)){t=V==1?E4:QU;break}r=d,i=h,o=p,t=V0e;case V0e:for(L=r;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}if(R=(o+(I&Qd[L]))*3,I>>>=i[R+1],v-=i[R+1],G=i[R],G===0){s=i[R+2],t=E0e;break}if((G&16)!==0){a=G&15,n=i[R+2],t=L0e;break}if((G&64)===0){r=G,o=R/3+i[R+2];break}if((G&32)!==0){t=E4;break}return t=QU,C.msg="invalid literal/length code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case L0e:for(L=a;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}n+=I&Qd[L],I>>=L,v-=L,r=u,i=g,o=f,t=R0e;case R0e:for(L=r;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}if(R=(o+(I&Qd[L]))*3,I>>=i[R+1],v-=i[R+1],G=i[R],(G&16)!==0){a=G&15,c=i[R+2],t=Z0e;break}if((G&64)===0){r=G,o=R/3+i[R+2];break}return t=QU,C.msg="invalid distance code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case Z0e:for(L=a;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}c+=I&Qd[L],I>>=L,v-=L,t=G0e;case G0e:for(Z=M-c;Z<0;)Z+=_.end;for(;n!==0;){if(b===0&&(M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);_.win[M++]=_.win[Z++],b--,Z==_.end&&(Z=0),n--}t=JU;break;case E0e:if(b===0&&(M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);V=0,_.win[M++]=s,b--,t=JU;break;case E4:if(v>7&&(v-=8,w++,P--),_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,_.read!=_.write)return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);t=I0e;case I0e:return V=1,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case QU:return V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);default:return V=-2,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V)}},e.free=function(){}}var X0e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],MV=0,I4=1,W0e=2,P0e=3,v0e=4,w0e=5,jU=6,qU=7,F0e=8,NT=9;function Ort(e,t){let n=this,i=MV,o=0,r=0,s=0,a,c=[0],d=[0],u=new Brt,h=0,p=new Int32Array(B0e*3),g=0,f=new W4;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=g),i==jU&&u.free(x),i=MV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,R,G,I,v,P;for(R=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I;;){let w,M,b,Z,E,X,F,N;switch(i){case MV:for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<<L,L+=8}switch(C=V&7,h=C&1,C>>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=I4;break;case 1:w=[],M=[],b=[[]],Z=[[]],W4.inflate_trees_fixed(w,M,b,Z),u.init(w[0],M[0],b[0],0,Z[0],0),V>>>=3,L-=3,i=jU;break;case 2:V>>>=3,L-=3,i=P0e;break;case 3:return V>>>=3,L-=3,i=NT,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_)}break;case I4:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<<L,L+=8}if((~V>>>16&65535)!=(V&65535))return i=NT,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?W0e:h!==0?qU:MV;break;case W0e:if(G===0||v===0&&(I==n.end&&n.read!==0&&(I=0,v=I<n.read?n.read-I-1:n.end-I),v===0&&(n.write=I,_=n.inflate_flush(x,_),I=n.write,v=I<n.read?n.read-I-1:n.end-I,I==n.end&&n.read!==0&&(I=0,v=I<n.read?n.read-I-1:n.end-I),v===0)))return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);if(_=0,C=o,C>G&&(C=G),C>v&&(C=v),n.win.set(x.read_buf(R,C),I),R+=C,G-=C,I+=C,v-=C,(o-=C)!==0)break;i=h!==0?qU:MV;break;case P0e:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<<L,L+=8}if(r=C=V&16383,(C&31)>29||(C>>5&31)>29)return i=NT,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(P=0;P<C;P++)a[P]=0;V>>>=14,L-=14,s=0,i=v0e;case v0e:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<<L,L+=8}a[X0e[s++]]=V&7,V>>>=3,L-=3}for(;s<19;)a[X0e[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,d,p,x),C!=0)return _=C,_==-3&&(a=null,i=NT),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);s=0,i=w0e;case w0e:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let O,U;for(C=c[0];L<C;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<<L,L+=8}if(C=p[(d[0]+(V&Qd[C]))*3+1],U=p[(d[0]+(V&Qd[C]))*3+2],U<16)V>>>=C,L-=C,a[s++]=U;else{for(P=U==18?7:U-14,O=U==18?11:3;L<C+P;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<<L,L+=8}if(V>>>=C,L-=C,O+=V&Qd[P],V>>>=P,L-=P,P=s,C=r,P+O>258+(C&31)+(C>>5&31)||U==16&&P<1)return a=null,i=NT,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);U=U==16?a[P-1]:0;do a[P++]=U;while(--O!==0);s=P}}if(d[0]=-1,E=[],X=[],F=[],N=[],E[0]=9,X[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,X,F,N,p,x),C!=0)return C==-3&&(a=null,i=NT),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);u.init(E[0],X[0],p,F[0],p,N[0]),i=jU;case jU:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),R=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I,h===0){i=MV;break}i=qU;case qU:if(n.write=I,_=n.inflate_flush(x,_),I=n.write,v=I<n.read?n.read-I-1:n.end-I,n.read!=n.write)return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);i=F0e;case F0e:return _=1,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);case NT:return _=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_);default:return _=-2,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=I,n.inflate_flush(x,_)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,_,C){n.win.set(x.subarray(_,_+C),0),n.read=n.write=C},n.sync_point=function(){return i==I4?1:0}}var Yrt=32,Hrt=8,zrt=0,A0e=1,M0e=2,N0e=3,k0e=4,U0e=5,X4=6,xw=7,D0e=12,Ry=13,Krt=[0,0,255,255];function Jrt(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=xw,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Ort(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==vrt?-5:0,o=-5;;)switch(s.mode){case zrt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=Hrt){s.mode=Ry,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Ry,n.msg="invalid win size",s.marker=5;break}s.mode=A0e;case A0e:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Ry,n.msg="incorrect header check",s.marker=5;break}if((r&Yrt)===0){s.mode=xw;break}s.mode=M0e;case M0e:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=N0e;case N0e:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=k0e;case k0e:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=U0e;case U0e:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=X4,2);case X4:return s.mode=Ry,n.msg="need dictionary",s.marker=0,-2;case xw:if(o=s.blocks.proc(n,o),o==-3){s.mode=Ry,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=D0e;case D0e:return n.avail_in=0,1;case Ry:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=X4)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=xw,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Ry&&(c.mode=Ry,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==Krt[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=xw,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function O0e(){}O0e.prototype={inflateInit(e){let t=this;return t.istate=new Jrt,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function Y0e(e){let t=this,n=new O0e,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Prt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let d=[],u,h,p=0,g=0,f=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),u=n.inflate(o),s&&u===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+n.msg);if((s||u===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?d.push(new Uint8Array(r)):d.push(r.subarray(0,n.next_out_index))),f+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(h=new Uint8Array(f),d.forEach(function(x){h.set(x,g),g+=x.length})):h=d[0]?new Uint8Array(d[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var zLi=T(S(),1);var kLi=T(S(),1);var kT="/",P4=new Date(2107,11,31),v4=new Date(1980,0,1),Gi=void 0,jd="undefined",d0="function";var DLi=T(S(),1);var _w=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Qrt=64,H0e=2;try{typeof navigator!=jd&&navigator.hardwareConcurrency&&(H0e=navigator.hardwareConcurrency)}catch{}var jrt={chunkSize:512*1024,maxWorkers:H0e,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Gi,CompressionStreamNative:typeof CompressionStream!=jd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=jd&&DecompressionStream},Gy=Object.assign({},jrt);function Tw(){return Gy}function $U(e){return Math.max(e.chunkSize,Qrt)}function NV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:h}=e;if(Zy("baseURL",t),Zy("chunkSize",n),Zy("maxWorkers",i),Zy("terminateWorkerTimeout",o),Zy("useCompressionStream",r),Zy("useWebWorkers",s),a&&(Gy.CompressionStream=new _w(a)),c&&(Gy.DecompressionStream=new _w(c)),Zy("CompressionStream",d),Zy("DecompressionStream",u),h!==Gi){let{deflate:p,inflate:g}=h;if((p||g)&&(Gy.workerScripts||(Gy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Gy.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");Gy.workerScripts.inflate=g}}}function Zy(e,t){t!==Gi&&(Gy[e]=t)}var JLi=T(S(),1);var URi=T(S(),1);var WRi=T(S(),1);var ERi=T(S(),1);var eRi=T(S(),1);var jLi=T(S(),1),z0e=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;z0e[e]=t}var u0=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^z0e[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var Sw=class extends TransformStream{constructor(){let t,n=new u0;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var xRi=T(S(),1);var iRi=T(S(),1);function kV(e){if(typeof TextEncoder==jd){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var rRi=T(S(),1),ml={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=ml.getPartial(n);return i===32?e.concat(t):ml._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+ml.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=ml.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=ml.getPartial(o);return i.push(ml.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Cw={bytes:{fromBits(e){let n=ml.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)(r&3)===0&&(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(ml.partial(8*(n&3),i)),t}}},K0e={};K0e.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=Cw.utf8String.toBits(e));let n=t._buffer=ml.concat(t._buffer,e),i=t._length,o=t._length=i+ml.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=ml.concat(t,[ml.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var w4={};w4.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[u]=h,i[h]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,g=o[h]*257^h*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>8,t[f][h]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],f=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L<i;L++)_=s[h>>>24]^a[p>>16&255]^c[g>>8&255]^d[f&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[h&255]^n[x+1],V=s[g>>>24]^a[f>>16&255]^c[h>>8&255]^d[p&255]^n[x+2],f=s[f>>>24]^a[h>>16&255]^c[p>>8&255]^d[g&255]^n[x+3],x+=4,h=_,p=C,g=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[h>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[x++],_=h,h=p,p=g,g=f,f=_;return o}};var J0e={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},F4={};F4.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=ml.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return ml.clamp(t,o)}};var Ey={importKey(e){return new Ey.hmacSha1(Cw.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),h=new DataView(u),p=0,g=ml;for(t=Cw.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};Ey.hmacSha1=class{constructor(e){let t=this,n=t._hash=K0e.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var hRi=T(S(),1);var qrt=typeof crypto!=jd&&typeof crypto.getRandomValues==d0,Iy="Invalid password",UT="Invalid signature",m0="zipjs-abort-check-password";function eD(e){return qrt?crypto.getRandomValues(e):J0e.getRandomValues(e)}var UV=16,$rt="raw",q0e={name:"PBKDF2"},est={name:"HMAC"},tst="SHA-1",nst=Object.assign({hash:est},q0e),A4=Object.assign({iterations:1e3,hash:{name:tst}},q0e),ist=["deriveBits"],Lw=[8,12,16],Vw=[16,24,32],Xy=10,ost=[0,0,0,0],iD=typeof crypto!=jd,Gw=iD&&crypto.subtle,$0e=iD&&typeof Gw!=jd,Qf=Cw.bytes,rst=w4.aes,sst=F4.ctrGladman,ast=Ey.hmacSha1,Q0e=iD&&$0e&&typeof Gw.importKey==d0,j0e=iD&&$0e&&typeof Gw.deriveBits==d0,tD=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:nge(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:h,ready:p}=c;d?(await cst(c,u,d,mm(s,0,Lw[u]+2)),s=mm(s,Lw[u]+2),r?a.error(new Error(m0)):h()):await p;let g=new Uint8Array(s.length-Xy-(s.length-Xy)%UV);a.enqueue(ege(c,s,g,0,Xy,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:h}=this;if(d&&c){await h;let p=mm(u,0,u.length-Xy),g=mm(u,u.length-Xy),f=new Uint8Array;if(p.length){let x=Zw(Qf,p);d.update(x);let _=c.update(x);f=Rw(Qf,_)}if(a){let x=mm(Rw(Qf,d.digest()),0,Xy);for(let _=0;_<Xy;_++)if(x[_]!=g[_])throw new Error(UT)}s.enqueue(f)}}})}},nD=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:nge(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:h}=a,p=new Uint8Array;c?(p=await lst(a,d,c),u()):await h;let g=new Uint8Array(p.length+r.length-r.length%UV);g.set(p,0),s.enqueue(ege(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let h=s.update(Zw(Qf,c));a.update(h),u=Rw(Qf,h)}o.signature=Rw(Qf,a.digest()).slice(0,Xy),r.enqueue(M4(u,o.signature))}}}),o=this}};function ege(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=M4(c,t),n=mst(n,d-d%UV));let u;for(u=0;u<=d-UV;u+=UV){let h=Zw(Qf,mm(t,u,u+UV));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(Rw(Qf,p),u+i)}return e.pending=mm(t,u),n}async function cst(e,t,n,i){let o=await tge(e,t,n,mm(i,0,Lw[t])),r=mm(i,Lw[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Iy)}async function lst(e,t,n){let i=eD(new Uint8Array(Lw[t])),o=await tge(e,t,n,i);return M4(i,o)}async function tge(e,t,n,i){e.password=null;let o=await dst($rt,n,nst,!1,ist),r=await ust(Object.assign({salt:i},A4),o,8*(Vw[t]*2+2)),s=new Uint8Array(r),a=Zw(Qf,mm(s,0,Vw[t])),c=Zw(Qf,mm(s,Vw[t],Vw[t]*2)),d=mm(s,Vw[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new sst(new rst(a),Array.from(ost)),hmac:new ast(c)}),d}async function dst(e,t,n,i,o){if(Q0e)try{return await Gw.importKey(e,t,n,i,o)}catch{return Q0e=!1,Ey.importKey(t)}else return Ey.importKey(t)}async function ust(e,t,n){if(j0e)try{return await Gw.deriveBits(e,t,n)}catch{return j0e=!1,Ey.pbkdf2(t,e.salt,A4.iterations,n)}else return Ey.pbkdf2(t,e.salt,A4.iterations,n)}function nge(e,t){return t===Gi?kV(e):t}function M4(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function mst(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function mm(e,t,n){return e.subarray(t,n)}function Rw(e,t){return e.fromBits(t)}function Zw(e,t){return e.toBits(t)}var CRi=T(S(),1);var DV=12,oD=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),sge(this,t)},transform(o,r){let s=this;if(s.password){let a=ige(s,o.subarray(0,DV));if(s.password=null,a[DV-1]!=s.passwordVerification)throw new Error(Iy);o=o.subarray(DV)}i?r.error(new Error(m0)):r.enqueue(ige(s,o))}})}},rD=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),sge(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=eD(new Uint8Array(DV));c[DV-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(oge(r,c),0),a=DV}else s=new Uint8Array(i.length),a=0;s.set(oge(r,i),a),o.enqueue(s)}})}};function ige(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=age(e)^t[i],N4(e,n[i]);return n}function oge(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=age(e)^t[i],N4(e,t[i]);return n}function sge(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new u0(n[0]),crcKey2:new u0(n[2])});for(let i=0;i<t.length;i++)N4(e,t.charCodeAt(i))}function N4(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=rge(Math.imul(rge(i+cge(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function age(e){let t=e.keys[2]|2;return cge(Math.imul(t,t^1)>>>8)}function cge(e){return e&255}function rge(e){return e&4294967295}var lge="deflate-raw",sD=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,h=this,p,g,f=dge(super.readable);(!s||c)&&d&&(p=new Sw,f=jf(f,p)),r&&(f=mge(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=jf(f,new rD(t)):(g=new nD(t),f=jf(f,g))),uge(h,f,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&d&&(x=new DataView(p.value.buffer).getUint32(0)),h.signature=x})}},aD=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u}=t,h,p,g=dge(super.readable);s&&(r?g=jf(g,new oD(t)):(p=new tD(t),g=jf(g,p))),d&&(g=mge(g,u,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new Sw,g=jf(g,h)),uge(this,g,()=>{if((!s||r)&&a){let f=new DataView(h.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(UT)}})}};function dge(e){return jf(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function uge(e,t,n){t=jf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function mge(e,t,n,i,o){try{let r=t&&i?i:o;e=jf(e,new r(lge,n))}catch{if(t)try{e=jf(e,new o(lge,n))}catch{return e}else return e}return e}function jf(e,t){return e.pipeThrough(t)}var hge="message",fge="start",pge="pull",k4="data",bge="ack",U4="close",dD="deflate",uD="inflate";var cD=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(dD)?r=sD:o.startsWith(uD)&&(r=aD);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(c).pipeThrough(h)}})}},lD=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var FRi=T(S(),1);var xge=typeof Worker!=jd;var BV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:d},u){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new lD(r.chunkSize)).pipeThrough(new B4(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&xge?hst:_ge)(t,r)}},B4=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await D4(n,o)},async transform(a,c){s+=a.length,i&&await D4(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await D4(r,s)}})}};async function D4(e,...t){try{await e(...t)}catch{}}function _ge(e,t){return{run:()=>fst(e,t)}}function hst(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=gst(e.scripts[0],n,e)}catch{return xge=!1,_ge(e,t)}Object.assign(e,{worker:o,interface:{run:()=>pst(e,{chunkSize:i})}})}return e.interface}async function fst({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new cD(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function pst(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:d}=bst(e.writable),u=mD({type:fge,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);u||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let h=await o;return u||await c.getWriter().close(),await d,h}function bst(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var gge=!0,yge=!0;function gst(e,t,n){let i={type:"module"},o,r;typeof e==d0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(gge)try{r=new Worker(o)}catch{gge=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(hge,s=>yst(s,n)),r}function mD(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&yge?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{yge=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function yst({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:h}=t;try{if(s){let{message:g,stack:f,code:x,name:_}=s,C=new Error(g);Object.assign(C,{stack:f,code:x,name:_}),p(C)}else{if(n==pge){let{value:g,done:f}=await a.read();mD({type:k4,value:g,done:f,messageId:o},t)}n==k4&&(await c.ready,await c.write(new Uint8Array(i)),mD({type:bge,messageId:o},t)),n==U4&&p(null,r)}}catch(g){mD({type:U4,messageId:o},t),p(g)}function p(g,f){g?u(g):d(f),c&&c.releaseLock(),h()}}var DT=[],O4=[];var Tge=0;async function hD(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:d,encrypted:u}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Gi;let g=!c&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Gi&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Gi&&i.useCompressionStream,(await f()).run();async function f(){let _=DT.find(C=>!C.busy);if(_)return Sge(_),new BV(_,e,t,x);if(DT.length<p){let C={indexWorker:Tge};return Tge++,DT.push(C),new BV(C,e,t,x)}else return new Promise(C=>O4.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(O4.length){let[{resolve:C,stream:V,workerOptions:L}]=O4.splice(0,1);C(new BV(_,V,L,x))}else _.worker?(Sge(_),xst(_,t)):DT=DT.filter(C=>C!=_)}}function xst(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{DT=DT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Sge(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var YRi=T(S(),1);var _st="Writer iterator completed too soon",Tst="text/plain";var Sst="Content-Type";var Cst=64*1024,z4="writable",OV=class{constructor(){this.size=0}init(){this.initialized=!0}},fD=class extends OV{get readable(){let t=this,{chunkSize:n=Cst}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Da(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},Y4=class extends OV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,z4,{get(){return n}})}writeUint8Array(){}};var pD=class extends Y4{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},h0=class extends fD{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},Ew=class extends OV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([Sst,t]),Object.defineProperty(n,z4,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},bD=class extends h0{constructor(t){super(new Blob([t],{type:Tst}))}},gD=class extends Ew{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var H4=class extends fD{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let d=r[a],u=d.size;if(c+n<=u)s=await Da(d,c,n);else{let h=u-c;s=new Uint8Array(n),s.set(await Da(d,c,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},yD=class extends OV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:h}=i;if(s)u.length>=h?(await c(u.slice(0,h)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(h))):await c(u);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(_st);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await $f(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,z4,{get(){return a}});async function c(u){let h=u.length;h&&(await s.ready,await s.write(u),o.size+=h,i.size+=h,i.availableSize-=h)}async function d(){r.size=o.size,await s.close()}}};async function $f(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function xD(e){return Array.isArray(e)&&(e=new H4(e)),e instanceof ReadableStream&&(e={readable:e}),e}function _D(e){e.writable===Gi&&typeof e.next==d0&&(e=new yD(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Gi&&(t.size=0),e instanceof yD||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Da(e,t,n,i){return e.readUint8Array(t,n,i)}var aZi=T(S(),1);var QRi=T(S(),1);var zRi=T(S(),1),Cge="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Vst=Cge.length==256;function Vge(e){if(Vst){let t="";for(let n=0;n<e.length;n++)t+=Cge[e[n]];return t}else return new TextDecoder().decode(e)}function Iw(e,t){return t&&t.trim().toLowerCase()=="cp437"?Vge(e):new TextDecoder(t).decode(e)}var qRi=T(S(),1),K4="filename",J4="rawFilename",Q4="comment",j4="rawComment",q4="uncompressedSize",$4="compressedSize",ej="offset",TD="diskNumberStart",YV="lastModDate",SD="rawLastModDate",Xw="lastAccessDate",Lge="rawLastAccessDate",Ww="creationDate",Rge="rawCreationDate",tj="internalFileAttribute",nj="internalFileAttributes",ij="externalFileAttribute",oj="externalFileAttributes",rj="msDosCompatible",CD="zip64",sj="encrypted",aj="version",cj="versionMadeBy",lj="zipCrypto",dj="directory",uj="executable",Lst=[K4,J4,$4,q4,YV,SD,Q4,j4,Xw,Ww,ej,TD,TD,tj,nj,ij,oj,rj,CD,sj,aj,cj,lj,dj,uj,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Wy=class{constructor(t){Lst.forEach(n=>this[n]=t[n])}};var mj="File format is not recognized",Est="End of central directory not found",Ist="End of Zip64 central directory locator not found",Xst="Central directory header not found",Wst="Local file header not found",Pst="Zip64 extra field not found",vst="File contains encrypted entry",wst="Encryption method not supported",Zge="Compression method not supported",Gge="Split zip file",Ege="utf-8",Ige="cp437",Fst=[[q4,4294967295],[$4,4294967295],[ej,4294967295],[TD,65535]],Ast={[65535]:{getValue:ys,bytes:4},[4294967295]:{getValue:VD,bytes:8}},PD=class{constructor(t,n={}){Object.assign(this,{reader:xD(t),options:n,config:Tw()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await $f(i),(i.size===Gi||!i.readUint8Array)&&(i=new h0(await new Response(i.readable).blob()),await $f(i)),i.size<22)throw new Error(mj);i.chunkSize=$U(o);let r=await Dst(i,101010256,i.size,22,65535*16);if(!r){let M=await Da(i,0,4),b=_a(M);throw ys(b)==134695760?new Error(Gge):new Error(Est)}let s=_a(r),a=ys(s,12),c=ys(s,16),d=r.offset,u=xa(s,20),h=d+22+u,p=xa(s,4),g=i.lastDiskNumber||0,f=xa(s,6),x=xa(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||f==65535){let M=await Da(i,r.offset-20,20),b=_a(M);if(ys(b,0)==117853008){c=VD(b,8);let Z=await Da(i,c,56,-1),E=_a(Z),X=r.offset-20-56;if(ys(E,0)!=101075792&&c!=X){let F=c;c=X,_=c-F,Z=await Da(i,c,56,-1),E=_a(Z)}if(ys(E,0)!=101075792)throw new Error(Ist);p==65535&&(p=ys(E,16)),f==65535&&(f=ys(E,20)),x==65535&&(x=VD(E,32)),a==4294967295&&(a=VD(E,40)),c-=a}}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(Gge);if(c<0)throw new Error(mj);let V=0,L=await Da(i,c,a,f),R=_a(L);if(a){let M=r.offset-a;if(ys(R,V)!=33639248&&c!=M){let b=c;c=M,_+=c-b,L=await Da(i,c,a,f),R=_a(L)}}let G=r.offset-c-(i.lastDiskOffset||0);if(a!=G&&G>=0&&(a=G,L=await Da(i,c,a,f),R=_a(L)),c<0||c>=i.size)throw new Error(mj);let I=hl(n,t,"filenameEncoding"),v=hl(n,t,"commentEncoding");for(let M=0;M<x;M++){let b=new fj(i,o,n.options);if(ys(R,V)!=33639248)throw new Error(Xst);Wge(b,R,V+6);let Z=!!b.bitFlag.languageEncodingFlag,E=V+46,X=E+b.filenameLength,F=X+b.extraFieldLength,N=xa(R,V+4),O=N>>8==0,U=N>>8==3,Y=L.subarray(E,X),k=xa(R,V+32),H=F+k,K=L.subarray(F,H),te=Z,z=Z,j=ys(R,V+38),ee=O&&(HV(R,V+38)&16)==16||U&&(j>>16&16384)==16384||Y.length&&Y[Y.length-1]==kT.charCodeAt(0),fe=U&&(j>>16&73)==73,Te=ys(R,V+42)+_;Object.assign(b,{versionMadeBy:N,msDosCompatible:O,compressedSize:0,uncompressedSize:0,commentLength:k,directory:ee,offset:Te,diskNumberStart:xa(R,V+34),internalFileAttributes:xa(R,V+36),externalFileAttributes:j,rawFilename:Y,filenameUTF8:te,commentUTF8:z,rawExtraField:L.subarray(X,F),executable:fe}),b.internalFileAttribute=b.internalFileAttributes,b.externalFileAttribute=b.externalFileAttributes;let de=hl(n,t,"decodeText")||Iw,xe=te?Ege:I||Ige,Ce=z?Ege:v||Ige,Ie=de(Y,xe);Ie===Gi&&(Ie=Iw(Y,xe));let Le=de(K,Ce);Le===Gi&&(Le=Iw(K,Ce)),Object.assign(b,{rawComment:K,filename:Ie,comment:Le,directory:ee||Ie.endsWith(kT)}),C=Math.max(Te,C),Pge(b,b,R,V+6),b.zipCrypto=b.encrypted&&!b.extraFieldAES;let Ne=new Wy(b);Ne.getData=(qe,Rt)=>b.getData(qe,Ne,Rt),V=H;let{onprogress:Oe}=t;if(Oe)try{await Oe(M+1,x,new Wy(b))}catch{}yield Ne}let P=hl(n,t,"extractPrependedData"),w=hl(n,t,"extractAppendedData");return P&&(n.prependedData=C>0?await Da(i,0,C):new Uint8Array),n.comment=u?await Da(i,d+22,u):new Uint8Array,w&&(n.appendedData=h<i.size?await Da(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var fj=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:d,config:u,bitFlag:h,signature:p,rawLastModDate:g,uncompressedSize:f,compressedSize:x}=o,_=n.localDirectory={},C=await Da(r,s,30,a),V=_a(C),L=hl(o,i,"password"),R=hl(o,i,"rawPassword"),G=hl(o,i,"passThrough");if(L=L&&L.length&&L,R=R&&R.length&&R,c&&c.originalCompressionMethod!=99)throw new Error(Zge);if(d!=0&&d!=8&&!G)throw new Error(Zge);if(ys(V,0)!=67324752)throw new Error(Wst);Wge(_,V,4),_.rawExtraField=_.extraFieldLength?await Da(r,s+30+_.filenameLength,_.extraFieldLength,a):new Uint8Array,Pge(o,_,V,4,!0),Object.assign(n,{lastAccessDate:_.lastAccessDate,creationDate:_.creationDate});let I=o.encrypted&&_.encrypted&&!G,v=I&&!c;if(G||(n.zipCrypto=v),I){if(!v&&c.strength===Gi)throw new Error(wst);if(!L&&!R)throw new Error(vst)}let P=s+30+_.filenameLength+_.extraFieldLength,w=x,M=r.readable;Object.assign(M,{diskNumberStart:a,offset:P,size:w});let b=hl(o,i,"signal"),Z=hl(o,i,"checkPasswordOnly");Z&&(t=new WritableStream),t=_D(t),await $f(t,G?x:f);let{writable:E}=t,{onstart:X,onprogress:F,onend:N}=i,O={options:{codecType:uD,password:L,rawPassword:R,zipCrypto:v,encryptionStrength:c&&c.strength,signed:hl(o,i,"checkSignature")&&!G,passwordVerification:v&&(h.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!G,encrypted:o.encrypted&&!G,useWebWorkers:hl(o,i,"useWebWorkers"),useCompressionStream:hl(o,i,"useCompressionStream"),transferStreams:hl(o,i,"transferStreams"),checkPasswordOnly:Z},config:u,streamOptions:{signal:b,size:w,onstart:X,onprogress:F,onend:N}},U=0;try{({outputSize:U}=await hD({readable:M,writable:E},O))}catch(Y){if(!Z||Y.message!=m0)throw Y}finally{let Y=hl(o,i,"preventClose");E.size+=U,!Y&&!E.locked&&await E.getWriter().close()}return Z?Gi:t.getData?t.getData():E}};function Wge(e,t,n){let i=e.rawBitFlag=xa(t,n+2),o=(i&1)==1,r=ys(t,n+6);Object.assign(e,{encrypted:o,version:xa(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Bst(r),filenameLength:xa(t,n+22),extraFieldLength:xa(t,n+24)})}function Pge(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=_a(new Uint8Array(r)),c=0;try{for(;c<r.length;){let C=xa(a,c),V=xa(a,c+2);s.set(C,{type:C,data:r.slice(c+4,c+4+V)}),c+=4+V}}catch{}let d=xa(n,i+4);Object.assign(t,{signature:ys(n,i+10),uncompressedSize:ys(n,i+18),compressedSize:ys(n,i+14)});let u=s.get(1);u&&(Mst(u,t),t.extraFieldZip64=u);let h=s.get(28789);h&&(Xge(h,K4,J4,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(Xge(p,Q4,j4,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(Nst(g,t,d),t.extraFieldAES=g):t.compressionMethod=d;let f=s.get(10);f&&(kst(f,t),t.extraFieldNTFS=f);let x=s.get(21589);x&&(Ust(x,t,o),t.extraFieldExtendedTimestamp=x);let _=s.get(6534);_&&(t.extraFieldUSDZ=_)}function Mst(e,t){t.zip64=!0;let n=_a(e.data),i=Fst.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=Ast[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Pst)}}function Xge(e,t,n,i,o){let r=_a(e.data),s=new u0;s.append(o[n]);let a=_a(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=ys(r,1);Object.assign(e,{version:HV(r,0),[t]:Iw(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==ys(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Nst(e,t,n){let i=_a(e.data),o=HV(i,4);Object.assign(e,{vendorVersion:HV(i,0),vendorId:HV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:xa(i,5)}),t.compressionMethod=e.compressionMethod}function kst(e,t){let n=_a(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=xa(n,i),s=xa(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=_a(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let d=hj(s),u=hj(a),h=hj(c),p={lastModDate:d,lastAccessDate:u,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function Ust(e,t,n){let i=_a(e.data),o=HV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(YV),s.push(SD)),(o&2)==2&&(r.push(Xw),s.push(Lge)),(o&4)==4&&(r.push(Ww),s.push(Rge))):e.data.length>=5&&(r.push(YV),s.push(SD));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=ys(i,a);t[c]=e[c]=new Date(u*1e3);let h=s[d];e[h]=u}a+=4})}async function Dst(e,t,n,i,o){let r=new Uint8Array(4),s=_a(r);Ost(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,h=await Da(e,u,d);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:u+p,buffer:h.slice(p,p+i).buffer}}}function hl(e,t,n){return t[n]===Gi?e.options[n]:t[n]}function Bst(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function hj(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function HV(e,t){return e.getUint8(t)}function xa(e,t){return e.getUint16(t,!0)}function ys(e,t){return e.getUint32(t,!0)}function VD(e,t){return Number(e.getBigUint64(t,!0))}function Ost(e,t,n){e.setUint32(t,n,!0)}function _a(e){return new DataView(e.buffer)}var pZi=T(S(),1);var Kst="File already exists",Jst="Zip file comment exceeds 64KB",Qst="File entry comment exceeds 64KB",jst="File entry name exceeds 64KB",Age="Version exceeds 65535",qst="The strength must equal 1, 2, or 3",$st="Extra field type exceeds 65535",eat="Extra field data exceeds 64KB",Ej="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",tat="Undefined uncompressed size",Mge=new Uint8Array([7,0,2,0,65,69,3,0,0]),Rj=0,Nge=[],FD=class{constructor(t,n={}){t=_D(t);let i=t.availableSize!==Gi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Gi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:Tw(),files:new Map,filenames:new Set,offset:n.offset===Gi?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;Rj<s.maxWorkers?Rj++:await new Promise(c=>Nge.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Kst);return o.filenames.add(t),a=nat(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=Nge.shift();c?c():Rj--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await uat(this,t,n),Ji(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function nat(e,t,n,i){t=t.trim();let o=Ji(e,i,rj),r=Ji(e,i,cj,o?20:768),s=Ji(e,i,uj);if(r>65535)throw new Error(Age);let a=Ji(e,i,oj,0);a===0&&(a=Ji(e,i,ij,0)),!i.directory&&t.endsWith(kT)&&(i.directory=!0),Ji(e,i,dj)?(t.endsWith(kT)||(t+=kT),a===0&&(o?a=16:a=16384<<16)):!o&&a===0&&(s?a=493<<16:a=420<<16);let d=Ji(e,i,"encodeText",kV),u=d(t);if(u===Gi&&(u=kV(t)),ji(u)>65535)throw new Error(jst);let h=i.comment||"",p=d(h);if(p===Gi&&(p=kV(h)),ji(p)>65535)throw new Error(Qst);let g=Ji(e,i,aj,20);if(g>65535)throw new Error(Age);let f=Ji(e,i,YV,new Date),x=Ji(e,i,Xw),_=Ji(e,i,Ww),C=Ji(e,i,nj,0);C===0&&(C=Ji(e,i,tj,0));let V=Ji(e,i,"passThrough"),L,R;V||(L=Ji(e,i,"password"),R=Ji(e,i,"rawPassword"));let G=Ji(e,i,"encryptionStrength",3),I=Ji(e,i,lj),v=Ji(e,i,"extendedTimestamp",!0),P=Ji(e,i,"keepOrder",!0),w=Ji(e,i,"level"),M=Ji(e,i,"useWebWorkers"),b=Ji(e,i,"bufferedWrite"),Z=Ji(e,i,"dataDescriptorSignature",!1),E=Ji(e,i,"signal"),X=Ji(e,i,"useUnicodeFileNames",!0),F=Ji(e,i,"useCompressionStream"),N=Ji(e,i,"compressionMethod"),O=Ji(e,i,"dataDescriptor",!0),U=Ji(e,i,CD);if(!I&&(L!==Gi||R!==Gi)&&!(G>=1&&G<=3))throw new Error(qst);let Y=new Uint8Array,{extraField:k}=i;if(k){let ke=0,zt=0;k.forEach(ut=>ke+=4+ji(ut)),Y=new Uint8Array(ke),k.forEach((ut,mt)=>{if(mt>65535)throw new Error($st);if(ji(ut)>65535)throw new Error(eat);Xs(Y,new Uint16Array([mt]),zt),Xs(Y,new Uint16Array([ji(ut)]),zt+2),Xs(Y,ut,zt+4),zt+=4+ji(ut)})}let H=0,K=0,te=0;if(V&&({uncompressedSize:te}=i,te===Gi))throw new Error(tat);let z=U===!0;n&&(n=xD(n),await $f(n),V?H=kge(te):n.size===Gi?(O=!0,(U||U===Gi)&&(U=!0,te=H=4294967296)):(te=n.size,H=kge(te)));let{diskOffset:j,diskNumber:ee,maxSize:fe}=e.writer,Te=z||te>4294967295,de=z||H>4294967295,xe=z||e.offset+e.pendingEntriesSize-j>4294967295,Ie=Ji(e,i,"supportZip64SplitFile",!0)&&z||ee+Math.ceil(e.pendingEntriesSize/fe)>65535;if(xe||Te||de||Ie){if(U===!1||!P)throw new Error(Ej);U=!0}U=U||!1;let Le=Ji(e,i,sj),{signature:Ne}=i;i=Object.assign({},i,{rawFilename:u,rawComment:p,version:g,versionMadeBy:r,lastModDate:f,lastAccessDate:x,creationDate:_,rawExtraField:Y,zip64:U,zip64UncompressedSize:Te,zip64CompressedSize:de,zip64Offset:xe,zip64DiskNumberStart:Ie,password:L,rawPassword:R,level:!F&&e.config.CompressionStream===Gi&&e.config.CompressionStreamNative===Gi?0:w,useWebWorkers:M,encryptionStrength:G,extendedTimestamp:v,zipCrypto:I,bufferedWrite:b,keepOrder:P,useUnicodeFileNames:X,dataDescriptor:O,dataDescriptorSignature:Z,signal:E,msDosCompatible:o,internalFileAttribute:C,internalFileAttributes:C,externalFileAttribute:a,externalFileAttributes:a,useCompressionStream:F,passThrough:V,encrypted:!!(L&&ji(L)||R&&ji(R))||V&&Le,signature:Ne,compressionMethod:N});let Oe=rat(i),qe=aat(i),Rt=ji(Oe.localHeaderArray,qe.dataDescriptorArray);K=Rt+H,e.options.usdz&&(K+=K+64),e.pendingEntriesSize+=K;let Lt;try{Lt=await iat(e,t,n,{headerInfo:Oe,dataDescriptorInfo:qe,metadataSize:Rt},i)}finally{e.pendingEntriesSize-=K}return Object.assign(Lt,{name:t,comment:h,extraField:k}),new Wy(Lt)}async function iat(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},f,x,_,C,V,L,R;r.set(t,g);try{let P;a&&(P=p&&p.lock,G()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(L=new TransformStream,R=new Response(L.readable).blob(),L.writable.size=0,f=!0,e.bufferedWrites++,await $f(s)):(L=s,await I()),await $f(L);let{writable:w}=s,{diskOffset:M}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let Z=new Uint8Array(4),E=Ba(Z);Qi(E,0,134695760),await ep(w,Z),e.offset+=4}h&&sat(i,e.offset-M),f||(await P,await v(w));let{diskNumber:b}=s;if(V=!0,g.diskNumberStart=b,g=await oat(n,L,g,i,e.config,o),V=!1,r.set(t,g),g.filename=t,f){await L.writable.getWriter().close();let Z=await R;await P,await I(),C=!0,c||(Z=await lat(g,Z,w,o)),await v(w),g.diskNumberStart=s.diskNumber,M=s.diskOffset,await Z.stream().pipeTo(w,{preventClose:!0,preventAbort:!0,signal:d}),w.size+=Z.size,C=!1}if(g.offset=e.offset-M,g.zip64)dat(g,o);else if(g.offset>4294967295)throw new Error(Ej);return e.offset+=g.size,g}catch(P){if(f&&C||!f&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}f?e.offset+=L.writable.size:e.offset=L.writable.size}throw r.delete(t),P}finally{f&&e.bufferedWrites--,_&&_(),x&&x()}function G(){g.lock=new Promise(P=>_=P)}async function I(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(w=>x=()=>{e.writerLocked=!1,w()}),await P}async function v(P){ji(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await ep(P,new Uint8Array))}}async function oat(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:R,rawExtraFieldAES:G}=a,{dataDescriptorArray:I}=c,{rawFilename:v,lastAccessDate:P,creationDate:w,password:M,rawPassword:b,level:Z,zip64:E,zip64UncompressedSize:X,zip64CompressedSize:F,zip64Offset:N,zip64DiskNumberStart:O,zipCrypto:U,dataDescriptor:Y,directory:k,executable:H,versionMadeBy:K,rawComment:te,rawExtraField:z,useWebWorkers:j,onstart:ee,onprogress:fe,onend:Te,signal:de,encryptionStrength:xe,extendedTimestamp:Ce,msDosCompatible:Ie,internalFileAttributes:Le,externalFileAttributes:Ne,useCompressionStream:Oe,passThrough:qe}=s,Rt={lock:i,versionMadeBy:K,zip64:E,directory:!!k,executable:!!H,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:te,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:R,rawExtraFieldAES:G,rawExtraField:z,extendedTimestamp:Ce,msDosCompatible:Ie,internalFileAttributes:Le,externalFileAttributes:Ne,diskNumberStart:n},{signature:Lt,uncompressedSize:ke}=s,zt=0;qe||(ke=0);let{writable:ut}=t;if(e){e.chunkSize=$U(r),await ep(ut,u);let Pn=e.readable,cn=Pn.size=e.size,ge={options:{codecType:dD,level:Z,rawPassword:b,password:M,encryptionStrength:xe,zipCrypto:f&&U,passwordVerification:f&&U&&g>>8&255,signed:!qe,compressed:x&&!qe,encrypted:f&&!qe,useWebWorkers:j,useCompressionStream:Oe,transferStreams:!1},config:r,streamOptions:{signal:de,size:cn,onstart:ee,onprogress:fe,onend:Te}},Ve=await hD({readable:Pn,writable:ut},ge);zt=Ve.outputSize,qe||(ke=Ve.inputSize,Lt=Ve.signature),ut.size+=ke}else await ep(ut,u);let mt;if(E){let Pn=4;X&&(Pn+=8),F&&(Pn+=8),N&&(Pn+=8),O&&(Pn+=4),mt=new Uint8Array(Pn)}else mt=new Uint8Array;return cat({signature:Lt,rawExtraFieldZip64:mt,compressedSize:zt,uncompressedSize:ke,headerInfo:a,dataDescriptorInfo:c},s),Y&&await ep(ut,I),Object.assign(Rt,{uncompressedSize:ke,compressedSize:zt,lastModDate:p,rawLastModDate:g,creationDate:w,lastAccessDate:P,encrypted:f,zipCrypto:U,size:d+zt,compressionMethod:C,version:_,headerArray:h,signature:Lt,rawExtraFieldZip64:mt,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:X,zip64CompressedSize:F,zip64Offset:N,zip64DiskNumberStart:O}),Rt}function rat(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:f}=e,{version:x,compressionMethod:_}=e,C=!u&&(r>0||r===Gi&&_!==0),V;if(f&&!a){V=new Uint8Array(ji(Mge)+2);let N=Ba(V);oo(N,0,39169),Xs(V,Mge,2),Gj(N,8,p)}else V=new Uint8Array;let L,R,G;if(g){R=new Uint8Array(9+(i?4:0)+(o?4:0));let N=Ba(R);oo(N,0,21589),oo(N,2,ji(R)-4),G=1+(i?2:0)+(o?4:0),Gj(N,4,G);let O=5;Qi(N,O,Math.floor(n.getTime()/1e3)),O+=4,i&&(Qi(N,O,Math.floor(i.getTime()/1e3)),O+=4),o&&Qi(N,O,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let U=Ba(L),Y=Zj(n);oo(U,0,10),oo(U,2,32),oo(U,8,1),oo(U,10,24),ql(U,12,Y),ql(U,20,Zj(i)||Y),ql(U,28,Zj(o)||Y)}catch{L=new Uint8Array}}else L=R=new Uint8Array;let I=0;c&&(I=I|2048),d&&(I=I|8),_===Gi&&(_=C?8:0),_==8&&(r>=1&&r<3&&(I=I|6),r>=3&&r<5&&(I=I|1),r===9&&(I=I|2)),s&&(x=x>45?x:45),f&&(I=I|1,a||(x=x>51?x:51,V[9]=_,_=99));let v=new Uint8Array(26),P=Ba(v);oo(P,0,x),oo(P,2,I),oo(P,4,_);let w=new Uint32Array(1),M=Ba(w),b;n<v4?b=v4:n>P4?b=P4:b=n,oo(M,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),oo(M,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let Z=w[0];Qi(P,6,Z),oo(P,22,ji(t));let E=ji(V,R,L,h);oo(P,24,E);let X=new Uint8Array(30+ji(t)+E),F=Ba(X);return Qi(F,0,67324752),Xs(X,v,4),Xs(X,t,30),Xs(X,V,30+ji(t)),Xs(X,R,30+ji(t,V)),Xs(X,L,30+ji(t,V,R)),Xs(X,h,30+ji(t,V,R,L)),{localHeaderArray:X,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:Z,encrypted:f,compressed:C,version:x,compressionMethod:_,extraFieldExtendedTimestampFlag:G,rawExtraFieldExtendedTimestamp:R,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:E}}function sat(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ba(i),s=64-(t+ji(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ba(a);oo(c,0,6534),oo(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(ji(d)+s),Xs(i,d),Xs(i,a,ji(d)),r=Ba(i),oo(r,28,o+s),e.metadataSize+=s}function aat(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Ba(o),i&&(s=4,Qi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function cat(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:f,zipCrypto:x,dataDescriptor:_}=t;if((!d||x)&&n!==Gi&&(Qi(c,10,n),_&&Qi(u,h,n)),p){let C=Ba(i);oo(C,0,1),oo(C,2,ji(i)-4);let V=4;g&&(Qi(c,18,4294967295),ql(C,V,BigInt(r)),V+=8),f&&(Qi(c,14,4294967295),ql(C,V,BigInt(o))),_&&(ql(u,h+4,BigInt(o)),ql(u,h+12,BigInt(r)))}else Qi(c,14,o),Qi(c,18,r),_&&(Qi(u,h+4,o),Qi(u,h+8,r))}async function lat(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Qi(r,14,e.signature),e.zip64?(Qi(r,18,4294967295),Qi(r,22,4294967295)):(Qi(r,18,e.compressedSize),Qi(r,22,e.uncompressedSize)),await ep(n,new Uint8Array(o)),t.slice(o.byteLength)}function dat(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,d=Ba(n),u=4;r&&(u+=8),s&&(u+=8),a&&(ql(d,u,BigInt(i)),u+=8),c&&Qi(d,u,o)}async function uat(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,d=0,u=e.offset-r,h=i.size;for(let[,G]of i){let{rawFilename:I,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:w,rawExtraFieldNTFS:M,rawExtraField:b,extendedTimestamp:Z,extraFieldExtendedTimestampFlag:E,lastModDate:X}=G,F;if(Z){F=new Uint8Array(9);let N=Ba(F);oo(N,0,21589),oo(N,2,5),Gj(N,4,E),Qi(N,5,Math.floor(X.getTime()/1e3))}else F=new Uint8Array;G.rawExtraFieldCDExtendedTimestamp=F,d+=46+ji(I,w,v,P,M,F,b)}let p=new Uint8Array(d),g=Ba(p);await $f(o);let f=0;for(let[G,I]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:w,rawExtraFieldAES:M,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:Z,rawExtraField:E,rawComment:X,versionMadeBy:F,headerArray:N,zip64:O,zip64UncompressedSize:U,zip64CompressedSize:Y,zip64DiskNumberStart:k,zip64Offset:H,internalFileAttributes:K,externalFileAttributes:te,diskNumberStart:z,uncompressedSize:j,compressedSize:ee}=I,fe=ji(w,M,b,Z,E);Qi(g,c,33639248),oo(g,c+4,F);let Te=Ba(N);U||Qi(Te,18,j),Y||Qi(Te,14,ee),Xs(p,N,c+6),oo(g,c+30,fe),oo(g,c+32,ji(X)),oo(g,c+34,O&&k?65535:z),oo(g,c+36,K),te&&Qi(g,c+38,te),Qi(g,c+42,O&&H?4294967295:v),Xs(p,P,c+46),Xs(p,w,c+46+ji(P)),Xs(p,M,c+46+ji(P,w)),Xs(p,b,c+46+ji(P,w,M)),Xs(p,Z,c+46+ji(P,w,M,b)),Xs(p,E,c+46+ji(P,w,M,b,Z)),Xs(p,X,c+46+ji(P)+fe);let de=46+ji(P,X)+fe;if(c-f>o.availableSize&&(o.availableSize=0,await ep(s,p.slice(f,c)),f=c),c+=de,n.onprogress)try{await n.onprogress(G+1,i.size,new Wy(I))}catch{}}await ep(s,f?p.slice(f):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=Ji(e,n,CD);if(u>4294967295||d>4294967295||h>65535||x>65535){if(C===!1)throw new Error(Ej);C=!0}let V=new Uint8Array(C?98:22),L=Ba(V);c=0,C&&(Qi(L,0,101075792),ql(L,4,BigInt(44)),oo(L,12,45),oo(L,14,45),Qi(L,16,x),Qi(L,20,a),ql(L,24,BigInt(h)),ql(L,32,BigInt(h)),ql(L,40,BigInt(d)),ql(L,48,BigInt(u)),Qi(L,56,117853008),ql(L,64,BigInt(u)+BigInt(d)),Qi(L,72,x+1),Ji(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),h=65535,u=4294967295,d=4294967295,c+=76),Qi(L,c,101010256),oo(L,c+4,x),oo(L,c+6,a),oo(L,c+8,h),oo(L,c+10,h),Qi(L,c+12,d),Qi(L,c+16,u);let R=ji(t);if(R)if(R<=65535)oo(L,c+20,R);else throw new Error(Jst);await ep(s,V),R&&await ep(s,t)}async function ep(e,t){let n=e.getWriter();try{await n.ready,e.size+=ji(t),await n.write(t)}finally{n.releaseLock()}}function Zj(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Ji(e,t,n,i){let o=t[n]===Gi?e.options[n]:t[n];return o===Gi?i:o}function kge(e){return e+5*(Math.floor(e/16383)+1)}function Gj(e,t,n){e.setUint8(t,n)}function oo(e,t,n){e.setUint16(t,n,!0)}function Qi(e,t,n){e.setUint32(t,n,!0)}function ql(e,t,n){e.setBigUint64(t,n,!0)}function Xs(e,t,n){e.set(t,n)}function Ba(e){return new DataView(e.buffer)}function ji(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}NV({Deflate:C0e,Inflate:Y0e});var GZi=T(S(),1);function mat(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Xn=mat;var IZi=T(S(),1);function hat(e,t){this.position=e,this.headingPitchRange=t}var ww=hat;var vZi=T(S(),1);function AD(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}AD.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};AD.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Bge.call(this,e,t,function(i){n.playlistIndex=0,i||Dge(n._activeEntries),n.tourEnd.raiseEvent(i)})};AD.prototype.stop=function(){Dge(this._activeEntries)};function Dge(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Bge(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=fat.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function fat(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,Bge.call(this,e,t,n)}}var Fw=AD;var kZi=T(S(),1);function MD(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}MD.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new le(this.view.position);t.flyToBoundingSphere(o,i)}};MD.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};MD.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Fr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=St(t,e)),t};var Aw=MD;var BZi=T(S(),1);function Ij(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Ij.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Ij.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var Mw=Ij;var $ge={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=ix(t),$ge[t]}},Aj;typeof DOMParser<"u"&&(Aj=new DOMParser);var pat=new NU({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Py=32,Oge=2414016,Yge=1,Hge=16093e3,zge=.1,Kge=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Jge=["http://www.google.com/kml/ext/2.2"],bat=["http://www.w3.org/2005/Atom"],Pe={kml:Kge,gx:Jge,atom:bat,kmlgx:Kge.concat(Jge)},Mj={Document:lye,Folder:wat,Placemark:Fat,NetworkLink:Yat,GroundOverlay:Dat,PhotoOverlay:mye,ScreenOverlay:Uat,Tour:Mat};function tp(e){this._dataSource=e,this._deferred=Ll(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(tp.prototype,{dataSource:{get:function(){return this._dataSource}}});tp.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};tp.prototype.addPromise=function(e){this._promises.push(e)};tp.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};tp.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=eu._getTimestamp()),this._process(e)};tp.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=eu._getTimestamp(),e._process(!0)},0)};tp.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};tp.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};tp.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=Mj[i.localName];if(l(o)&&(Pe.kml.indexOf(i.namespaceURI)!==-1||Pe.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||eu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function gat(e){let t=e.slice(0,Math.min(4,e.size)),n=Ll(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function yat(e){let t=Ll(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function eye(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function tye(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function xat(e,t){return Promise.resolve(e.getData(new gD)).then(function(n){n=eye(n),n=tye(n),t.kml=Aj.parseFromString(n,"application/xml")})}function Xj(e,t){let n=y($ge.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new pD(n))).then(function(i){t[e.filename]=i})}function qd(e,t,n,i){let o=i.keys,r=new Nw.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let h=new Nw.default(d).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function $d(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=Nj(a,i);l(c)&&s.setAttribute(n,c.url)}}function nye(e,t,n){let i=Ws(e,"id");i=l(i)&&i.length!==0?i:Hn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Hn(),l(n)&&(i=n+i)),o=t.add(new $o({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Jat),o}function kw(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function DD(e,t){if(!l(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,m.fromDegrees(i,o,r,t)}function ND(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=DD(n[s],t);return o}function vy(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ws(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Fi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Qge(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Fh(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ei(e,t,n){let i=Fi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Wn(e,t,n){let i=Fi(e,t,n);if(l(i))return i.textContent.trim()}function Ah(e,t,n){let i=Fi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function Nj(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Ze({url:o});else{let r=new Nw.default(t.getUrlComponent()),s=new Nw.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Ze({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var $l={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function wj(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?($l.maximumRed=r,$l.red=void 0):($l.maximumRed=void 0,$l.red=0),o>0?($l.maximumGreen=o,$l.green=void 0):($l.maximumGreen=void 0,$l.green=0),i>0?($l.maximumBlue=i,$l.blue=void 0):($l.maximumBlue=void 0,$l.blue=0),$l.alpha=n,B.fromRandom($l)):new B(r,o,i,n)}function BT(e,t,n){let i=Wn(e,t,n);if(l(i))return wj(i,Wn(e,"colorMode",n)==="random")}function _at(e){let t=Fi(e,"TimeStamp",Pe.kmlgx),n=Wn(t,"when",Pe.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=q.fromIso8601(n),o=new Nr;return o.addInterval(new Ln({start:i,stop:Be.MAXIMUM_VALUE})),o}function Tat(e){let t=Fi(e,"TimeSpan",Pe.kmlgx);if(!l(t))return;let n,i=Fi(t,"begin",Pe.kmlgx),o=l(i)?q.fromIso8601(i.textContent):void 0,r=Fi(t,"end",Pe.kmlgx),s=l(r)?q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(q.lessThan(s,o)){let a=o;o=s,s=a}n=new Nr,n.addInterval(new Ln({start:o,stop:s}))}else l(o)?(n=new Nr,n.addInterval(new Ln({start:o,stop:Be.MAXIMUM_VALUE}))):l(s)&&(n=new Nr,n.addInterval(new Ln({start:Be.MINIMUM_VALUE,stop:s})));return n}function iye(){let e=new pc;return e.width=Py,e.height=Py,e.scaleByDistance=new kt(Oge,Yge,Hge,zge),e.pixelOffsetScaleByDistance=new kt(Oge,Yge,Hge,zge),e}function kj(){let e=new qm;return e.outline=!0,e.outlineColor=B.WHITE,e}function oye(){let e=new jm;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=Do.FILL_AND_OUTLINE,e}function Uj(e,t,n,i,o){let r=Wn(e,"href",Pe.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(ei(e,"x",Pe.gx),0),d=y(ei(e,"y",Pe.gx),0);c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=Nj(r,n,i);if(o){let a=Wn(e,"refreshMode",Pe.kml),c=Wn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?_t(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&_t(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=y(Wn(e,"viewBoundScale",Pe.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=y(Wn(e,"viewFormat",Pe.kml),u),p=Wn(e,"httpQuery",Pe.kml);l(h)&&s.setQueryParameters(ud(UD(h))),l(p)&&s.setQueryParameters(ud(UD(p)));let g=t._ellipsoid;return Bj(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function Sat(e,t,n,i,o){let r=ei(t,"scale",Pe.kml),s=ei(t,"heading",Pe.kml),a=BT(t,"color",Pe.kml),c=Fi(t,"Icon",Pe.kml),d=Uj(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=ei(c,"x",Pe.gx),h=ei(c,"y",Pe.gx),p=ei(c,"w",Pe.gx),g=ei(c,"h",Pe.gx),f=Fi(t,"hotSpot",Pe.kml),x=vy(f,"x"),_=vy(f,"y"),C=Ws(f,"xunits"),V=Ws(f,"yunits"),L=n.billboard;l(L)||(L=iye(),n.billboard=L),L.image=d,L.scale=r,L.color=a,(l(u)||l(h)||l(p)||l(g))&&(L.imageSubRegion=new Ke(u,h,p,g)),l(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=m.UNIT_Z),r=y(r,1);let R,G;l(x)&&(C==="pixels"?R=-x*r:C==="insetPixels"?R=(x-Py)*r:C==="fraction"&&(R=-x*Py*r),R+=Py*.5*r),l(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+Py)*r:V==="fraction"&&(G=_*Py*r),G-=Py*.5*r),(l(R)||l(G))&&(L.pixelOffset=new D(R,G))}function kD(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Sat(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=oye(),n.label=c),c.scale=y(ei(a,"scale",Pe.kml),c.scale),c.fillColor=y(BT(a,"color",Pe.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new gc,n.polyline=c),c.width=ei(a,"width",Pe.kml),c.material=BT(a,"color",Pe.kml),l(BT(a,"outerColor",Pe.gx))&&_t("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ei(a,"outerWidth",Pe.gx))&&_t("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ei(a,"physicalWidth",Pe.gx))&&_t("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Ah(a,"labelVisibility",Pe.gx))&&_t("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=kj(),n.polygon=c),c.material=y(BT(a,"color",Pe.kml),c.material),c.fill=y(Ah(a,"fill",Pe.kml),c.fill),c.outline=y(Ah(a,"outline",Pe.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(wj(Wn(a,"bgColor",Pe.kml)),B.WHITE),d=y(wj(Wn(a,"textColor",Pe.kml)),B.BLACK),u=Wn(a,"text",Pe.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Wn(a,"listItemType",Pe.kml);(c==="radioFolder"||c==="checkOffOnly")&&_t(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Cat(e,t,n,i,o){let r=new $o,s,a=-1,c=t.childNodes,d=c.length;for(let h=0;h<d;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=c[a];if(h.localName==="Style")kD(e,h,r,i,o);else{let p=Fh(h,"Pair",Pe.kml);for(let g=0;g<p.length;g++){let f=p[g],x=Wn(f,"key",Pe.kml);if(x==="normal"){let _=Wn(f,"styleUrl",Pe.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let C=Fi(f,"Style",Pe.kml);kD(e,C,r,i,o)}}else _t(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let u=Wn(t,"styleUrl",Pe.kml);if(l(u)){let h=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),g=p[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(h),l(s)||(s=n.getById(`#${h}`)),l(s)&&r.merge(s)}return r}function Vat(e,t,n){return t.fetchXML().then(function(i){return rye(e,i,n,t,!0)})}function rye(e,t,n,i,o,r){let s,a,c,d,u=Qge(t,"Style",Pe.kml);if(l(u)){let x=u.length;for(s=0;s<x;s++)d=u[s],a=Ws(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new $o({id:a}),n.add(c),kD(e,d,c,i,r)))}let h=Qge(t,"StyleMap",Pe.kml);if(l(h)){let x=h.length;for(s=0;s<x;s++){let _=h[s];if(a=Ws(_,"id"),l(a)){let C=Fh(_,"Pair",Pe.kml);for(let V=0;V<C.length;V++){let L=C[V],R=Wn(L,"key",Pe.kml);if(R==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let G=Wn(L,"styleUrl",Pe.kml);if(l(G)){G[0]!=="#"&&(G=`#${G}`),o&&l(i)&&(G=i.getUrlComponent()+G);let I=n.getById(G);l(I)&&c.merge(I)}else d=Fi(L,"Style",Pe.kml),kD(e,d,c,i,r)}}else _t(`kml-styleMap-${R}`,`KML - Unsupported StyleMap key: ${R}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),f=g.length;for(s=0;s<f;s++){let x=g[s].textContent;if(x[0]!=="#"){let _=x.split("#");if(_.length===2){let C=_[0],V=i.getDerivedResource({url:C});p.push(Vat(e,V,n))}}}return p}function Dj(e,t,n){let i=new n0(e,t.id,["position"]),o=new Bf(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new gc,t.polyline.positions=new t0([i,o])}function sye(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Je.CLAMP_TO_GROUND:e==="relativeToGround"?Je.RELATIVE_TO_GROUND:e==="absolute"?Je.NONE:t==="clampToSeaFloor"?(_t("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Je.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(_t("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Je.RELATIVE_TO_GROUND):(l(e)?_t("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):_t("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Je.CLAMP_TO_GROUND)}function Lat(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Bf(e))}function Rat(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function BD(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():oye(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():iye(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(B.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new D(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function aye(e,t){let n=e.path;l(n)||(n=new ub,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Zat(e,t,n,i,o){let r=Wn(n,"coordinates",Pe.kml),s=Wn(n,"altitudeMode",Pe.kml),a=Wn(n,"altitudeMode",Pe.gx),c=Ah(n,"extrude",Pe.kml),d=e._ellipsoid,u=DD(r,d);return i.position=u,BD(e,i,o,sye(s,a)),c&&kw(s,a)&&Dj(t,i,o),!0}function jge(e,t,n,i,o){let r=Fi(n,"coordinates",Pe.kml),s=Wn(n,"altitudeMode",Pe.kml),a=Wn(n,"altitudeMode",Pe.gx),c=Ah(n,"extrude",Pe.kml),d=Ah(n,"tessellate",Pe.kml),u=kw(s,a),h=ei(n,"drawOrder",Pe.gx),p=e._ellipsoid,g=ND(r,p),f=o.polyline;if(u&&c){let x=new mb;i.wall=x,x.positions=g;let _=o.polygon;l(_)&&(x.fill=_.fill,x.material=_.material),x.outline=!0,l(f)?(x.outlineColor=l(f.material)?f.material.color:B.WHITE,x.outlineWidth=f.width):l(_)&&(x.outlineColor=l(_.material)?_.material.color:B.WHITE)}else if(e._clampToGround&&!u&&d){let x=new gc;x.clampToGround=!0,i.polyline=x,x.positions=g,l(f)?(x.material=l(f.material)?f.material.color.getValue(Be.MINIMUM_VALUE):B.WHITE,x.width=y(f.width,1)):(x.material=B.WHITE,x.width=1),x.zIndex=h}else l(h)&&_t("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&_t("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new gc,i.polyline=f,f.positions=Rat(g,s,a,p),(!d||u)&&(f.arcType=en.NONE);return!0}function Gat(e,t,n,i,o){let r=Fi(n,"outerBoundaryIs",Pe.kml),s=Fi(r,"LinearRing",Pe.kml),a=Fi(s,"coordinates",Pe.kml),c=e._ellipsoid,d=ND(a,c),u=Ah(n,"extrude",Pe.kml),h=Wn(n,"altitudeMode",Pe.kml),p=Wn(n,"altitudeMode",Pe.gx),g=kw(h,p),f=l(o.polygon)?o.polygon.clone():kj(),x=o.polyline;if(l(x)&&(f.outlineColor=l(x.material)?x.material.color:B.WHITE,f.outlineWidth=x.width),i.polygon=f,g?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new va(d),C=Fh(n,"innerBoundaryIs",Pe.kml);for(let V=0;V<C.length;V++){s=Fh(C[V],"LinearRing",Pe.kml);for(let L=0;L<s.length;L++)a=Fi(s[L],"coordinates",Pe.kml),d=ND(a,c),l(d)&&_.holes.push(new va(d))}f.hierarchy=_}return!0}function Eat(e,t,n,i,o){let r=Wn(n,"altitudeMode",Pe.kml),s=Wn(n,"altitudeMode",Pe.gx),a=Fh(n,"coord",Pe.gx),c=Fh(n,"angles",Pe.gx),d=Fh(n,"when",Pe.kml),u=Ah(n,"extrude",Pe.kml),h=kw(r,s),p=e._ellipsoid;c.length>0&&_t("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],x=[];for(let C=0;C<g;C++){let V=DD(a[C].textContent,p);f.push(V),x.push(q.fromIso8601(d[C].textContent))}let _=new ga;return _.addSamples(x,f),i.position=_,BD(e,i,o,sye(r,s)),aye(i,o),i.availability=new Nr,d.length>0&&i.availability.addInterval(new Ln({start:x[0],stop:x[x.length-1]})),h&&u&&Dj(t,i,o),!0}function qge(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],h=new ga;h.addSamples(e,t),n.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:Lat(h,s,a)})),i.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function Iat(e,t,n,i,o){let r=Ah(n,"interpolate",Pe.gx),s=Fh(n,"Track",Pe.gx),a,c,d,u=!1,h=new o0,p=new Nr,g=new ba,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=Fh(C,"when",Pe.kml),L=Fh(C,"coord",Pe.gx),R=Wn(C,"altitudeMode",Pe.kml),G=Wn(C,"altitudeMode",Pe.gx),I=kw(R,G),v=Ah(C,"extrude",Pe.kml),P=Math.min(L.length,V.length),w=[];a=[];for(let M=0;M<P;M++){let b=DD(L[M].textContent,f);w.push(b),a.push(q.fromIso8601(V[M].textContent))}r&&(l(c)&&qge([c,a[0]],[d,w[0]],g,p,h,!1,"absolute",void 0,!1),c=a[P-1],d=w[w.length-1]),qge(a,w,g,p,h,I&&v,R,G,!0),u=u||I&&v}return i.availability=p,i.position=g,BD(e,i,o),aye(i,o),u&&(Dj(t,i,o),i.polyline.show=h),!0}var cye={Point:Zat,LineString:jge,LinearRing:jge,Polygon:Gat,Track:Eat,MultiTrack:Iat,MultiGeometry:Xat,Model:Wat};function Xat(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),h=cye[u.localName];if(l(h)){let p=nye(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,u,p,o)&&(a=!0)}}return a}function Wat(e,t,n,i,o){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Pat(e,t){let n=Fi(e,"ExtendedData",Pe.kml);if(!l(n))return;l(Fi(n,"SchemaData",Pe.kml))&&_t("kml-schemaData","KML - SchemaData is unsupported"),l(Ws(n,"xmlns:prefix"))&&_t("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Fh(n,"Data",Pe.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ws(a,"name");l(c)&&(i[c]={displayName:Wn(a,"displayName",Pe.kml),value:Wn(a,"value",Pe.kml)})}}t.kml.extendedData=i}var bo;typeof document<"u"&&(bo=document.createElement("div"));function vat(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Wn(e,"description",Pe.kml),h=y(t.balloonStyle,n.balloonStyle),p=B.WHITE,g=B.BLACK,f=u;l(h)&&(p=y(h.bgColor,B.WHITE),g=y(h.textColor,B.BLACK),f=y(h.text,u));let x;if(l(f)){if(f=f.replace("$[name]",y(t.name,"")),f=f.replace("$[description]",y(u,"")),f=f.replace("$[address]",y(c.address,"")),f=f.replace("$[Snippet]",y(c.snippet,"")),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let V=f.match(/\$\[.+?\]/g);if(V!==null)for(r=0;r<V.length;r++){let L=V[r],R=L.substr(2,L.length-3),G=/\/displayName$/.test(R);R=R.replace(/\/displayName$/,""),x=d[R],l(x)&&(x=G?x.displayName:x.value),l(x)&&(f=f.replace(L,y(x,"")))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=d[s],f+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=pat.link(f),bo.innerHTML=f;let _=bo.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(qd(bo,"a","href",i),qd(bo,"link","href",i),qd(bo,"area","href",i),qd(bo,"img","src",i),qd(bo,"iframe","src",i),qd(bo,"video","src",i),qd(bo,"audio","src",i),qd(bo,"source","src",i),qd(bo,"track","src",i),qd(bo,"input","src",i),qd(bo,"embed","src",i),qd(bo,"script","src",i),qd(bo,"video","poster",i)),$d(bo,"a","href",o),$d(bo,"link","href",o),$d(bo,"area","href",o),$d(bo,"img","src",o),$d(bo,"iframe","src",o),$d(bo,"video","src",o),$d(bo,"audio","src",o),$d(bo,"source","src",o),$d(bo,"track","src",o),$d(bo,"input","src",o),$d(bo,"embed","src",o),$d(bo,"script","src",o),$d(bo,"video","poster",o);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${g.toCssColorString()};`,C+='">',C+=`${bo.innerHTML}</div>`,bo.innerHTML="",t.description=C}function OD(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=nye(t,i,n.context),c=a.kml,d=Cat(e,t,n.styleCollection,r,s),u=Wn(t,"name",Pe.kml);a.name=u,a.parent=o;let h=Tat(t);l(h)||(h=_at(t)),a.availability=h,Yj(a);function p(L){return L?L.show&&p(L.parent):!0}let g=Ah(t,"visibility",Pe.kml);a.show=p(o)&&y(g,!0);let f=Fi(t,"author",Pe.atom),x=c.author;x.name=Wn(f,"name",Pe.atom),x.uri=Wn(f,"uri",Pe.atom),x.email=Wn(f,"email",Pe.atom);let _=Fi(t,"link",Pe.atom),C=c.link;C.href=Ws(_,"href"),C.hreflang=Ws(_,"hreflang"),C.rel=Ws(_,"rel"),C.type=Ws(_,"type"),C.title=Ws(_,"title"),C.length=Ws(_,"length"),c.address=Wn(t,"address",Pe.kml),c.phoneNumber=Wn(t,"phoneNumber",Pe.kml),c.snippet=Wn(t,"Snippet",Pe.kml),Pat(t,a),vat(t,a,d,s,r);let V=e._ellipsoid;return uye(t,a,V),dye(t,a,V),l(Fi(t,"Region",Pe.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function lye(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function wat(e,t,n,i){let o=OD(e,t,n),r=Ye(n);r.parentEntity=o.entity,lye(e,t,r,i)}function Fat(e,t,n,i){let o=OD(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let h=c.item(d),p=cye[h.localName];l(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),BD(e,r,s))}var Aat={FlyTo:kat,Wait:Nat,SoundCue:Wj,AnimatedUpdate:Wj,TourControl:Wj};function Mat(e,t,n,i){let o=Wn(t,"name",Pe.kml),r=Ws(t,"id"),s=new Fw(o,r),a=Fi(t,"Playlist",Pe.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let h=d[u];if(h.localName){let p=Aat[h.localName];p?p(s,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function Wj(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function Nat(e,t){let n=ei(t,"duration",Pe.gx);e.addPlaylistEntry(new Mw(n))}function kat(e,t,n){let i=ei(t,"duration",Pe.gx),o=Wn(t,"flyToMode",Pe.gx),r={kml:{}};uye(t,r,n),dye(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new Aw(i,o,s);e.addPlaylistEntry(a)}function dye(e,t,n){let i=Fi(e,"Camera",Pe.kml);if(l(i)){let o=y(ei(i,"longitude",Pe.kml),0),r=y(ei(i,"latitude",Pe.kml),0),s=y(ei(i,"altitude",Pe.kml),0),a=y(ei(i,"heading",Pe.kml),0),c=y(ei(i,"tilt",Pe.kml),0),d=y(ei(i,"roll",Pe.kml),0),u=m.fromDegrees(o,r,s,n),h=Ra.fromDegrees(a,c-90,d);t.kml.camera=new bw(u,h)}}function uye(e,t,n){let i=Fi(e,"LookAt",Pe.kml);if(l(i)){let o=y(ei(i,"longitude",Pe.kml),0),r=y(ei(i,"latitude",Pe.kml),0),s=y(ei(i,"altitude",Pe.kml),0),a=ei(i,"heading",Pe.kml),c=ei(i,"tilt",Pe.kml),d=y(ei(i,"range",Pe.kml),0);c=W.toRadians(y(c,0)),a=W.toRadians(y(a,0));let u=new Pu(a,c-W.PI_OVER_TWO,d),h=m.fromDegrees(o,r,s,n);t.kml.lookAt=new ww(h,u)}}function Uat(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Fi(t,"Icon",Pe.kml),c=Uj(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],h=Fi(t,"screenXY",Pe.kml),p=Fi(t,"overlayXY",Pe.kml),g=Fi(t,"size",Pe.kml),f,x,_,C,V,L;l(g)&&(f=vy(g,"x"),x=vy(g,"y"),_=Ws(g,"xunits"),C=Ws(g,"yunits"),l(f)&&f!==-1&&f!==0&&(_==="fraction"?V=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(V=`width: ${f}px`),u.push(V)),l(x)&&x!==-1&&x!==0&&(C==="fraction"?L=`height: ${Math.floor(x*100)}%`:C==="pixels"&&(L=`height: ${x}px`),u.push(L))),d.style=u.join(";");let R=0,G=d.height;l(p)&&(f=vy(p,"x"),x=vy(p,"y"),_=Ws(p,"xunits"),C=Ws(p,"yunits"),l(f)&&(_==="fraction"?R=f*d.width:(_==="pixels"||_==="insetPixels")&&(R=f)),l(x)&&(C==="fraction"?G=x*d.height:(C==="pixels"||C==="insetPixels")&&(G=x))),l(h)&&(f=vy(h,"x"),x=vy(h,"y"),_=Ws(h,"xunits"),C=Ws(h,"yunits"),l(f)&&(_==="fraction"?V=`left: calc(${Math.floor(f*100)}% - ${R}px)`:_==="pixels"?V=`left: ${f-R}px`:_==="insetPixels"&&(V=`right: ${f-R}px`),u.push(V)),l(x)&&(C==="fraction"?L=`bottom: calc(${Math.floor(x*100)}% - ${G}px)`:C==="pixels"?L=`bottom: ${x-G}px`:C==="insetPixels"&&(L=`top: ${x-G}px`),u.push(L))),d.style=u.join(";")},o.appendChild(d)}function Dat(e,t,n,i){let r=OD(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=ND(Fi(t,"LatLonQuad",Pe.gx),c),u=ei(t,"drawOrder",Pe.kml);if(l(d))s=kj(),s.hierarchy=new va(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new $m,s.zIndex=u,r.rectangle=s;let f=Fi(t,"LatLonBox",Pe.kml);if(l(f)){let x=ei(f,"west",Pe.kml),_=ei(f,"south",Pe.kml),C=ei(f,"east",Pe.kml),V=ei(f,"north",Pe.kml);l(x)&&(x=W.negativePiToPi(W.toRadians(x))),l(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),l(C)&&(C=W.negativePiToPi(W.toRadians(C))),l(V)&&(V=W.clampToLatitudeRange(W.toRadians(V))),s.coordinates=new ce(x,_,C,V);let L=ei(f,"rotation",Pe.kml);if(l(L)){let R=W.toRadians(L);s.rotation=R,s.stRotation=R}}}let h=Fi(t,"Icon",Pe.kml),p=Uj(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&_t("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=ei(h,"x",Pe.gx),x=ei(h,"y",Pe.gx),_=ei(h,"w",Pe.gx),C=ei(h,"h",Pe.gx);(l(f)||l(x)||l(_)||l(C))&&_t("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=BT(t,"color",Pe.kml),s.material.transparent=!0}else s.material=BT(t,"color",Pe.kml);let g=Wn(t,"altitudeMode",Pe.kml);l(g)?g==="absolute"?(s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):g!=="clampToGround"&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Wn(t,"altitudeMode",Pe.gx),g==="relativeToSeaFloor"?(_t("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):g==="clampToSeaFloor"?_t("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function mye(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),_t(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var wy={INTERVAL:0,EXPIRE:1,STOP:2};function UD(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Bat=new ce,zV=new he,Pj=new D,Oat=new m;function Bj(e,t,n,i,o,r){function s(d){return d<-W.PI_OVER_TWO?-W.PI_OVER_TWO:d>W.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=sx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let d,u;if(o=y(o,Bat),l(n)&&(Pj.x=n.clientWidth*.5,Pj.y=n.clientHeight*.5,d=t.pickEllipsoid(Pj,r,Oat)),l(d)?u=r.cartesianToCartographic(d,zV):(u=ce.center(o,zV),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new ce(a(u.longitude-C),s(u.latitude-V),a(u.longitude+C),s(u.latitude+V))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let h=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,zV),c=c.replace("[cameraLon]",W.toDegrees(zV.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(zV.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(zV.height).toString());let g=t.frustum,f=g.aspectRatio,x="",_="";if(l(f)){let C=W.toDegrees(g.fov);f>1?(x=C,_=C/f):(_=C,x=C*f)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(ud(c))}function Yat(e,t,n,i){let r=OD(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Fi(t,"Link",Pe.kml);if(l(c)||(c=Fi(t,"Url",Pe.kml)),l(c)){let d=Wn(c,"href",Pe.kml),u,h;if(l(d)){let p=d;if(d=Nj(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Wn(c,"viewRefreshMode",Pe.kml),u==="onRegion"){_t("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=y(Wn(c,"viewBoundScale",Pe.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Wn(c,"viewFormat",Pe.kml),_),V=Wn(c,"httpQuery",Pe.kml);l(C)&&d.setQueryParameters(ud(UD(C))),l(V)&&d.setQueryParameters(ud(UD(V)));let L=e._ellipsoid;Bj(d,e.camera,e.canvas,h,e._lastCameraView.bbox,L)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new js,x=Oj(e,f,d,g).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let G=0;G<V.length;G++){let I=V[G];l(I.parent)||(I.parent=r,Yj(I)),C.add(I)}C.resumeEvents();let L=Wn(c,"refreshMode",Pe.kml),R=y(ei(c,"refreshInterval",Pe.kml),0);if(L==="onInterval"&&R>0||L==="onExpire"||u==="onStop"){let G=Fi(_,"NetworkLinkControl",Pe.kml),I=l(G),v=q.now(),P={id:Hn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:v},w=0;if(I&&(P.cookie=ud(y(Wn(G,"cookie",Pe.kml),"")),w=y(ei(G,"minRefreshPeriod",Pe.kml),0)),L==="onInterval")I&&(R=Math.max(w,R)),P.refreshMode=wy.INTERVAL,P.time=R;else if(L==="onExpire"){let M;if(I&&(M=Wn(G,"expires",Pe.kml)),l(M))try{let b=q.fromIso8601(M),Z=q.secondsDifference(b,v);Z>0&&Z<w&&q.addSeconds(v,w,b),P.refreshMode=wy.EXPIRE,P.time=b}catch{_t("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(P.refreshMode=wy.STOP,P.time=y(ei(c,"viewRefreshTime",Pe.kml),0)):_t("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(_){_t(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(x)}}}function Hat(e,t,n,i){let o=Mj[t.localName];return l(o)?o(e,t,n,i):mye(e,t,n,i)}function Fj(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Fi(a,"Document",Pe.kml),d=Wn(c,"name",Pe.kml);l(d)||(d=ib(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new eu._DeferredLoading(e),h=new js(e);return Promise.all(rye(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let x=0;x<f.length;x++){let _=f[x];if(l(Mj[_.localName])){p=_;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Hat(e,p,g,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function zat(e,t,n,i,o){let r=nn("ThirdParty/Workers/z-worker-pako.js");NV({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new PD(new h0(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],d={},u;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!l(u)||!/\//i.test(p.filename))?(l(u)&&c.push(Xj(u,d)),u=p):c.push(Xj(p,d)))}return l(u)&&c.push(xat(u,d)),Promise.all(c).then(function(){if(s.close(),!l(d.kml))throw new ae("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),Fj(e,t,d.kml,i,d,o)})})}function Oj(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ze){n=Ze.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let d=e._resourceCredits,u=n.credits;if(l(u)){let h=u.length;for(let p=0;p<h;p++)d.push(u[p])}}else o=y(o,Ze.DEFAULT.clone());return o=Ze.createIfNeeded(o),l(a)&&(a=Xn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?gat(d).then(function(u){return u?zat(e,t,d,o,a):yat(d).then(function(h){h=eye(h),h=tye(h);let p,g;try{p=Aj.parseFromString(h,"application/xml")}catch(f){g=f.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let f=l(g)?g:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new ae(f)}return Fj(e,t,p,o,r,a,s)})}):Fj(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function eu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new js(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new jp,this._networkLinks=new Gt,this._entityCluster=new kd,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?m.clone(t.positionWC):void 0,direction:l(t)?m.clone(t.directionWC):void 0,up:l(t)?m.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ne.default);let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}eu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new eu(t).load(e,t)};Object.defineProperties(eu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});eu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Yr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return Oj(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=q.equals(s,Be.MINIMUM_VALUE),d=q.equals(a,Be.MAXIMUM_VALUE);if(!c||!d){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=q.fromDate(h)),d&&(h=new Date,h.setHours(24,0,0,0),a=q.fromDate(h)),o=new Lh,o.startTime=s,o.stopTime=a,o.currentTime=q.clone(s),o.clockRange=vr.LOOP_STOP,o.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(q.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Yr.setLoading(i,!1),i}).catch(function(o){return Yr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};eu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function Yj(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Kat(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Fi(r,"NetworkLinkControl",Pe.kml),c=l(a),d=0;if(c){if(l(Fi(a,"Update",Pe.kml))){_t("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=ud(y(Wn(a,"cookie",Pe.kml),"")),d=y(ei(a,"minRefreshPeriod",Pe.kml),0)}let u=q.now(),h=t.refreshMode;if(h===wy.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(h===wy.EXPIRE){let v;if(l(a)&&(v=Wn(a,"expires",Pe.kml)),l(v))try{let P=q.fromIso8601(v),w=q.secondsDifference(P,u);w>0&&w<d&&q.addSeconds(u,d,P),t.time=P}catch{_t("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,f=n.values;function x(v){g.remove(v);let P=v._children,w=P.length;for(let M=0;M<w;++M)x(P[M])}g.suspendEvents();let _=g.values.slice(),C;for(C=0;C<_.length;++C){let v=_[C];v.parent===p&&(v.parent=void 0,x(v))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<f.length;C++){let v=f[C];l(v.parent)||(v.parent=p,Yj(v)),g.add(v)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=g.computeAvailability(),L=V.start,R=V.stop,G=q.equals(L,Be.MINIMUM_VALUE),I=q.equals(R,Be.MAXIMUM_VALUE);if(!G||!I){let v=e._clock;(v.startTime!==L||v.stopTime!==R)&&(v.startTime=L,v.stopTime=R,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var vj=new Gt;eu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=q.now(),i=this;vj.removeAll();function o(u){let h=u._children,p=h.length;for(let g=0;g<p;++g){let f=h[g];vj.set(f.id,f),o(f)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,W.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,W.EPSILON7)&&a.upWC.equalsEpsilon(s.up,W.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Gt,d=!1;return t.values.forEach(function(u){let h=u.entity;if(!vj.contains(h.id)){if(!u.updating){let p=!1;if(u.refreshMode===wy.INTERVAL?q.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===wy.EXPIRE?q.greaterThan(n,u.time)&&(p=!0):u.refreshMode===wy.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&q.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(h),u.updating=!0;let g=new js,f=u.href.clone();f.setQueryParameters(u.cookie);let x=y(i._ellipsoid,ne.default);Bj(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),Oj(i,g,f,{context:h.id}).then(Kat(i,u,g,c,f)).catch(function(_){let C=`NetworkLink ${u.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Jat(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}eu._DeferredLoading=tp;eu._getTimestamp=xi;var OT=eu;var sEi=T(S(),1);function Uw(){pe.throwInstantiationError()}Uw.prototype.update=pe.throwInstantiationError;Uw.prototype.getBoundingSphere=pe.throwInstantiationError;Uw.prototype.isDestroyed=pe.throwInstantiationError;Uw.prototype.destroy=pe.throwInstantiationError;var Hj=Uw;var FEi=T(S(),1);var zj=32,Qat="http://www.opengis.net/kml/2.2",Nh="http://www.google.com/kml/ext/2.2",jat="http://www.w3.org/2000/xmlns/";function YD(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var qat=/^data:image\/([^,;]+)/;YD.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ze){if(e=Ze.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(qat);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function $at(e,t){return function(n){e._files[t]=n}}YD.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then($at(this,r))}return o};Object.defineProperties(YD.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function HD(e){this._time=e}HD.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};HD.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return HT(n)};HD.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Kj(){this._ids={},this._styles={},this._count=0}Kj.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};Kj.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function pye(){this._ids={}}pye.prototype.get=function(e){if(!l(e))return this.get(Hn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Jj(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=Jj._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(jat,"xmlns:gx",Nh);let a=r.createElement("Document");s.appendChild(a),gye(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?ect(u,c.files):{kml:u,externalFiles:c.files}})}function ect(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");NV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new Ew,o=new FD(i);return o.add("doc.kml",new bD(e)).then(function(){let r=Object.keys(t);return bye(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function bye(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new h0(n[o])).then(function(){return bye(e,t,n,i+1)})}Jj._createState=function(e){let t=e.entities,n=new Kj,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===Be.MINIMUM_VALUE?r.stop===Be.MAXIMUM_VALUE?r=new Ln:q.addSeconds(r.stop,-10*s,r.start):r.stop===Be.MAXIMUM_VALUE&&q.addSeconds(r.start,10*s,r.stop);let a=new YD(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Qat,"kml"),ellipsoid:y(e.ellipsoid,ne.default),idManager:new pye,styleCache:n,externalFileHandler:a,time:o,valueGetter:new HD(o),sampleDuration:s,defaultAvailability:new Nr([r])}};function gye(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let h=0;h<a;++h){let p=n[h];c=[],d=[],u=[],tct(e,p,d,u),nct(e,p.polyline,d,u),fye(e,p.rectangle,d,u,c),fye(e,p.polygon,d,u,c),sct(e,p,p.model,d,u);let g,f=p.availability;l(f)&&(g=i.createElement("TimeSpan"),q.equals(f.start,Be.MINIMUM_VALUE)||g.appendChild(hn(i,"begin",q.toIso8601(f.start))),q.equals(f.stop,Be.MAXIMUM_VALUE)||g.appendChild(hn(i,"end",q.toIso8601(f.stop))));for(let C=0;C<c.length;++C){let V=c[C];V.setAttribute("id",s.get(p.id)),V.appendChild(hn(i,"name",p.name)),V.appendChild(hn(i,"visibility",p.show)),V.appendChild(hn(i,"description",p.description)),l(g)&&V.appendChild(g),t.appendChild(V)}let x=d.length;if(x>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(l(L)){let G=i.createElement("LabelStyle"),I=r.get(L.text);V=l(I)&&I.length>0?I:V;let v=r.getColor(L.fillColor);l(v)&&(G.appendChild(hn(i,"color",v)),G.appendChild(hn(i,"colorMode","normal")));let P=r.get(L.scale);l(P)&&G.appendChild(hn(i,"scale",P)),u.push(G)}C.appendChild(hn(i,"name",V)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let R=u.length;if(R>0){let G=i.createElement("Style");for(let I=0;I<R;++I)G.appendChild(u[I]);C.appendChild(hn(i,"styleUrl",o.get(G)))}if(d.length===1)C.appendChild(d[0]);else if(d.length>1){let G=i.createElement("MultiGeometry");for(let I=0;I<x;++I)G.appendChild(d[I]);C.appendChild(G)}}let _=p._children;if(_.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(hn(i,"name",p.name)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),t.appendChild(C),gye(e,C,_)}}}var ed=new m,fl=new he,Mh=new q;function tct(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){yye(e,t,a,n,i);return}s.get(c,void 0,ed);let d=hn(o,"coordinates",YT(ed,r)),u=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(zT(e,a.heightReference)),u.appendChild(h),u.appendChild(d),n.push(u);let p=a instanceof pc?_ye(e,a):xye(e,a);i.push(p)}function yye(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof ba?(c=d.intervals,u=!1):c=y(t.availability,e.defaultAvailability);let h=n instanceof db,p,g,f,x=[];for(p=0;p<c.length;++p){let C=c.get(p),V=u?d:C.data,L=r.createElement("altitudeMode");V instanceof Bf?(V=V._value,L.appendChild(zT(e,Je.CLAMP_TO_GROUND))):l(n)?L.appendChild(zT(e,n.heightReference)):L.appendChild(zT(e,Je.NONE));let R=[],G=[];if(V.isConstant){a.get(V,void 0,ed);let v=hn(r,"coordinates",YT(ed,s));R.push(q.toIso8601(C.start)),G.push(v),R.push(q.toIso8601(C.stop)),G.push(v)}else if(V instanceof ga)for(f=V._property._times,g=0;g<f.length;++g)R.push(q.toIso8601(f[g])),V.getValueInReferenceFrame(f[g],Ui.FIXED,ed),G.push(YT(ed,s));else if(V instanceof Bd){f=V._times;let v=V._values;for(g=0;g<f.length;++g)R.push(q.toIso8601(f[g])),m.fromArray(v,g*3,ed),G.push(YT(ed,s))}else{let v=e.sampleDuration;C.start.clone(Mh),C.isStartIncluded||q.addSeconds(Mh,v,Mh);let P=C.stop;for(;q.lessThan(Mh,P);)V.getValue(Mh,ed),R.push(q.toIso8601(Mh)),G.push(YT(ed,s)),q.addSeconds(Mh,v,Mh);C.isStopIncluded&&q.equals(Mh,P)&&(V.getValue(Mh,ed),R.push(q.toIso8601(Mh)),G.push(YT(ed,s)))}let I=r.createElementNS(Nh,"Track");I.appendChild(L);for(let v=0;v<R.length;++v){let P=hn(r,"when",R[v]),w=hn(r,"coord",G[v],Nh);I.appendChild(P),I.appendChild(w)}h&&I.appendChild(Tye(e,n)),x.push(I)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=r.createElementNS(Nh,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(l(n)&&!h){let C=n instanceof pc?_ye(e,n):xye(e,n);o.push(C)}let _=t.path;if(l(_)){let C=a.get(_.width),V=_.material;if(l(V)||l(C)){let L=r.createElement("LineStyle");l(C)&&L.appendChild(hn(r,"width",C)),Qj(e,V,L),o.push(L)}}}function xye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(hn(n,"color",r)),o.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(hn(n,"scale",s/zj)),o}function _ye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(hn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(hn(n,"x",g.x,Nh)),p.appendChild(hn(n,"y",g.y,Nh)),p.appendChild(hn(n,"w",g.width,Nh)),p.appendChild(hn(n,"h",g.height,Nh))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(hn(n,"color",a)),r.appendChild(hn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(hn(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=y(c,1),D.divideByScalar(d,c,d);let p=i.get(t.width,zj),g=i.get(t.height,zj),f=i.get(t.horizontalOrigin,_i.CENTER);f===_i.CENTER?d.x-=p*.5:f===_i.RIGHT&&(d.x-=p);let x=i.get(t.verticalOrigin,An.CENTER);x===An.TOP?d.y+=g:x===An.CENTER&&(d.y+=g*.5);let _=n.createElement("hotSpot");_.setAttribute("x",-d.x),_.setAttribute("y",d.y),_.setAttribute("xunits","pixels"),_.setAttribute("yunits","pixels"),r.appendChild(_)}let u=i.get(t.rotation),h=i.get(t.alignedAxis);return l(u)&&m.equals(m.UNIT_Z,h)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(hn(n,"heading",u))),r}function nct(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(hn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let h=t.positions,p=s.get(h),g=hn(o,"coordinates",YT(p,r));a.appendChild(g);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(hn(o,"drawOrder",f,Nh)),n.push(a);let x=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&x.appendChild(hn(o,"width",_)),Qj(e,t.material,x),i.push(x)}function ict(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)d[g](a,fl),c.push(`${W.toDegrees(fl.longitude)},${W.toDegrees(fl.latitude)},${r}`);let u=hn(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),h.appendChild(p),[h]}function hye(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)he.fromCartesian(t[u],r,fl),s.push(`${W.toDegrees(fl.longitude)},${W.toDegrees(fl.latitude)},${i?fl.height:n}`);let c=hn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function oct(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,h=i.createElement("outerBoundaryIs");h.appendChild(hye(e,u,r,s)),a.push(h);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f<g;++f){let x=i.createElement("innerBoundaryIs");x.appendChild(hye(e,p[f].positions,r,s)),a.push(x)}}return a}function fye(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof $m;if(a&&s.getMaterialType(t.material)==="Image"){rct(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(hn(r,"extrude",!0));let u=a?ict(e,t,d):oct(e,t,d),h=u.length;for(let _=0;_<h;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(zT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&g.appendChild(hn(r,"fill",f)),Qj(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(hn(r,"outline",x));let _=r.createElement("LineStyle"),C=s.get(t.outlineWidth,1);_.appendChild(hn(r,"width",C));let V=s.getColor(t.outlineColor,B.BLACK);_.appendChild(hn(r,"color",V)),_.appendChild(hn(r,"colorMode","normal")),i.push(_)}i.push(g)}function rct(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(zT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(hn(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(hn(i,"north",W.toDegrees(d.north))),u.appendChild(hn(i,"south",W.toDegrees(d.south))),u.appendChild(hn(i,"east",W.toDegrees(d.east))),u.appendChild(hn(i,"west",W.toDegrees(d.west))),s.appendChild(u);let h=o.get(t.material),p=r.texture(h.image),g=i.createElement("Icon");g.appendChild(hn(i,"href",p)),s.appendChild(g);let f=h.color;l(f)&&s.appendChild(hn(i,"color",HT(h.color))),n.push(s)}function Tye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(hn(n,"x",s)),d.appendChild(hn(n,"y",s)),d.appendChild(hn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(hn(n,"href",c)),r.appendChild(a),r}function sct(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){yye(e,t,n,i,o);return}let d=Tye(e,n),u=r.createElement("altitudeMode");u.appendChild(zT(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,ed),he.fromCartesian(ed,s,fl);let h=r.createElement("Location");h.appendChild(hn(r,"longitude",W.toDegrees(fl.longitude))),h.appendChild(hn(r,"latitude",W.toDegrees(fl.latitude))),h.appendChild(hn(r,"altitude",fl.height)),d.appendChild(h),i.push(d)}function Qj(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=HT(B.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=HT(r.color);break;case"PolylineOutline":s=HT(r.color),c=HT(r.outlineColor),d=r.outlineWidth,n.appendChild(hn(i,"outerColor",c,Nh)),n.appendChild(hn(i,"outerWidth",d,Nh));break;case"Stripe":s=HT(r.oddColor);break}l(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function zT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Je.NONE),r;switch(o){case Je.NONE:r=n.createTextNode("absolute");break;case Je.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Je.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function YT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,fl),i.push(`${W.toDegrees(fl.longitude)},${W.toDegrees(fl.latitude)},${fl.height}`);return i.join(" ")}function hn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function HT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var jj=Jj;var _qi=T(S(),1);var DEi=T(S(),1);async function qj(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],d=await qj._sampleTerrainMostDetailed(n,c),u=!1,h=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=h),p}qj._sampleTerrainMostDetailed=h_;var KT=qj;var lAi=T(S(),1);var OEi=T(S(),1),Dw=`uniform vec4 u_initialColor;

#if TEXTURE_UNITS > 0
uniform sampler2D u_dayTextures[TEXTURE_UNITS];
uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];

#ifdef APPLY_ALPHA
uniform float u_dayTextureAlpha[TEXTURE_UNITS];
#endif

#ifdef APPLY_DAY_NIGHT_ALPHA
uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
#endif

#ifdef APPLY_SPLIT
uniform float u_dayTextureSplit[TEXTURE_UNITS];
#endif

#ifdef APPLY_BRIGHTNESS
uniform float u_dayTextureBrightness[TEXTURE_UNITS];
#endif

#ifdef APPLY_CONTRAST
uniform float u_dayTextureContrast[TEXTURE_UNITS];
#endif

#ifdef APPLY_HUE
uniform float u_dayTextureHue[TEXTURE_UNITS];
#endif

#ifdef APPLY_SATURATION
uniform float u_dayTextureSaturation[TEXTURE_UNITS];
#endif

#ifdef APPLY_GAMMA
uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
#endif

#ifdef APPLY_IMAGERY_CUTOUT
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
#endif

#ifdef APPLY_COLOR_TO_ALPHA
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
#endif

uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
#endif

#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
uniform sampler2D u_waterMask;
uniform vec4 u_waterMaskTranslationAndScale;
uniform float u_zoomedOutOceanSpecularIntensity;
#endif

#ifdef SHOW_OCEAN_WAVES
uniform sampler2D u_oceanNormalMap;
#endif

#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
uniform vec2 u_lightingFadeDistance;
#endif

#ifdef TILE_LIMIT_RECTANGLE
uniform vec4 u_cartographicLimitRectangle;
#endif

#ifdef GROUND_ATMOSPHERE
uniform vec2 u_nightFadeDistance;
#endif

#ifdef ENABLE_CLIPPING_PLANES
uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingDistance;
in vec2 v_clippingPosition;
flat in int v_regionIndex;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
uniform float u_minimumBrightness;
#endif

#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift; // Hue, saturation, brightness
#endif

#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif

#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif

#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif

#ifdef ENABLE_VERTEX_LIGHTING
uniform float u_lambertDiffuseMultiplier;
uniform float u_vertexShadowDarkness;
#endif

in vec3 v_positionMC;
in vec3 v_positionEC;
in vec3 v_textureCoordinates;
in vec3 v_normalMC;
in vec3 v_normalEC;

#ifdef APPLY_MATERIAL
in float v_height;
in float v_slope;
in float v_aspect;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
in float v_distance;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG)
in vec3 v_atmosphereRayleighColor;
in vec3 v_atmosphereMieColor;
in float v_atmosphereOpacity;
#endif

#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
    float startDistance = nearFarScalar.x;
    float startValue = nearFarScalar.y;
    float endDistance = nearFarScalar.z;
    float endValue = nearFarScalar.w;
    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
    return mix(startValue, endValue, t);
}
#endif

#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
#endif

#ifdef TRANSLUCENT
bool inTranslucencyRectangle()
{
    return
        v_textureCoordinates.x > u_translucencyRectangle.x &&
        v_textureCoordinates.x < u_translucencyRectangle.z &&
        v_textureCoordinates.y > u_translucencyRectangle.y &&
        v_textureCoordinates.y < u_translucencyRectangle.w;
}
#endif

vec4 sampleAndBlend(
    vec4 previousColor,
    sampler2D textureToSample,
    vec2 tileTextureCoordinates,
    vec4 textureCoordinateRectangle,
    vec4 textureCoordinateTranslationAndScale,
    float textureAlpha,
    float textureNightAlpha,
    float textureDayAlpha,
    float textureBrightness,
    float textureContrast,
    float textureHue,
    float textureSaturation,
    float textureOneOverGamma,
    float split,
    vec4 colorToAlpha,
    float nightBlend)
{
    // This crazy step stuff sets the alpha to 0.0 if this following condition is true:
    //    tileTextureCoordinates.s < textureCoordinateRectangle.s ||
    //    tileTextureCoordinates.s > textureCoordinateRectangle.p ||
    //    tileTextureCoordinates.t < textureCoordinateRectangle.t ||
    //    tileTextureCoordinates.t > textureCoordinateRectangle.q
    // In other words, the alpha is zero if the fragment is outside the rectangle
    // covered by this texture.  Would an actual 'if' yield better performance?
    vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;

    alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;

#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
    textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
#endif

    vec2 translation = textureCoordinateTranslationAndScale.xy;
    vec2 scale = textureCoordinateTranslationAndScale.zw;
    vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
    vec4 value = texture(textureToSample, textureCoordinates);
    vec3 color = value.rgb;
    float alpha = value.a;

#ifdef APPLY_COLOR_TO_ALPHA
    vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
    colorDiff.r = czm_maximumComponent(colorDiff);
    alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
#endif

#if !defined(APPLY_GAMMA)
    vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
    color = tempColor.rgb;
    alpha = tempColor.a;
#else
    color = pow(color, vec3(textureOneOverGamma));
#endif

#ifdef APPLY_SPLIT
    float splitPosition = czm_splitPosition;
    // Split to the left
    if (split < 0.0 && gl_FragCoord.x > splitPosition) {
       alpha = 0.0;
    }
    // Split to the right
    else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
       alpha = 0.0;
    }
#endif

#ifdef APPLY_BRIGHTNESS
    color = mix(vec3(0.0), color, textureBrightness);
#endif

#ifdef APPLY_CONTRAST
    color = mix(vec3(0.5), color, textureContrast);
#endif

#ifdef APPLY_HUE
    color = czm_hue(color, textureHue);
#endif

#ifdef APPLY_SATURATION
    color = czm_saturation(color, textureSaturation);
#endif

    float sourceAlpha = alpha * textureAlpha;
    float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
    outAlpha += sign(outAlpha) - 1.0;

    vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;

    // When rendering imagery for a tile in multiple passes,
    // some GPU/WebGL implementation combinations will not blend fragments in
    // additional passes correctly if their computation includes an unmasked
    // divide-by-zero operation,
    // even if it's not in the output or if the output has alpha zero.
    //
    // For example, without sanitization for outAlpha,
    // this renders without artifacts:
    //   if (outAlpha == 0.0) { outColor = vec3(0.0); }
    //
    // but using czm_branchFreeTernary will cause portions of the tile that are
    // alpha-zero in the additional pass to render as black instead of blending
    // with the previous pass:
    //   outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
    //
    // So instead, sanitize against divide-by-zero,
    // store this state on the sign of outAlpha, and correct on return.

    return vec4(outColor, max(outAlpha, 0.0));
}

vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);

const float fExposure = 2.0;

vec3 computeEllipsoidPosition()
{
    float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
    vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
    xy *= czm_viewport.zw * mpp * 0.5;

    vec3 direction;
    if (czm_orthographicIn3D == 1.0)
    {
        direction = vec3(0.0, 0.0, -1.0);
    }
    else
    {
        direction = normalize(vec3(xy, -czm_currentFrustum.x));
    }

    czm_ray ray = czm_ray(vec3(0.0), direction);

    vec3 ellipsoid_center = czm_view[3].xyz;

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);

    vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
    return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
}

void main()
{
#ifdef TILE_LIMIT_RECTANGLE
    if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
        v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
        {
            discard;
        }
#endif

#ifdef ENABLE_CLIPPING_PLANES
    float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
#endif

#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
    vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));   // normalized surface normal in model coordinates
    vec3 normalEC = czm_normal3D * normalMC;                                         // normalized surface normal in eye coordinates
#endif

#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
    float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
#else
    float nightBlend = 0.0;
#endif

    // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
    // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
    // fragments on the edges of tiles even though the vertex shader is outputting
    // coordinates strictly in the 0-1 range.
    vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);

#ifdef SHOW_TILE_BOUNDARIES
    if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
        v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
    {
        color = vec4(1.0, 0.0, 0.0, 1.0);
    }
#endif

#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
    float cameraDist;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
    }
    else if (czm_sceneMode == czm_sceneModeColumbusView)
    {
        cameraDist = -czm_view[3].z;
    }
    else
    {
        cameraDist = length(czm_view[3]);
    }
    float fadeOutDist = u_lightingFadeDistance.x;
    float fadeInDist = u_lightingFadeDistance.y;
    if (czm_sceneMode != czm_sceneMode3D) {
        vec3 radii = czm_ellipsoidRadii;
        float maxRadii = max(radii.x, max(radii.y, radii.z));
        fadeOutDist -= maxRadii;
        fadeInDist -= maxRadii;
    }
    float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
#else
    float fade = 0.0;
#endif

#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
    vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
    vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
    vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
    waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;

    float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;

    #ifdef SHOW_REFLECTIVE_OCEAN
    if (mask > 0.0)
    {
        mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);

        vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
        vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx);

        vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));

        color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
    }
    #endif
#endif

#ifdef APPLY_MATERIAL
    czm_materialInput materialInput;
    materialInput.st = v_textureCoordinates.st;
    materialInput.normalEC = normalize(v_normalEC);
    materialInput.positionToEyeEC = -v_positionEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
    materialInput.slope = v_slope;
    materialInput.height = v_height;
    materialInput.aspect = v_aspect;
    #ifdef HAS_WATER_MASK
        materialInput.waterMask = mask;
    #endif

    czm_material material = czm_getMaterial(materialInput);
    vec4 materialColor = vec4(material.diffuse, material.alpha);
    color = alphaBlend(materialColor, color);
#endif

#ifdef ENABLE_VERTEX_LIGHTING
    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#elif defined(ENABLE_DAYNIGHT_SHADING)
    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
    diffuseIntensity = mix(1.0, diffuseIntensity, fade);
    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#else
    vec4 finalColor = color;
#endif

#ifdef ENABLE_CLIPPING_PLANES
    vec4 clippingPlanesEdgeColor = vec4(1.0);
    clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
    float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;

    if (clipDistance < clippingPlanesEdgeWidth)
    {
        finalColor = clippingPlanesEdgeColor;
    }
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
    vec2 clippingPosition = v_clippingPosition;
    int regionIndex = v_regionIndex;
    clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
#endif

#ifdef HIGHLIGHT_FILL_TILE
    finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
#endif

#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
    vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
    vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG)
    if (!czm_backFacing())
    {
        bool dynamicLighting = false;
        #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
            dynamicLighting = true;
        #endif

        vec3 rayleighColor;
        vec3 mieColor;
        float opacity;

        vec3 positionWC;
        vec3 lightDirection;

        // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
        // Otherwise, the scattering is computed in the vertex shader.
        #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
            positionWC = computeEllipsoidPosition();
            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
            computeAtmosphereScattering(
                positionWC,
                lightDirection,
                rayleighColor,
                mieColor,
                opacity
            );
        #else
            positionWC = v_positionMC;
            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
            rayleighColor = v_atmosphereRayleighColor;
            mieColor = v_atmosphereMieColor;
            opacity = v_atmosphereOpacity;
        #endif

        #ifdef COLOR_CORRECT
            const bool ignoreBlackPixels = true;
            rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
            mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
        #endif

        vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);

        // Fog is applied to tiles selected for fog, close to the Earth.
        #ifdef FOG
            vec3 fogColor = groundAtmosphereColor.rgb;

            // If there is lighting, apply that to the fog.
            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
                float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
                fogColor *= darken;
            #endif

            #ifndef HDR
                fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
                fogColor.rgb = czm_inverseGamma(fogColor.rgb);
            #endif

            finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a);

        #else
            // Apply ground atmosphere. This happens when the camera is far away from the earth.

            // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
            // This value is larger near the "circumference", as it is further away from the camera. We use it to
            // brighten up that area of the ground atmosphere.
            const float transmittanceModifier = 0.5;
            float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);

            vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;

            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
                float fadeInDist = u_nightFadeDistance.x;
                float fadeOutDist = u_nightFadeDistance.y;

                float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
                float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
                vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);

                finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
            #endif

            #ifndef HDR
                finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
            #else
                finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
            #endif

            finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
        #endif
    }
#endif

#ifdef UNDERGROUND_COLOR
    if (czm_backFacing())
    {
        float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
        float distance = max(v_distance - distanceFromEllipsoid, 0.0);
        float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
        vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
        finalColor = alphaBlend(undergroundColor, finalColor);
    }
#endif

#ifdef TRANSLUCENT
    if (inTranslucencyRectangle())
    {
      vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
      finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
    }
#endif

    out_FragColor =  finalColor;
}


#ifdef SHOW_REFLECTIVE_OCEAN

float waveFade(float edge0, float edge1, float x)
{
    float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
    return pow(1.0 - y, 5.0);
}

float linearFade(float edge0, float edge1, float x)
{
    return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}

// Based on water rendering by Jonas Wagner:
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog

// low altitude wave settings
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;

// high altitude wave settings
const float oceanFrequencyHighAltitude = 125000.0;
const float oceanAnimationSpeedHighAltitude = 0.008;
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;

vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
{
    vec3 positionToEyeEC = -positionEyeCoordinates;
    float positionToEyeECLength = length(positionToEyeEC);

    // The double normalize below works around a bug in Firefox on Android devices.
    vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));

    // Fade out the waves as the camera moves far from the surface.
    float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);

#ifdef SHOW_OCEAN_WAVES
    // high altitude waves
    float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
    vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
    vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);

    // low altitude waves
    time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
    noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
    vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);

    // blend the 2 wave layers based on distance to surface
    float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
    float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
    vec3 normalTangentSpace =
        (highAltitudeFade * normalTangentSpaceHighAltitude) +
        (lowAltitudeFade * normalTangentSpaceLowAltitude);
    normalTangentSpace = normalize(normalTangentSpace);

    // fade out the normal perturbation as we move farther from the water surface
    normalTangentSpace.xy *= waveIntensity;
    normalTangentSpace = normalize(normalTangentSpace);
#else
    vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
#endif

    vec3 normalEC = enuToEye * normalTangentSpace;

    const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);

    // Use diffuse light to highlight the waves
    float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
    vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);

#ifdef SHOW_OCEAN_WAVES
    // Where diffuse light is low or non-existent, use wave highlights based solely on
    // the wave bumpiness and no particular light direction.
    float tsPerturbationRatio = normalTangentSpace.z;
    vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
    vec3 nonDiffuseHighlight = vec3(0.0);
#endif

    // Add specular highlights in 3D, and in all modes when zoomed in.
    float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
    float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
    float specular = specularIntensity * surfaceReflectance;

#ifdef HDR
    specular *= 1.4;

    float e = 0.2;
    float d = 3.3;
    float c = 1.7;

    vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
#else
    vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
#endif

    return vec4(color, imageryColor.a);
}

#endif // #ifdef SHOW_REFLECTIVE_OCEAN
`;var HEi=T(S(),1),Bw=`#ifdef QUANTIZATION_BITS12
in vec4 compressed0;
in float compressed1;
#else
in vec4 position3DAndHeight;
in vec4 textureCoordAndEncodedNormals;
#endif

#ifdef GEODETIC_SURFACE_NORMALS
in vec3 geodeticSurfaceNormal;
#endif

#ifdef EXAGGERATION
uniform vec2 u_verticalExaggerationAndRelativeHeight;
#endif

uniform vec3 u_center3D;
uniform mat4 u_modifiedModelView;
uniform mat4 u_modifiedModelViewProjection;
uniform vec4 u_tileRectangle;

// Uniforms for 2D Mercator projection
uniform vec2 u_southAndNorthLatitude;
uniform vec2 u_southMercatorYAndOneOverHeight;

out vec3 v_positionMC;
out vec3 v_positionEC;

out vec3 v_textureCoordinates;
out vec3 v_normalMC;
out vec3 v_normalEC;

#ifdef APPLY_MATERIAL
out float v_slope;
out float v_aspect;
out float v_height;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
out float v_distance;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE)
out vec3 v_atmosphereRayleighColor;
out vec3 v_atmosphereMieColor;
out float v_atmosphereOpacity;
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingExtents;
out vec2 v_clippingPosition;
flat out int v_regionIndex;
#endif

// These functions are generated at runtime.
vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
float get2DYPositionFraction(vec2 textureCoordinates);

vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
{
    return u_modifiedModelViewProjection * vec4(position, 1.0);
}

float get2DMercatorYPositionFraction(vec2 textureCoordinates)
{
    // The width of a tile at level 11, in radians and assuming a single root tile, is
    //   2.0 * czm_pi / pow(2.0, 11.0)
    // We want to just linearly interpolate the 2D position from the texture coordinates
    // when we're at this level or higher.  The constant below is the expression
    // above evaluated and then rounded up at the 4th significant digit.
    const float maxTileWidth = 0.003068;
    float positionFraction = textureCoordinates.y;
    float southLatitude = u_southAndNorthLatitude.x;
    float northLatitude = u_southAndNorthLatitude.y;
    if (northLatitude - southLatitude > maxTileWidth)
    {
        float southMercatorY = u_southMercatorYAndOneOverHeight.x;
        float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;

        float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
        currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
        positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
    }
    return positionFraction;
}

float get2DGeographicYPositionFraction(vec2 textureCoordinates)
{
    return textureCoordinates.y;
}

vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
{
    float yPositionFraction = get2DYPositionFraction(textureCoordinates);
    vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
    return u_modifiedModelViewProjection * rtcPosition2D;
}

vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
{
    return getPositionPlanarEarth(position, 0.0, textureCoordinates);
}

vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
{
    return getPositionPlanarEarth(position, height, textureCoordinates);
}

vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
{
    // We do not do RTC while morphing, so there is potential for jitter.
    // This is unlikely to be noticeable, though.
    vec3 position3DWC = position + u_center3D;
    float yPositionFraction = get2DYPositionFraction(textureCoordinates);
    vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
    vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
    return czm_modelViewProjection * morphPosition;
}

#ifdef QUANTIZATION_BITS12
uniform vec2 u_minMaxHeight;
uniform mat4 u_scaleAndBias;
#endif

void main()
{
#ifdef QUANTIZATION_BITS12
    vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
    vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
    vec3 position = vec3(xy, zh.x);
    float height = zh.y;
    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);

    height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
    position = (u_scaleAndBias * vec4(position, 1.0)).xyz;

#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
    float encodedNormal = compressed1;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
    float encodedNormal = 0.0;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = compressed0.w;
#else
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = 0.0;
#endif

#else
    // A single float per element
    vec3 position = position3DAndHeight.xyz;
    float height = position3DAndHeight.w;
    vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;

#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = textureCoordAndEncodedNormals.z;
    float encodedNormal = textureCoordAndEncodedNormals.w;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = textureCoordAndEncodedNormals.z;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = textureCoordAndEncodedNormals.z;
    float encodedNormal = 0.0;
#else
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = 0.0;
#endif

#endif

    vec3 position3DWC = position + u_center3D;

#ifdef GEODETIC_SURFACE_NORMALS
    vec3 ellipsoidNormal = geodeticSurfaceNormal;
#else
    vec3 ellipsoidNormal = normalize(position3DWC);
#endif

#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
    float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
    float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
    float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;

    // stop from going through center of earth
    float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
    newHeight = max(newHeight, -minRadius);

    vec3 offset = ellipsoidNormal * (newHeight - height);
    position += offset;
    position3DWC += offset;
    height = newHeight;
#endif

    gl_Position = getPosition(position, height, textureCoordinates);

    v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
    v_positionMC = position3DWC;  // position in model coordinates

    v_textureCoordinates = vec3(textureCoordinates, webMercatorT);

#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    vec3 normalMC = czm_octDecode(encodedNormal);

#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
    vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
    vec3 rejection = normalMC - projection;
    normalMC = normalize(projection + rejection * exaggeration);
#endif

    v_normalMC = normalMC;
    v_normalEC = czm_normal3D * v_normalMC;
#endif

#ifdef ENABLE_CLIPPING_POLYGONS
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
    
    vec2 minDistance = vec2(czm_infinity);
    v_clippingPosition = vec2(czm_infinity);
    v_regionIndex = -1;

    for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
        vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
        vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;

        vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
        vec2 distance = abs(rectUv - clamped) * extents.wz;

        float threshold = 0.01;
        if (minDistance.x > distance.x || minDistance.y > distance.y) {
            minDistance = distance;
            v_clippingPosition = rectUv;
            if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
                v_regionIndex = regionIndex;
            }
        }
    }
#endif

#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))

    bool dynamicLighting = false;

    #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
        dynamicLighting = true;
    #endif

#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
    vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
    vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif

    vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));

    computeAtmosphereScattering(
        position3DWC,
        lightDirection,
        v_atmosphereRayleighColor,
        v_atmosphereMieColor,
        v_atmosphereOpacity
    );
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
    v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
#endif

#ifdef APPLY_MATERIAL
    float northPoleZ = czm_ellipsoidRadii.z;
    vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
    vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
    float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
    v_slope = acos(dotProd);
    vec3 normalRejected = ellipsoidNormal * dotProd;
    vec3 normalProjected = v_normalMC - normalRejected;
    vec3 aspectVector = normalize(normalProjected);
    v_aspect = acos(dot(aspectVector, vectorEastMC));
    float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
    v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
    v_height = height;
#endif
}
`;var KEi=T(S(),1),KV=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {

    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
    
    float atmosphereInnerRadius = length(positionWC);

    computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );
}
`;var sIi=T(S(),1);var qEi=T(S(),1);var act=new D;function cct(e,t){let n=e.unionClippingRegions,i=e.length,o=fs.useFloatTexture(t),r=fs.getTextureResolution(e,t,act),s=r.x,a=r.y,c=o?uct(s,a):mct(s,a);return c+=`
`,c+=n?lct(i):dct(i),c}function lct(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float clipAmount;
    float pixelWidth = czm_metersPerPixel(position);
    bool breakAndDiscard = false;
    for (int i = 0; i < ${e}; ++i)
    {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
        if (amount <= 0.0)
        {
           breakAndDiscard = true;
           break;
        }
    }
    if (breakAndDiscard) {
        discard;
    }
    return clipAmount;
}
`}function dct(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
    bool clipped = true;
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float clipAmount = 0.0;
    float pixelWidth = czm_metersPerPixel(position);
    for (int i = 0; i < ${e}; ++i)
    {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        clipAmount = max(amount, clipAmount);
        clipped = clipped && (amount <= 0.0);
    }
    if (clipped)
    {
        discard;
    }
    return clipAmount;
}
`}function uct(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
    int pixY = clippingPlaneNumber / ${e};
    int pixX = clippingPlaneNumber - (pixY * ${e});
    float u = (float(pixX) + 0.5) * ${o};
    float v = (float(pixY) + 0.5) * ${r};
    vec4 plane = texture(packedClippingPlanes, vec2(u, v));
    return czm_transformPlane(plane, transform);
}
`}function mct(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
    int clippingPlaneStartIndex = clippingPlaneNumber * 2;
    int pixY = clippingPlaneStartIndex / ${e};
    int pixX = clippingPlaneStartIndex - (pixY * ${e});
    float u = (float(pixX) + 0.5) * ${o};
    float v = (float(pixY) + 0.5) * ${r};
    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
    vec4 plane;
    plane.xyz = czm_octDecode(oct, 65535.0);
    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
    return czm_transformPlane(plane, transform);
}
`}var f0=cct;function hct(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function $j(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function fct(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case oe.SCENE3D:o=t;break;case oe.SCENE2D:case oe.COLUMBUS_VIEW:o=n;break;case oe.MORPHING:o=i;break}return o}function pct(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
    czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
  }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
    }`}function bct(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
    return czm_unpackClippingExtents(extentsTexture, index);
  }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
      return vec4();
    }`}function gct(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}$j.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,f=e.showOceanWaves,x=e.enableLighting,_=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,V=e.showGroundAtmosphere,L=e.perFragmentGroundAtmosphere,R=e.hasVertexNormals,G=e.useWebMercatorProjection,I=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,w=e.enableClippingPolygons,M=e.clippingPolygons,b=e.clippedByBoundaries,Z=e.hasImageryLayerCutout,E=e.colorCorrect,X=e.highlightFillTile,F=e.colorToAlpha,N=e.hasGeodeticSurfaceNormals,O=e.hasExaggeration,U=e.showUndergroundColor,Y=e.translucent,k=0,H="",te=n.renderedMesh.encoding;te.quantization===ks.BITS12&&(k=1,H="QUANTIZATION_BITS12");let j=0,ee="";b&&(j=1,ee="TILE_LIMIT_RECTANGLE");let fe=0,Te="";Z&&(fe=1,Te="APPLY_IMAGERY_CUTOUT");let de=t.mode,xe=de|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|g<<9|f<<10|x<<11|_<<12|C<<13|V<<14|L<<15|R<<16|G<<17|I<<18|k<<19|h<<20|v<<21|w<<22|j<<23|fe<<24|E<<25|X<<26|F<<27|N<<28|O<<29|U<<30|Y<<31|u<<32,Ce=0;l(P)&&P.length>0&&(Ce=v?P.clippingPlanesState:0);let Ie=0;l(M)&&M.length>0&&(Ie=w?M.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===xe&&Le.material===this.material&&Le.clippingShaderState===Ce&&Le.clippingPolygonShaderState===Ie)return Le.shaderProgram;let Ne=this._shadersByTexturesFlags[i];if(l(Ne)||(Ne=this._shadersByTexturesFlags[i]=[]),Le=Ne[xe],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==Ce||Le.clippingPolygonShaderState!==Ie){let Oe=this.baseVertexShaderSource.clone(),qe=this.baseFragmentShaderSource.clone();Ce!==0&&qe.sources.unshift(f0(P,t.context)),Ie!==0&&(qe.sources.unshift(pct(t.context)),Oe.sources.unshift(bct(t.context))),Oe.defines.push(H),qe.defines.push(`TEXTURE_UNITS ${i}`,ee,Te),o&&qe.defines.push("APPLY_BRIGHTNESS"),r&&qe.defines.push("APPLY_CONTRAST"),s&&qe.defines.push("APPLY_HUE"),a&&qe.defines.push("APPLY_SATURATION"),c&&qe.defines.push("APPLY_GAMMA"),d&&qe.defines.push("APPLY_ALPHA"),u&&qe.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&qe.defines.push("HAS_WATER_MASK"),g&&(qe.defines.push("SHOW_REFLECTIVE_OCEAN"),Oe.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&qe.defines.push("SHOW_OCEAN_WAVES"),F&&qe.defines.push("APPLY_COLOR_TO_ALPHA"),U&&(Oe.defines.push("UNDERGROUND_COLOR"),qe.defines.push("UNDERGROUND_COLOR")),Y&&(Oe.defines.push("TRANSLUCENT"),qe.defines.push("TRANSLUCENT")),x&&(R?(Oe.defines.push("ENABLE_VERTEX_LIGHTING"),qe.defines.push("ENABLE_VERTEX_LIGHTING")):(Oe.defines.push("ENABLE_DAYNIGHT_SHADING"),qe.defines.push("ENABLE_DAYNIGHT_SHADING"))),_&&(Oe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),qe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(Oe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),qe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Oe.defines.push("GROUND_ATMOSPHERE"),qe.defines.push("GROUND_ATMOSPHERE"),L&&(Oe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),qe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Oe.defines.push("INCLUDE_WEB_MERCATOR_Y"),qe.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Oe.defines.push("FOG"),qe.defines.push("FOG")),h&&qe.defines.push("APPLY_SPLIT"),v&&qe.defines.push("ENABLE_CLIPPING_PLANES"),w&&(qe.defines.push("ENABLE_CLIPPING_POLYGONS"),Oe.defines.push("ENABLE_CLIPPING_POLYGONS"),M.inverse&&qe.defines.push("CLIPPING_INVERSE"),qe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${M.extentsCount}`),Oe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${M.extentsCount}`)),E&&qe.defines.push("COLOR_CORRECT"),X&&qe.defines.push("HIGHLIGHT_FILL_TILE"),N&&Oe.defines.push("GEODETIC_SURFACE_NORMALS"),O&&Oe.defines.push("EXAGGERATION");let Rt=`    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
    {
        vec4 color = initialColor;
`;Z&&(Rt+=`        vec4 cutoutAndColorResult;
        bool texelUnclipped;
`);for(let ke=0;ke<i;++ke)Z?Rt+=`        cutoutAndColorResult = u_dayTextureCutoutRectangles[${ke}];
        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
        cutoutAndColorResult = sampleAndBlend(
`:Rt+=`        color = sampleAndBlend(
`,Rt+=`            color,
            u_dayTextures[${ke}],
            u_dayTextureUseWebMercatorT[${ke}] ? textureCoordinates.xz : textureCoordinates.xy,
            u_dayTextureTexCoordsRectangle[${ke}],
            u_dayTextureTranslationAndScale[${ke}],
            ${d?`u_dayTextureAlpha[${ke}]`:"1.0"},
            ${u?`u_dayTextureNightAlpha[${ke}]`:"1.0"},
${u?`u_dayTextureDayAlpha[${ke}]`:"1.0"},
${o?`u_dayTextureBrightness[${ke}]`:"0.0"},
            ${r?`u_dayTextureContrast[${ke}]`:"0.0"},
            ${s?`u_dayTextureHue[${ke}]`:"0.0"},
            ${a?`u_dayTextureSaturation[${ke}]`:"0.0"},
            ${c?`u_dayTextureOneOverGamma[${ke}]`:"0.0"},
            ${h?`u_dayTextureSplit[${ke}]`:"0.0"},
            ${F?`u_colorsToAlpha[${ke}]`:"vec4(0.0)"},
        nightBlend        );
`,Z&&(Rt+=`        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);Rt+=`        return color;
    }`,qe.sources.push(Rt),Oe.sources.push(fct(de)),Oe.sources.push(gct(G));let Lt=$t.fromCache({context:t.context,vertexShaderSource:Oe,fragmentShaderSource:qe,attributeLocations:te.getAttributeLocations()});Le=Ne[xe]=new hct(i,xe,this.material,Lt,Ce,Ie)}return n.surfaceShader=Le,Le.shaderProgram};$j.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return me(this)};var Ow=$j;var Awi=T(S(),1);var UIi=T(S(),1);var cIi=T(S(),1),yct={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ci=Object.freeze(yct);var dIi=T(S(),1),xct={START:0,LOADING:1,DONE:2,FAILED:3},ea=Object.freeze(xct);var mIi=T(S(),1),_ct={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},mo=Object.freeze(_ct);function ir(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=mo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(ir.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===mo.RECEIVING||e===mo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ci.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Tct=new he;function e8(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==oe.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Tct);s=n.project(c,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var Sct=new m,Cct=new m,Vct=new m;ir.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let h=0;h<d;h+=3){let p=a[h],g=a[h+1],f=a[h+2],x=e8(c,t,n,s,p,Sct),_=e8(c,t,n,s,g,Cct),C=e8(c,t,n,s,f,Vct),V=qn.rayTriangleParametric(e,x,_,C,i);l(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?pn.getPoint(e,u,o):void 0};ir.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=mo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};ir.prototype.freeVertexArray=function(){ir._freeVertexArray(this.vertexArray),this.vertexArray=void 0,ir._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};ir.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new ir),e.state===ea.START&&(Lct(e,t,n),e.state=ea.LOADING)};ir.processStateMachine=function(e,t,n,i,o,r,s){ir.initialize(e,n,i);let a=e.data;if(e.state===ea.LOADING&&Rct(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===mo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let h=e._loadedCallbacks,p={};for(let g in h)h.hasOwnProperty(g)&&(h[g](e)||(p[g]=h[g]));e._loadedCallbacks=p,e.state=ea.DONE}c&&(e.renderable=!0)};ir.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,d,u;for(d=0,u=c.length;d<u;++d){let h=c[d];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===ci.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),c.splice(d,1),g._createTileImagerySkeletons(e,t,d),--d,u=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===ci.FAILED||h.loadingImagery.state===ci.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Sye(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=sc.clone(s);c.hasGeodeticSurfaceNormals=t,c=sc.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(ir._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=ir._createVertexArrayForMesh(i.context,o)):(ir._freeVertexArray(e.vertexArray),e.vertexArray=ir._createVertexArrayForMesh(i.context,o)),ir._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}ir.prototype.addGeodeticSurfaceNormals=function(e,t){Sye(this,!0,e,t)};ir.prototype.removeGeodeticSurfaceNormals=function(e){Sye(this,!1,void 0,e)};ir.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,d=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!c.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let g=0;g<p;g++){let f=h[g];f.level=-1}}}};function Lct(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=mo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Rct(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===mo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||ir.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===mo.FAILED&&Zct(s,e,t,n,e.x,e.y,e.level),s.terrainState===mo.UNLOADED&&Gct(s,n,e.x,e.y,e.level),s.terrainState===mo.RECEIVED&&Ict(s,t,n,e.x,e.y,e.level),s.terrainState===mo.TRANSFORMED&&(Xct(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=mo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Pct(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Zct(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ea.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,h,o,r,s);l(p)&&(e.terrainState=mo.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=mo.RECEIVED)}).catch(function(){e.terrainState=mo.FAILED}))}function Gct(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=mo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=mo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===jn.CANCELLED){e.terrainData=void 0,e.terrainState=mo.UNLOADED,e.request=void 0;return}e.terrainState=mo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Co.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ho({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=mo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=mo.UNLOADED,e.request=void 0)}a()}var Ect={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Ict(e,t,n,i,o,r){let s=n.tilingScheme,a=Ect;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=mo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=mo.TRANSFORMED}).catch(function(){e.terrainState=mo.FAILED}))}ir._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=xt.createVertexBuffer({context:e,typedArray:n,usage:Me.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=xt.createIndexBuffer({context:e,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ni({context:e,attributes:o,indexBuffer:s})};ir._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Xct(e,t,n,i,o,r,s){e.vertexArray=ir._createVertexArrayForMesh(t,e.mesh),e.terrainState=mo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Wct(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=vt.create({context:e,pixelFormat:it.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Pct(e,t){let n=t.terrainData.waterMask,i=Wct(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=vt.create({context:e,pixelFormat:it.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}ir.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};ir.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var hm=ir;var mvi=T(S(),1);var hPi=T(S(),1);var sPi=T(S(),1);var XXi=T(S(),1);var HIi=T(S(),1);var t8,Cye="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmR-yn9MvzP-kKlsEftvba-Ksa9fy6DfgprKJvVPrYflNktZkc_R1DWiCclyPfJDVoQFVG5RAYgC6zo1Y0tjygPXWzKh6a7QBgk7gX6xm7vkHmbExafWckqkicqYw9UkxFf1Fjya64KizMRumKKV-VXV6_CwU0hR7Zv4pDhQDz4bwoyMxi_abRmOIS58oUlATyE.AT1_X4rsxcr3",JV={};JV.defaultAccessToken=Cye;JV.defaultWorldImageryServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});JV.defaultWorldHillshadeServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});JV.defaultWorldOceanServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});JV.getDefaultTokenCredit=function(e){if(e===Cye){if(!l(t8)){let t='<b>             This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i>             with an API key from your ArcGIS Developer account before using the ArcGIS tile services.             You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';t8=new Ct(t,!0)}return t8}};var tu=JV;var qIi=T(S(),1);function n8(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ze.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Rm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,h=d.length;a&&u<h;++u){let p=d[u],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}n8.prototype.isReady=function(){return this._isReady};n8.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Rm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var Yw=n8;var tXi=T(S(),1);function i8(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}i8.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};i8.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var kh=i8;var aXi=T(S(),1);function QV(){pe.throwInstantiationError()}Object.defineProperties(QV.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});QV.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};QV.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};QV.prototype.pickFeatures=function(e,t,n,i,o){pe.throwInstantiationError()};var vct=/\.ktx2$/i;QV.loadImage=function(e,t){let n=Ze.createIfNeeded(t);return vct.test(n.url)?Zl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var pl=QV;var lXi=T(S(),1),wct={SATELLITE:1,OCEANS:2,HILLSHADE:3},Uh=Object.freeze(wct);function Vye(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Hi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Vye.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new Yw({missingImageUrl:Lye(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Fct(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new qr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Hi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Wi,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Ct(e.copyrightText)]:t.credit=new Ct(e.copyrightText))}function Act(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Mct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Fct(i,t)}catch(i){Act(e,i)}}function np(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Hi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new be}np.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Uh.SATELLITE:{n=y(t.token,tu.defaultAccessToken),i=Ze.createIfNeeded(tu.defaultWorldImageryServer),i.appendForwardSlash();let r=tu.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Uh.OCEANS:{n=y(t.token,tu.defaultAccessToken),i=Ze.createIfNeeded(tu.defaultWorldOceanServer),i.appendForwardSlash();let r=tu.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Uh.HILLSHADE:{n=y(t.token,tu.defaultAccessToken),i=Ze.createIfNeeded(tu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=tu.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;default:}return np.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Lye(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ei?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(np.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});np.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new np(t);i._resource=n;let o=new Vye(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await Mct(n,o),o.build(i),i};np.prototype.getTileCredits=function(e,t,n){return this._tileCredits};np.prototype.requestImage=function(e,t,n,i){return pl.loadImage(this,Lye(this,e,t,n,i))};np.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ei)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let g=[],f=p.results;if(!l(f))return g;for(let x=0;x<f.length;++x){let _=f[x],C=new kh;if(C.data=_,C.name=_.value,C.properties=_.attributes,C.configureDescriptionFromProperties(_.attributes),_.geometryType==="esriGeometryPoint"&&_.geometry){let V=_.geometry.spatialReference&&_.geometry.spatialReference.wkid?_.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)C.position=he.fromDegrees(_.geometry.x,_.geometry.y,_.geometry.z);else if(V===102100||V===900913||V===3857){let L=new Wi;C.position=L.unproject(new m(_.geometry.x,_.geometry.y,_.geometry.z))}}g.push(C)}return g})};np._metadataCache={};var p0=np;var qXi=T(S(),1);var PXi=T(S(),1),Nct={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},jV=Object.freeze(Nct);var FXi=T(S(),1);function Hw(e){}Hw.prototype.isReady=function(){return!0};Hw.prototype.shouldDiscardImage=function(e){return Hw.EMPTY_IMAGE===e};var zD;Object.defineProperties(Hw,{EMPTY_IMAGE:{get:function(){return l(zD)||(zD=new Image,zD.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),zD}}});var qV=Hw;function Rye(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Rye.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof Ct)break;o.credit=new Ct(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new ce(W.toRadians(d[1]),W.toRadians(d[0]),W.toRadians(d[3]),W.toRadians(d[2]))}}};function kct(e,t){if(e.resourceSets.length!==1)throw new ae("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function Uct(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Co.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function Dct(e,t,n){let i=e.url,o=Ps._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Ps._metadataCache[i]=o);try{let r=await o;return kct(r,t)}catch(r){Uct(e,r,n)}}function Ps(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,jV.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new qV),this._proxy=e.proxy,this._credit=new Ct(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Ps.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new qr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(Ps.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Ps.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,jV.AERIAL),o=Ze.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ps(t);a._resource=o;let c=new Rye(t);return await Dct(s,c),c.build(a),a};var Bct=new ce;Ps.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Bct);return Hct(this._attributionList,n,i)};Ps.prototype.requestImage=function(e,t,n,i){let o=pl.loadImage(this,Oct(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?qV.EMPTY_IMAGE:Promise.reject(r)})};Ps.prototype.pickFeatures=function(e,t,n,i,o){};Ps.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;(e&r)!==0&&(s|=1),(t&r)!==0&&(s|=2),i+=s}return i};Ps.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];(s&1)!==0&&(t|=r),(s&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};Ps._logoUrl=void 0;Object.defineProperties(Ps,{logoUrl:{get:function(){return l(Ps._logoUrl)||(Ps._logoUrl=nn("Assets/Images/bing_maps_credit.png")),Ps._logoUrl},set:function(e){Ps._logoUrl=e}}});function Oct(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Ps.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Yct=new ce;function Hct(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let h=a[d];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,Yct);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ps._metadataCache={};var zw=Ps;var EWi=T(S(),1);var fWi=T(S(),1);var Zye=/{[^}]+}/g,Gye={x:Qct,y:qct,z:tlt,s:nlt,reverseX:jct,reverseY:$ct,reverseZ:elt,westDegrees:ilt,southDegrees:olt,eastDegrees:rlt,northDegrees:slt,westProjected:alt,southProjected:clt,eastProjected:llt,northProjected:dlt,width:ult,height:mlt},zct=St(Gye,{i:hlt,j:flt,reverseI:plt,reverseJ:blt,longitudeDegrees:ylt,latitudeDegrees:xlt,longitudeProjected:_lt,latitudeProjected:Tlt,format:Clt});function Kw(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be;let t=Ze.createIfNeeded(e.url),n=Ze.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new qr({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Ct(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=St(Gye,r),a=St(zct,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(Kw.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});Kw.prototype.getTileCredits=function(e,t,n){};Kw.prototype.requestImage=function(e,t,n,i){return pl.loadImage(this,Kct(this,e,t,n,i))};Kw.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=Jct(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var KD=!1,nu=new ce,JD=!1,Jw=new ce;function Kct(e,t,n,i,o){KD=!1,JD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(Zye);return l(d)&&d.forEach(function(u){let h=u.substring(1,u.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var o8=!1,eL=new D,r8=!1;function Jct(e,t,n,i,o,r,s){KD=!1,JD=!1,o8=!1,r8=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},h=c.match(Zye);return l(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function tL(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Qct(e,t,n,i){return tL(e,"{x}",t)}function jct(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return tL(e,"{reverseX}",o)}function qct(e,t,n,i){return tL(e,"{y}",n)}function $ct(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return tL(e,"{reverseY}",o)}function elt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return tL(e,"{reverseZ}",r)}function tlt(e,t,n,i){return tL(e,"{z}",i)}function nlt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function QD(e,t,n,i){KD||(e.tilingScheme.tileXYToRectangle(t,n,i,nu),nu.west=W.toDegrees(nu.west),nu.south=W.toDegrees(nu.south),nu.east=W.toDegrees(nu.east),nu.north=W.toDegrees(nu.north),KD=!0)}function ilt(e,t,n,i){return QD(e,t,n,i),nu.west}function olt(e,t,n,i){return QD(e,t,n,i),nu.south}function rlt(e,t,n,i){return QD(e,t,n,i),nu.east}function slt(e,t,n,i){return QD(e,t,n,i),nu.north}function jD(e,t,n,i){JD||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,Jw),JD=!0)}function alt(e,t,n,i){return jD(e,t,n,i),Jw.west}function clt(e,t,n,i){return jD(e,t,n,i),Jw.south}function llt(e,t,n,i){return jD(e,t,n,i),Jw.east}function dlt(e,t,n,i){return jD(e,t,n,i),Jw.north}function ult(e,t,n,i){return e.tileWidth}function mlt(e,t,n,i){return e.tileHeight}function hlt(e,t,n,i,o,r,s){return qD(e,t,n,i,o,r),eL.x}function flt(e,t,n,i,o,r,s){return qD(e,t,n,i,o,r),eL.y}function plt(e,t,n,i,o,r,s){return qD(e,t,n,i,o,r),e.tileWidth-eL.x-1}function blt(e,t,n,i,o,r,s){return qD(e,t,n,i,o,r),e.tileHeight-eL.y-1}var glt=new ce,$V=new m;function qD(e,t,n,i,o,r,s){if(o8)return;s8(e,t,n,i,o,r);let a=$V,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,glt);eL.x=e.tileWidth*(a.x-c.west)/c.width|0,eL.y=e.tileHeight*(c.north-a.y)/c.height|0,o8=!0}function ylt(e,t,n,i,o,r,s){return W.toDegrees(o)}function xlt(e,t,n,i,o,r,s){return W.toDegrees(r)}function _lt(e,t,n,i,o,r,s){return s8(e,t,n,i,o,r),$V.x}function Tlt(e,t,n,i,o,r,s){return s8(e,t,n,i,o,r),$V.y}var Slt=new he;function s8(e,t,n,i,o,r,s){if(!r8){if(e.tilingScheme.projection instanceof Ei)$V.x=W.toDegrees(o),$V.y=W.toDegrees(r);else{let a=Slt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,$V)}r8=!0}}function Clt(e,t,n,i,o,r,s){return s}var Oa=Kw;function fm(e){Oa.call(this,e)}fm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return fm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof tf)return fm._metadataFailure(e,t);throw o}};fm.fromUrl=async function(e,t){let n=Ze.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await fm._requestMetadata(t,i,o);return new fm(r)};l(Object.create)&&(fm.prototype=Object.create(Oa.prototype),fm.prototype.constructor=fm);function Eye(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function Iye(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}fm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,h,p=[],g=e.childNodes[0].childNodes;for(let P=0;P<g.length;P++)if(r.test(g.item(P).nodeName))d=g.item(P);else if(a.test(g.item(P).nodeName)){h=g.item(P);let w=g.item(P).childNodes;for(let M=0;M<w.length;M++)s.test(w.item(M).nodeName)&&p.push(w.item(M))}else c.test(g.item(P).nodeName)&&(u=g.item(P));let f;if(!l(h)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Co.reportError(void 0,o,o.errorEvent,f),new ae(f);let x=y(t.fileExtension,d.getAttribute("extension")),_=y(t.tileWidth,parseInt(d.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(d.getAttribute("height"),10)),V=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),L=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),R=h.getAttribute("profile"),G=t.tilingScheme;if(!l(G))if(R==="geodetic"||R==="global-geodetic")G=new Hi({ellipsoid:t.ellipsoid});else if(R==="mercator"||R==="global-mercator")G=new qr({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${R}.`,l(o)&&Co.reportError(void 0,o,o.errorEvent,f),new ae(f);let I=ce.clone(t.rectangle);if(!l(I)){let P,w,M,b;y(t.flipXY,!1)?(M=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(M=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let E=R==="geodetic"||R==="mercator";if(G.projection instanceof Ei||E)P=he.fromDegrees(M.x,M.y),w=he.fromDegrees(b.x,b.y);else{let X=G.projection;P=X.unproject(M),w=X.unproject(b)}I=new ce(P.longitude,P.latitude,w.longitude,w.latitude)}return I=Eye(I,G),V=Iye(G,I,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:G,rectangle:I,tileWidth:_,tileHeight:C,minimumLevel:V,maximumLevel:L,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};fm._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new qr({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=Eye(a,s);let c=Iye(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Fy=fm;var BWi=T(S(),1);function Xye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Xye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Vlt(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new qr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function Llt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Co.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function Rlt(e,t,n){try{let i=await e.fetchText();Vlt(i,t)}catch(i){Llt(i,e,n)}}function td(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Ct(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${td.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(td.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});td.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Ze.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new Xye(n);s.channel=t,await Rlt(r,s);let a=new td(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};td.prototype.getTileCredits=function(e,t,n){};td.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return pl.loadImage(this,o)};td.prototype.pickFeatures=function(e,t,n,i,o){};td._logoUrl=void 0;Object.defineProperties(td,{logoUrl:{get:function(){return l(td._logoUrl)||(td._logoUrl=nn("Assets/Images/google_earth_credit.png")),td._logoUrl},set:function(e){td._logoUrl=e}}});var Qw=td;var QWi=T(S(),1);var Zlt=/\/$/,Wye=new Ct('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function nL(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ze.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Zlt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Ct(s))):s=Wye,this._resource=i,this._imageryProvider=new Oa({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(nL.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});nL.prototype.getTileCredits=function(e,t,n){};nL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};nL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};nL._defaultCredit=Wye;var jw=nL;var c2i=T(S(),1);function JT(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new Hi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i;let o=Ze.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(JT.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Glt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Co.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return a8(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function a8(e,t,n){try{return await pl.loadImage(null,e)}catch(i){return Glt(e,i,t,n)}}JT.fromUrl=async function(e,t){let n=Ze.createIfNeeded(e),i=await a8(n);t=y(t,y.EMPTY_OBJECT);let o=new JT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};JT.prototype.getTileCredits=function(e,t,n){};JT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await a8(this._resource,this);return this._image=o,Co.reportSuccess(this._errorEvent),o}return this._image};JT.prototype.pickFeatures=function(e,t,n,i,o){};var qw=JT;var W2i=T(S(),1);var f2i=T(S(),1);function Elt(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Ilt:e==="xml"?n=vlt:(e==="html"||e==="text")&&(n=Pye)),this.callback=n}function Ilt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new kh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var c8="http://www.mapinfo.com/mxp",Xlt="http://www.esri.com/wms",Wlt="http://www.opengis.net/wfs",Plt="http://www.opengis.net/gml";function vlt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===c8)return wlt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Xlt)return Flt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Wlt)return Alt(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Mlt(e):Nlt(e)}function wlt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(c8,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(c8,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let h=u.getAttribute("ref"),p=u.textContent.trim();s[h]=p}}let c=new kh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Flt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push($D(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push($D(a,i))}}return n}function Alt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Plt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};l8(r,s),t.push($D(r,s))}return t}function Mlt(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new ae("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};l8(s,a),t.push($D(s,a))}}return t}function l8(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&l8(o,t)&&(t[o.localName]=o.textContent)}return n}function $D(e,t){let n=new kh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Nlt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new kh;return o.data=e,o.description=n.innerHTML,[o]}var klt=/<body>\s*<\/body>/im,Ult=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Dlt=/<title>([\s\S]*)<\/title>/im;function Pye(e){if(klt.test(e)||Ult.test(e))return;let t,n=Dlt.exec(e);n&&n.length>1&&(t=n[1]);let i=new kh;return i.name=t,i.description=e,i.data=e,[i]}var QT=Elt;var T2i=T(S(),1);function $w(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties($w.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});$w.prototype.getFromCache=function(e,t,n,i){let o=vye(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};$w.prototype.checkApproachingInterval=function(e,t,n,i){let o=vye(e,t,n),r=this._tilesRequestedForInterval,s=wye(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!Fye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};$w.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=wye(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Fye(this,c,r),a||s.push(c)}}};function vye(e,t,n){return`${e}-${t}-${n}`}function Blt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function wye(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=q.secondsDifference(c.stop,i),++a):(s=q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function Fye(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Blt(s),c=new Ho({throttle:!1,throttleByServer:!0,type:ds.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var jT=$w;var Olt=[3034,3035,3042,3043,3044],Ylt=[4471,4559];function Dh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Ze.createIfNeeded(e.url),n=Ze.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Dh.DefaultParameters,!0),n.setQueryParameters(Dh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Aye(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Aye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new jT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return Mye(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Wi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Ylt.includes(a)||Olt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Wi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Oa({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Hi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,Dh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function Mye(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Hlt(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Dh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Dh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Dh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Mye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Dh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Hlt(this,e,t,n,i,o,s)};Dh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Dh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Dh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new QT("json","application/json")),Object.freeze(new QT("xml","text/xml")),Object.freeze(new QT("text","text/html"))]);function Aye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var eF=Dh;var O2i=T(S(),1);var zlt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function tF(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ze.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(zlt),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new qr({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new jT({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,f,x){return Nye(s,h,p,g,f,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new be;let u=e.credit;this._credit=typeof u=="string"?new Ct(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Nye(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(d)&&h.setTemplateValues(d),l(u)&&h.setTemplateValues(u);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=St(g,d)),l(u)&&(g=St(g,u)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return pl.loadImage(e,h)}Object.defineProperties(tF.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});tF.prototype.getTileCredits=function(e,t,n){};tF.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Nye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};tF.prototype.pickFeatures=function(e,t,n,i,o){};var nF=tF;var Klt={ARCGIS_MAPSERVER:p0.fromUrl,BING:async(e,t)=>zw.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,Qw.fromUrl(e,n,t)},MAPBOX:(e,t)=>new jw({url:e,...t}),SINGLE_TILE:qw.fromUrl,TMS:Fy.fromUrl,URL_TEMPLATE:(e,t)=>new Oa({url:e,...t}),WMS:(e,t)=>new eF({url:e,...t}),WMTS:(e,t)=>new nF({url:e,...t})};function ip(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties(ip.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});ip.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=pd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=ip._endpointCache[i];l(o)||(o=n.fetchJson(),ip._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Fy.fromUrl(new pd(r,n));else{let d=Klt[a];if(!l(d))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},h=u.url;delete u.url,s=await d(h,u)}let c=new ip(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=pd.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};ip.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};ip.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ip.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ip._endpointCache={};var b0=ip;var cPi=T(S(),1),Jlt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},g0=Object.freeze(Jlt);function Qlt(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,g0.AERIAL);return b0.fromAssetId(t)}var y0=Qlt;var pPi=T(S(),1),iF=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var gPi=T(S(),1),oF=`in vec4 position;
in float webMercatorT;

uniform vec2 u_textureDimensions;

out vec2 v_textureCoordinates;

void main()
{
    v_textureCoordinates = vec2(position.x, webMercatorT);
    gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
}
`;var SPi=T(S(),1);function iL(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ci.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}iL.createPlaceholder=function(e){let t=new iL(e,0,0,0);return t.addReference(),t.state=ci.PLACEHOLDER,t};iL.prototype.addReference=function(){++this.referenceCount};iL.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),me(this),0):this.referenceCount};iL.prototype.processStateMachine=function(e,t,n){this.state===ci.UNLOADED&&!n&&(this.state=ci.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ci.RECEIVED&&(this.state=ci.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ci.READY&&t&&!this.texture;(this.state===ci.TEXTURE_LOADED||i)&&(this.state=ci.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var oL=iL;var RPi=T(S(),1);function d8(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}d8.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};d8.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ci.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ci.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ci.FAILED&&r.state!==ci.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ci.FAILED||i.state===ci.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var rL=d8;function Si(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Si.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Si.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Si.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Si.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Si.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Si.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Si.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Si.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new rL(oL.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Si.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Si.DEFAULT_BRIGHTNESS=1;Si.DEFAULT_CONTRAST=1;Si.DEFAULT_HUE=0;Si.DEFAULT_SATURATION=1;Si.DEFAULT_GAMMA=1;Si.DEFAULT_SPLIT=kr.NONE;Si.DEFAULT_MINIFICATION_FILTER=jt.LINEAR;Si.DEFAULT_MAGNIFICATION_FILTER=hi.LINEAR;Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Si.fromProviderAsync=function(e,t){let n=new Si(void 0,t);return tdt(n,Promise.resolve(e)),n};Si.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Si.fromProviderAsync(y0({style:e.style}),e)};Si.prototype.isBaseLayer=function(){return this._isBaseLayer};Si.prototype.isDestroyed=function(){return!1};Si.prototype.destroy=function(){return me(this)};var Dye=new ce,kye=new ce,u8=new ce,Bye=new ce;Si.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Si.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Wi&&e.rectangle.north<Wi.MaximumLatitude&&e.rectangle.south>-Wi.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,Dye),a=ce.intersection(e.rectangle,s,kye);if(!l(a)){if(!this.isBaseLayer())return!1;let E=s,X=e.rectangle;a=kye,X.south>=E.north?a.north=a.south=E.north:X.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(X.south,E.south),a.north=Math.min(X.north,E.north)),X.west>=E.east?a.west=a.east=E.east:X.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(X.west,E.west),a.east=Math.min(X.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),h=$lt(this,u,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let E=o.minimumLevel;h<E&&(h=E)}let g=o.tilingScheme,f=g.positionToTileXY(ce.northwest(a),h),x=g.positionToTileXY(ce.southeast(a),h),_=e.rectangle.width/512,C=e.rectangle.height/512,V=g.tileXYToRectangle(f.x,f.y,h);Math.abs(V.south-e.rectangle.north)<C&&f.y<x.y&&++f.y,Math.abs(V.east-e.rectangle.west)<_&&f.x<x.x&&++f.x;let L=g.tileXYToRectangle(x.x,x.y,h);Math.abs(L.north-e.rectangle.south)<C&&x.y>f.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>f.x&&--x.x;let R=ce.clone(e.rectangle,Bye),G=g.tileXYToRectangle(f.x,f.y,h),I=ce.intersection(G,s,u8),v;r?(g.rectangleToNativeRectangle(R,R),g.rectangleToNativeRectangle(G,G),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),v=g.tileXYToNativeRectangle.bind(g),_=R.width/512,C=R.height/512):v=g.tileXYToRectangle.bind(g);let P,w=0,M=1,b;!this.isBaseLayer()&&Math.abs(I.west-R.west)>=_&&(w=Math.min(1,(I.west-R.west)/R.width)),!this.isBaseLayer()&&Math.abs(I.north-R.north)>=C&&(M=Math.max(0,(I.north-R.south)/R.height));let Z=M;for(let E=f.x;E<=x.x;E++)if(P=w,G=v(E,f.y,h),I=ce.simpleIntersection(G,s,u8),!!l(I)){w=Math.min(1,(I.east-R.west)/R.width),E===x.x&&(this.isBaseLayer()||Math.abs(I.east-R.east)<_)&&(w=1),M=Z;for(let X=f.y;X<=x.y;X++){if(b=M,G=v(E,X,h),I=ce.simpleIntersection(G,s,u8),!l(I))continue;M=Math.max(0,(I.south-R.south)/R.height),X===x.y&&(this.isBaseLayer()||Math.abs(I.south-R.south)<C)&&(M=0);let F=new se(P,M,w,b),N=this.getImageryFromCache(E,X,h);i.imagery.splice(n,0,new rL(N,F,r)),++n}}return!0};Si.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Dye),i=c.rectangleToNativeRectangle(i,Bye)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Si.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ci.RECEIVED,e.request=void 0,Co.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===jn.CANCELLED){e.state=ci.UNLOADED,e.request=void 0;return}e.state=ci.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Co.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ho({throttle:!1,throttleByServer:!0,type:ds.IMAGERY});e.request=s,e.state=ci.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ci.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Si.prototype._createTextureWebGL=function(e,t){let n=new qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new vt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new vt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?it.RGBA:it.RGB,sampler:n})};Si.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ci.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ci.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Wi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ci.TEXTURE_LOADED};function Uye(e,t,n){return`${e}:${t}:${n}`}Si.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===jt.LINEAR&&i===hi.LINEAR&&!it.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=jt.LINEAR_MIPMAP_LINEAR;let r=At.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=Uye(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(df.NICEST),t.sampler=d}else{let r=Uye(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Si.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ei)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new wc({persists:!0,owner:this,preExecute:function(c){qlt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ci.READY,t.releaseReference()},canceled:function(){t.state=ci.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ci.READY};Si.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Si.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Si.prototype.getImageryFromCache=function(e,t,n,i){let o=Oye(e,t,n),r=this._imageryCache[o];return l(r)||(r=new oL(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Si.prototype.removeImageryFromCache=function(e){let t=Oye(e.x,e.y,e.level);delete this._imageryCache[t]};function Oye(e,t,n){return JSON.stringify([e,t,n])}var eB={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},jlt=Bt.supportsTypedArrays()?new Float32Array(2*64):void 0;function qlt(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let v=I/63;_[C++]=0,_[C++]=v,_[C++]=1,_[C++]=v}let V={position:0,webMercatorT:1},L=jr.getRegularGridIndices(2,64),R=xt.createIndexBuffer({context:t,typedArray:L,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:V.position,vertexBuffer:xt.createVertexBuffer({context:t,typedArray:_,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:xt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:R});let G=new De({sources:[oF]});o.shaderProgram=$t.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:iF,attributeLocations:V}),o.sampler=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;eB.textureDimensions.x=r,eB.textureDimensions.y=s,eB.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),h=new vt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&h.generateMipmap(df.NICEST);let p=i.south,g=i.north,f=jlt,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,g,C);a=Math.sin(V);let R=(.5*Math.log((1+a)/(1-a))-c)*u;f[x++]=R,f[x++]=R}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=eB,e.vertexArray=o.vertexArray}function $lt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ei?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function edt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function tdt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){edt(e._errorEvent,i)}}var Ya=Si;var Fvi=T(S(),1);var fvi=T(S(),1),Yye={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Yye.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Jn=Yye;function aL(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}aL.prototype.update=function(e,t,n){this.changedThisFrame&&(qye(e,t,this.tile,n),this.changedThisFrame=!1)};aL.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};aL.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):hm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var ndt=new og;aL.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=ndt;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);vs(e,n,c,d,s,yn.EAST,!1,a,i),vs(e,n,c,u,s,yn.NORTH,!1,a,i),vs(e,n,c,h,s,yn.WEST,!1,a,i),vs(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),x=h.findTileToNorth(r),_=h.findTileToSouth(r);vs(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),vs(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),vs(e,n,c,f,s,yn.NORTHEAST,!1,a,i),vs(e,n,c,_,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function vs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Jn.wasKicked(d._lastSelectionResult)||Jn.originalResult(d._lastSelectionResult)===Jn.CULLED);){if(s)return;let u=d.parent;if(r>=yn.NORTHWEST&&u!==void 0)switch(r){case yn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case yn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case yn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case yn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Jn.RENDERED){if(l(d.data.vertexArray))return;idt(e,t,n,d,r,o,a,c);return}if(Jn.originalResult(i._lastSelectionResult)!==Jn.CULLED)switch(r){case yn.WEST:vs(e,t,n,i.northwestChild,o,r,!0,a,c),vs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:vs(e,t,n,i.southeastChild,o,r,!0,a,c),vs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:vs(e,t,n,i.southwestChild,o,r,!0,a,c),vs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:vs(e,t,n,i.northeastChild,o,r,!0,a,c),vs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:vs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:vs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:vs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:vs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new pe("Invalid edge")}}}function idt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new aL(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),odt(e,t,n,i,o,a)}function odt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(qye(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case yn.WEST:d=s.westMeshes,u=s.westTiles;break;case yn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case yn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case yn.NORTH:d=s.northMeshes,u=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let h,p,g,f,x=n.rectangle,_,C=i.rectangle;switch(o){case yn.WEST:for(_=(C.north-C.south)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.greaterThan(x.north,f.south,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case yn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.lessThan(x.west,f.east,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case yn.EAST:for(_=(C.north-C.south)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.lessThan(x.south,f.north,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case yn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.greaterThan(x.east,f.west,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.west,f.east,_));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||d[h]!==a,d[h]=a,u[h]=n):(s.changedThisFrame=!0,d.splice(h,p-h,a),u.splice(h,p-h,n))}var qT=new he,rdt=new he,sL=new m,p8=new m,m8=new D,h8=new D,iu=new D;function aB(){this.height=0,this.encodedNormal=new D}function tB(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;l(h)&&(p=h.minimumHeight,g=h.maximumHeight),d=(p+g)*.5}return $ye(e,t,n,i,d,c),c}var sdt={minimumHeight:0,maximumHeight:0},adt=new m,Hye=new aB,zye=new aB,Kye=new aB,Jye=new aB,cdt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,ldt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function qye(e,t,n,i){hm.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,h=iB(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Kye),p=iB(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,Hye),g=iB(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,zye),f=iB(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Jye);h=tB(r,u,0,1,h,p,f,g,Kye),p=tB(r,u,0,0,p,h,g,f,Hye),g=tB(r,u,1,1,g,p,f,h,zye),f=tB(r,u,1,1,f,g,h,p,Jye);let x=p.height,_=g.height,C=h.height,V=f.height,L=Math.min(x,_,C,V),R=Math.max(x,_,C,V),G=(L+R)*.5,I,v,P=e.getLevelMaximumGeometricError(n.level),w=u.maximumRadius-P,M=Math.acos(w/u.maximumRadius)*4;if(M*=1.5,s.width>M&&R-L<=P){let E=new Xa({width:9,height:9,buffer:cdt,structure:{heightOffset:R}}),X=ldt;X.tilingScheme=n.tilingScheme,X.x=n.x,X.y=n.y,X.level=n.level,X.exaggeration=a,X.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(X)}else{let E=d,X=ce.center(s,rdt);X.height=G;let F=u.cartographicToCartesian(X,adt),N=new sc(F,void 0,void 0,void 0,void 0,!0,!0,E,a,c),O=5,U;for(U=r.westMeshes,I=0,v=U.length;I<v;++I)O+=U[I].eastIndicesNorthToSouth.length;for(U=r.southMeshes,I=0,v=U.length;I<v;++I)O+=U[I].northIndicesWestToEast.length;for(U=r.eastMeshes,I=0,v=U.length;I<v;++I)O+=U[I].westIndicesSouthToNorth.length;for(U=r.northMeshes,I=0,v=U.length;I<v;++I)O+=U[I].southIndicesEastToWest.length;let Y=sdt;Y.minimumHeight=L,Y.maximumHeight=R;let k=N.stride,H=new Float32Array(O*k),K=0,te=K;K=nB(u,s,N,H,K,0,1,h.height,h.encodedNormal,1,Y),K=rB(r,u,N,H,K,r.westTiles,r.westMeshes,yn.EAST,Y);let z=K;K=nB(u,s,N,H,K,0,0,p.height,p.encodedNormal,0,Y),K=rB(r,u,N,H,K,r.southTiles,r.southMeshes,yn.NORTH,Y);let j=K;K=nB(u,s,N,H,K,1,0,g.height,g.encodedNormal,0,Y),K=rB(r,u,N,H,K,r.eastTiles,r.eastMeshes,yn.WEST,Y);let ee=K;K=nB(u,s,N,H,K,1,1,f.height,f.encodedNormal,1,Y),K=rB(r,u,N,H,K,r.northTiles,r.northMeshes,yn.SOUTH,Y),L=Y.minimumHeight,R=Y.maximumHeight;let fe=Gn.fromRectangle(s,L,R,n.tilingScheme.ellipsoid),Te=Wi.geodeticLatitudeToMercatorAngle(s.south),de=1/(Wi.geodeticLatitudeToMercatorAngle(s.north)-Te),xe=(Wi.geodeticLatitudeToMercatorAngle(X.latitude)-Te)*de,Ce=u.geodeticSurfaceNormalCartographic(qT,p8),Ie=wn.octEncode(Ce,m8),Le=K;N.encode(H,K*k,fe.center,D.fromElements(.5,.5,iu),G,Ie,xe,Ce),++K;let Ne=K,Oe=Ne<256?1:2,qe=(Ne-1)*3,Rt=qe*Oe,Lt=(H.length-Ne*k)*Float32Array.BYTES_PER_ELEMENT,ke;if(Lt>=Rt){let ge=Ne*k*Float32Array.BYTES_PER_ELEMENT;ke=Ne<256?new Uint8Array(H.buffer,ge,qe):new Uint16Array(H.buffer,ge,qe)}else ke=Ne<256?new Uint8Array(qe):new Uint16Array(qe);H=new Float32Array(H.buffer,0,Ne*k);let zt=0;for(I=0;I<Ne-2;++I)ke[zt++]=Le,ke[zt++]=I,ke[zt++]=I+1;ke[zt++]=Le,ke[zt++]=I,ke[zt++]=0;let ut=[];for(I=z;I>=te;--I)ut.push(I);let mt=[];for(I=j;I>=z;--I)mt.push(I);let Pn=[];for(I=ee;I>=j;--I)Pn.push(I);let cn=[];for(cn.push(0),I=Le-1;I>=ee;--I)cn.push(I);r.mesh=new Gu(N.center,H,ke,qe,Ne,L,R,le.fromOrientedBoundingBox(fe),bdt(e,fe.center,s,L,R),N.stride,fe,N,ut,mt,Pn,cn)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=hm._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let Z=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);l(E)&&l(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}l(Z)&&(--Z.referenceCount,Z.referenceCount===0&&Z.destroy())}function nB(e,t,n,i,o,r,s,a,c,d,u){let h=qT;h.longitude=W.lerp(t.west,t.east,r),h.latitude=W.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,sL),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,p8));let f=h8;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var sB=new ce;function rF(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,sB),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,sB),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,h=(r.north-o.south)/d,p=(n.x-a)/(c-a),g=(n.y-u)/(h-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var ddt=new D;function f8(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var udt=new D,mdt=new m;function hdt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,h=i.vertices,p=rF(t,n,u.decodeTextureCoordinates(h,o,iu),iu),g=rF(t,n,u.decodeTextureCoordinates(h,r,h8),h8),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let x=u.decodeHeight(h,o),_=u.decodeHeight(h,r),C=n.rectangle;qT.longitude=W.lerp(C.west,C.east,s),qT.latitude=W.lerp(C.south,C.north,a),d.height=qT.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(h,o,ddt),R=u.getOctEncodedNormal(h,r,udt),G=wn.octDecode(L.x,L.y,sL),I=wn.octDecode(R.x,R.y,mdt);V=m.lerp(G,I,f,sL),m.normalize(V,V),wn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(qT,sL),wn.octEncode(V,d.encodedNormal)}function $ye(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(qT,sL);wn.octEncode(s,r.encodedNormal)}function iB(e,t,n,i,o,r,s,a,c,d,u){if(jye(e,t,a,s,!1,n,i,u)||jye(e,t,d,c,!0,n,i,u))return u;let p;if(b8(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],f8(r,p,n,i,u),u;let g;if(n===0?i===0?g=oB(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=oB(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=oB(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=oB(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return $ye(e,t,n,i,g,u),u}function oB(e,t,n,i,o,r,s,a){let c=Qye(e,t,!1,n,s,a),d=Qye(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function rB(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=fdt(e,t,n,i,o,r[d],s[d],a,c);return o}function fdt(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===yn.EAST&&e.tile.x===0?(d=ce.clone(r.rectangle,sB),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===yn.WEST&&r.x===0&&(d=ce.clone(r.rectangle,sB),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,iu),h=iu.x,p=iu.y);let g,f;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,f=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,R,G;C.hasWebMercatorT&&(R=Wi.geodeticLatitudeToMercatorAngle(u.south),G=1/(Wi.geodeticLatitudeToMercatorAngle(u.north)-R));for(let I=0;I<g.length;++I){let v=g[I],P=C.decodeTextureCoordinates(V,v,iu);rF(x,_,P,P);let w=P.x,M=P.y,b=f?w:M;if(b<0||b>1||Math.abs(w-h)<W.EPSILON5&&Math.abs(M-p)<W.EPSILON5)continue;let Z=Math.abs(w)<W.EPSILON5||Math.abs(w-1)<W.EPSILON5,E=Math.abs(M)<W.EPSILON5||Math.abs(M-1)<W.EPSILON5;if(Z&&E)continue;let X=C.decodePosition(V,v,sL),F=C.decodeHeight(V,v),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,v,m8):(N=m8,N.x=0,N.y=0);let O=M;if(C.hasWebMercatorT){let Y=W.lerp(u.south,u.north,M);O=(Wi.geodeticLatitudeToMercatorAngle(Y)-R)*G}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(X,p8)),n.encode(i,o*L,X,P,F,N,O,U),c.minimumHeight=Math.min(c.minimumHeight,F),c.maximumHeight=Math.max(c.maximumHeight,F),++o}return o}function Qye(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],h=t[d];if(!b8(h,u))continue;let p;switch(i){case yn.WEST:p=u.westIndicesSouthToNorth;break;case yn.SOUTH:p=u.southIndicesEastToWest;break;case yn.EAST:p=u.eastIndicesNorthToSouth;break;case yn.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function b8(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function jye(e,t,n,i,o,r,s,a){let c,d,u,h,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if(b8(g,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){h=o?0:c.length-1,p=c[h],f.encoding.decodeTextureCoordinates(f.vertices,p,iu);let x=rF(g,e.tile,iu,iu);if(x.x===r&&x.y===s)return f8(f,p,r,s,a),!0;if(h=Xo(c,d?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,iu);let V=rF(g,e.tile,iu,iu);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),h<0){if(h=~h,h>0&&h<c.length)return hdt(t,g,e.tile,f,c[h-1],c[h],r,s,d,a),!0}else return f8(f,c[h],r,s,a),!0}return!1}var pdt=[new m,new m,new m,new m];function bdt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=pdt;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var cL=aL;function or(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Tn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(or.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(or.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(or.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(or.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new B(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(or.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){ah.setOwner(e,this,"_clippingPolygons")}}});function gdt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}or.prototype.update=function(e){this._imageryLayers._update()};function ydt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}or.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(gdt)})),ydt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)hm._freeVertexArray(t[i]);t.length=0};or.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};or.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:bc.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:bc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&cL.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let d=0,u=c.length;d<u;++d){let h=c[d],p=h.data.tileBoundingRegion;Ddt(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function oxe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}or.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)oxe(t[n],e)};or.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};or.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};or.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Jn.CULLED_BUT_NEEDED,o=n.terrainState),hm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==cr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,hm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var xdt=new le,rxe=new ce,_dt=new ce,Tdt=new he;function lB(e,t){if(t.west<t.east)return t;let n=ce.clone(t,_dt);return ce.center(e,Tdt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function sxe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}or.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=sxe(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return cr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return cr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=lB(e.rectangle,this.cartographicLimitRectangle),u=ce.simpleIntersection(d,e.rectangle,rxe);if(!l(u))return cr.NONE;if(ce.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=xdt,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=le.union(s.boundingSphere,c,c))),!l(c))return cr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let _=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=_!==Ht.INSIDE,_===Ht.OUTSIDE)return cr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let _=p.computeIntersectionWithBoundingVolume(s);e.isClipped=_!==Ht.OUTSIDE}let g,f=a.computeVisibility(c);if(f===Ht.OUTSIDE?g=cr.NONE:f===Ht.INTERSECTING?g=cr.PARTIAL:f===Ht.INSIDE&&(g=cr.FULL),g===cr.NONE)return g;let x=t.mode===oe.SCENE3D&&t.camera.frustum instanceof an;if(t.mode===oe.SCENE3D&&!x&&l(n)&&!o){let _=r.occludeePointInScaledSpace;return!l(_)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,s.minimumHeight)?g:cr.NONE}return g};or.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Sdt=[],Cdt=[];or.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Sdt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===mo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,g=!l(p)||p.state===ci.FAILED||p.state===ci.INVALID,f=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=Cdt;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let h=u.pop(),p=h._lastSelectionResultFrame===d?h._lastSelectionResult:Jn.NONE;if(p===Jn.RENDERED){let g=h.data;if(!l(g))continue;if(!o&&h.data.terrainState===mo.READY)return!1;let f=h.data.imagery;for(a=0,c=f.length;a<c;++a){let x=f[a],_=x.loadingImagery,C=!l(_)||_.state===ci.FAILED||_.state===ci.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===Jn.REFINED&&u.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var Vdt=new m;or.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,Vdt),a=m.magnitude(s);return a<W.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var exe=new A,cB=new A,Ldt=new se,Rdt=new se,Zdt=new se,Gdt=new m,txe=new m,Edt=new m,Idt=new m;or.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Xdt=[new m,new m,new m,new m];function nxe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Xdt;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}or.prototype.computeDistanceToTile=function(e,t){Wdt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Wdt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new hm);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Md({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,h=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let f=g.mesh,x=g.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Tr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Tr.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Gn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=nxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=nxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}or.prototype.isDestroyed=function(){return!1};or.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),me(this)};function Pdt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}or.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,h=0;for(a=0;a<d;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)u===-1&&(u=a),++h;else if(u!==-1)break}if(u===-1)return;let p=u+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Pdt(h,e,n),s.state=ea.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ea.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Jn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};or.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};or.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};or.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var vdt=new A,wdt=new A;function ixe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=A.multiplyByPoint(i,this.properties.rtc,txe);return A.setTranslation(i,o,exe),exe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=A.multiplyByPoint(i,this.properties.rtc,txe);return A.setTranslation(i,r,cB),A.multiply(o,cB,cB),cB},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?A.multiply(e.context.uniformState.view,i.modelMatrix,vdt):A.IDENTITY;return A.inverseTranspose(o,wdt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new B(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,center3D:void 0,rtc:new m,modifiedModelView:new A,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new D,scaleAndBias:new A,clippingPlanesEdgeColor:B.clone(B.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:B.clone(B.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?St(n,t.materialUniformMap):n}function Fdt(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Adt(e,r,o),i.wireframeVertexArray.mesh=o}}function Adt(e,t,n){let o={indices:n.indices,primitiveType:we.TRIANGLES};Fn.toWireframe(o);let r=o.indices,s=xt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var axe,cxe,dB;(function(){let e=new Et({geometry:Am.fromDimensions({dimensions:new m(2,2,2)})}),t=new Et({geometry:new tb({radius:1})}),n=new A,i,o;function r(s){return new In({geometryInstances:s,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}axe=function(s,a){return s===i||(dB(),i=s,n=A.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(a),o=r(e)),o},cxe=function(s,a){return s===i||(dB(),i=s,n=A.fromTranslation(s.center,n),n=A.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(a),o=r(t)),o},dB=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Mdt=new se(0,0,0,0),Ndt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},kdt=B.TRANSPARENT,Udt=new kt;function Ddt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new cL(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let ge=r.credits;for(let Ve=0,bn=ge.length;Ve<bn;++Ve)o.addCreditToNextFrame(ge[Ve])}let s=At.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,h=u.translucent,p=u.frontFaceAlphaByDistance,g=u.backFaceAlphaByDistance,f=u.rectangle,x=y(e.undergroundColor,kdt),_=y(e.undergroundColorAlphaByDistance,Udt),C=sxe(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,R=e.hasWaterMask&&l(a),G=R&&e.showWaterEffect,I=e.oceanNormalMap,v=G&&l(I),P=e.terrainProvider,w=l(P)&&e.terrainProvider.hasVertexNormals,M=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,Z=Tn.castShadows(e.shadows)&&!h,E=Tn.receiveShadows(e.shadows)&&!h,X=e.hueShift,F=e.saturationShift,N=e.brightnessShift,O=!(W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(F,0,W.EPSILON7)&&W.equalsEpsilon(N,0,W.EPSILON7)),U=!1;if(b){let ge=m.magnitude(n.camera.positionWC),Ve=e.nightFadeOutDistance;U=ge>Ve}R&&--s,v&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let Y=i.renderedMesh,k=Y.center,H=Y.encoding,K=i.tileBoundingRegion,te=n.verticalExaggeration,z=n.verticalExaggerationRelativeHeight,j=te!==1,ee=H.hasGeodeticSurfaceNormals,fe=Ldt,Te=0,de=0,xe=0,Ce=0,Ie=!1;if(n.mode!==oe.SCENE3D){let ge=n.mapProjection,Ve=ge.project(ce.southwest(t.rectangle),Edt),bn=ge.project(ce.northeast(t.rectangle),Idt);if(fe.x=Ve.x,fe.y=Ve.y,fe.z=bn.x,fe.w=bn.y,n.mode!==oe.MORPHING&&(k=Gdt,k.x=0,k.y=(fe.z+fe.x)*.5,k.z=(fe.w+fe.y)*.5,fe.x-=k.y,fe.y-=k.z,fe.z-=k.y,fe.w-=k.z),n.mode===oe.SCENE2D&&H.quantization===ks.BITS12){let pt=1/(Math.pow(2,12)-1)*.5,so=(fe.z-fe.x)*pt,Eo=(fe.w-fe.y)*pt;fe.x-=so,fe.y-=Eo,fe.z+=so,fe.w+=Eo}ge instanceof Wi&&(Te=t.rectangle.south,de=t.rectangle.north,xe=Wi.geodeticLatitudeToMercatorAngle(Te),Ce=1/(Wi.geodeticLatitudeToMercatorAngle(de)-xe),Ie=!0)}let Le=Ndt;Le.frameState=n,Le.surfaceTile=i,Le.hasWaterMask=R,Le.showReflectiveOcean=G,Le.showOceanWaves=v,Le.enableLighting=e.enableLighting,Le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Le.showGroundAtmosphere=b,Le.atmosphereLightIntensity=e.atmosphereLightIntensity,Le.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Le.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Le.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Le.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Le.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Le.perFragmentGroundAtmosphere=U,Le.hasVertexNormals=w,Le.useWebMercatorProjection=Ie,Le.clippedByBoundaries=i.clippedByBoundaries,Le.hasGeodeticSurfaceNormals=ee,Le.hasExaggeration=j;let Ne=i.imagery,Oe=0,qe=Ne.length,Rt=e.showSkirts&&!d&&!h,Lt=e.backFaceCulling&&!d&&!h,ke=Lt?e._renderState:e._disableCullingRenderState,zt=Lt?e._blendRenderState:e._disableCullingBlendRenderState,ut=ke,mt=e._firstPassInitialColor,Pn=n.context;if(l(e._debug.boundingSphereTile)||dB(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ge=e._drawCommands.length;for(let Ve=0;Ve<ge;++Ve)e._uniformMaps[Ve]=ixe(n,e)}do{let ge=0,Ve,bn;if(e._drawCommands.length<=e._usedDrawCommands?(Ve=new $e,Ve.owner=t,Ve.cull=!1,Ve.boundingVolume=new le,Ve.orientedBoundingBox=void 0,bn=ixe(n,e),e._drawCommands.push(Ve),e._uniformMaps.push(bn)):(Ve=e._drawCommands[e._usedDrawCommands],bn=e._uniformMaps[e._usedDrawCommands]),Ve.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let sa=K.boundingVolume,Sl=K.boundingSphere;l(sa)?axe(sa,B.RED).update(n):l(Sl)&&cxe(Sl,B.RED).update(n)}let pt=bn.properties;se.clone(mt,pt.initialColor),pt.oceanNormalMap=I,pt.lightingFadeDistance.x=e.lightingFadeOutDistance,pt.lightingFadeDistance.y=e.lightingFadeInDistance,pt.nightFadeDistance.x=e.nightFadeOutDistance,pt.nightFadeDistance.y=e.nightFadeInDistance,pt.atmosphereLightIntensity=e.atmosphereLightIntensity,pt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,pt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,pt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,pt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,pt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,pt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let so=d?g:p,Eo=d?p:g;l(so)&&(se.fromElements(so.near,so.nearValue,so.far,so.farValue,pt.frontFaceAlphaByDistance),se.fromElements(Eo.near,Eo.nearValue,Eo.far,Eo.farValue,pt.backFaceAlphaByDistance)),se.fromElements(_.near,_.nearValue,_.far,_.farValue,pt.undergroundColorAlphaByDistance),B.clone(x,pt.undergroundColor),pt.lambertDiffuseMultiplier=V,pt.vertexShadowDarkness=L;let oa=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;oa&&B.clone(e.fillHighlightColor,pt.fillHighlightColor),pt.verticalExaggerationAndRelativeHeight.x=te,pt.verticalExaggerationAndRelativeHeight.y=z,pt.center3D=Y.center,m.clone(k,pt.rtc),se.clone(fe,pt.tileRectangle),pt.southAndNorthLatitude.x=Te,pt.southAndNorthLatitude.y=de,pt.southMercatorYAndOneOverHeight.x=xe,pt.southMercatorYAndOneOverHeight.y=Ce;let Gr=Rdt,_s=lB(t.rectangle,e.cartographicLimitRectangle),Fe=Zdt,rt=lB(t.rectangle,f);m.fromElements(X,F,N,pt.hsbShift);let ze=t.rectangle,Qe=1/ze.width,bt=1/ze.height;Gr.x=(_s.west-ze.west)*Qe,Gr.y=(_s.south-ze.south)*bt,Gr.z=(_s.east-ze.west)*Qe,Gr.w=(_s.north-ze.south)*bt,se.clone(Gr,pt.localizedCartographicLimitRectangle),Fe.x=(rt.west-ze.west)*Qe,Fe.y=(rt.south-ze.south)*bt,Fe.z=(rt.east-ze.west)*Qe,Fe.w=(rt.north-ze.south)*bt,se.clone(Fe,pt.localizedTranslucencyRectangle);let Ot=M&&W.fog(t._distance,n.fog.density)>W.EPSILON3;O=O&&(Ot||b);let Cn=!1,Io=!1,So=!1,Ka=!1,Ja=!1,Ci=!1,bi=!1,ra=!1,zr=!1,Tl=!1;for(;ge<s&&Oe<qe;){let sa=Ne[Oe],Sl=sa.readyImagery;if(++Oe,!l(Sl)||Sl.imageryLayer.alpha===0)continue;let Wc=sa.useWebMercatorT?Sl.textureWebMercator:Sl.texture,ls=Sl.imageryLayer;l(sa.textureTranslationAndScale)||(sa.textureTranslationAndScale=ls._calculateTextureTranslationAndScale(t,sa)),pt.dayTextures[ge]=Wc,pt.dayTextureTranslationAndScale[ge]=sa.textureTranslationAndScale,pt.dayTextureTexCoordsRectangle[ge]=sa.textureCoordinateRectangle,pt.dayTextureUseWebMercatorT[ge]=sa.useWebMercatorT,pt.dayTextureAlpha[ge]=ls.alpha,Ci=Ci||pt.dayTextureAlpha[ge]!==1,pt.dayTextureNightAlpha[ge]=ls.nightAlpha,bi=bi||pt.dayTextureNightAlpha[ge]!==1,pt.dayTextureDayAlpha[ge]=ls.dayAlpha,bi=bi||pt.dayTextureDayAlpha[ge]!==1,pt.dayTextureBrightness[ge]=ls.brightness,Cn=Cn||pt.dayTextureBrightness[ge]!==Ya.DEFAULT_BRIGHTNESS,pt.dayTextureContrast[ge]=ls.contrast,Io=Io||pt.dayTextureContrast[ge]!==Ya.DEFAULT_CONTRAST,pt.dayTextureHue[ge]=ls.hue,So=So||pt.dayTextureHue[ge]!==Ya.DEFAULT_HUE,pt.dayTextureSaturation[ge]=ls.saturation,Ka=Ka||pt.dayTextureSaturation[ge]!==Ya.DEFAULT_SATURATION,pt.dayTextureOneOverGamma[ge]=1/ls.gamma,Ja=Ja||pt.dayTextureOneOverGamma[ge]!==1/Ya.DEFAULT_GAMMA,pt.dayTextureSplit[ge]=ls.splitDirection,ra=ra||pt.dayTextureSplit[ge]!==0;let hu=pt.dayTextureCutoutRectangles[ge];if(l(hu)||(hu=pt.dayTextureCutoutRectangles[ge]=new se),se.clone(se.ZERO,hu),l(ls.cutoutRectangle)){let Fo=lB(ze,ls.cutoutRectangle),ln=ce.simpleIntersection(Fo,ze,rxe);zr=l(ln)||zr,hu.x=(Fo.west-ze.west)*Qe,hu.y=(Fo.south-ze.south)*bt,hu.z=(Fo.east-ze.west)*Qe,hu.w=(Fo.north-ze.south)*bt}let fu=pt.colorsToAlpha[ge];l(fu)||(fu=pt.colorsToAlpha[ge]=new se);let pu=l(ls.colorToAlpha)&&ls.colorToAlphaThreshold>0;if(Tl=Tl||pu,pu){let Fo=ls.colorToAlpha;fu.x=Fo.red,fu.y=Fo.green,fu.z=Fo.blue,fu.w=ls.colorToAlphaThreshold}else fu.w=-1;if(l(Sl.credits)){let Fo=Sl.credits;for(let ln=0,Re=Fo.length;ln<Re;++ln)o.addCreditToNextFrame(Fo[ln])}++ge}pt.dayTextures.length=ge,pt.waterMask=a,se.clone(c,pt.waterMaskTranslationAndScale),pt.minMaxHeight.x=H.minimumHeight,pt.minMaxHeight.y=H.maximumHeight,A.clone(H.matrix,pt.scaleAndBias);let yo=e._clippingPlanes,Er=l(yo)&&yo.enabled&&t.isClipped;Er&&(pt.clippingPlanesEdgeColor=B.clone(yo.edgeColor,pt.clippingPlanesEdgeColor),pt.clippingPlanesEdgeWidth=yo.edgeWidth);let yp=e._clippingPolygons,Kr=l(yp)&&yp.enabled&&t.isClipped;Le.numberOfDayTextures=ge,Le.applyBrightness=Cn,Le.applyContrast=Io,Le.applyHue=So,Le.applySaturation=Ka,Le.applyGamma=Ja,Le.applyAlpha=Ci,Le.applyDayNightAlpha=bi,Le.applySplit=ra,Le.enableFog=Ot,Le.enableClippingPlanes=Er,Le.clippingPlanes=yo,Le.enableClippingPolygons=Kr,Le.clippingPolygons=yp,Le.hasImageryLayerCutout=zr,Le.colorCorrect=O,Le.highlightFillTile=oa,Le.colorToAlpha=Tl,Le.showUndergroundColor=C,Le.translucent=h;let mu=i.renderedMesh.indices.length;Rt||(mu=i.renderedMesh.indexCountWithoutSkirts),Ve.shaderProgram=e._surfaceShaderSet.getShaderProgram(Le),Ve.castShadows=Z,Ve.receiveShadows=E,Ve.renderState=ut,Ve.primitiveType=we.TRIANGLES,Ve.vertexArray=i.vertexArray||i.fill.vertexArray,Ve.count=mu,Ve.uniformMap=bn,Ve.pass=Ee.GLOBE,e._debug.wireframe&&(Fdt(Pn,e,t),l(i.wireframeVertexArray)&&(Ve.vertexArray=i.wireframeVertexArray,Ve.primitiveType=we.LINES,Ve.count=mu*2));let Qa=Ve.boundingVolume,$y=Ve.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,K.minimumHeight,K.maximumHeight,Qa),m.fromElements(Qa.center.z,Qa.center.x,Qa.center.y,Qa.center),n.mode===oe.MORPHING&&(Qa=le.union(K.boundingSphere,Qa,Qa))):(Ve.boundingVolume=le.clone(K.boundingSphere,Qa),Ve.orientedBoundingBox=Gn.clone(K.boundingVolume,$y)),Ve.dirty=!0,h&&u.updateDerivedCommands(Ve,n),oxe(Ve,n),ut=zt,mt=Mdt}while(Oe<qe)}var sF=or;var Dwi=T(S(),1);function lxe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(lxe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var aF=lxe;var jwi=T(S(),1);function ws(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(ws.prototype,{length:{get:function(){return this._layers.length}}});ws.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};ws.prototype.addImageryProvider=function(e,t){let n=new Ya(e);return this.add(n,t),n};ws.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};ws.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};ws.prototype.contains=function(e){return this.indexOf(e)!==-1};ws.prototype.indexOf=function(e){return this._layers.indexOf(e)};ws.prototype.get=function(e){return this._layers[e]};function uB(e,t){return e.indexOf(t)}function dxe(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}ws.prototype.raise=function(e){let t=uB(this._layers,e);dxe(this,t,t+1)};ws.prototype.lower=function(e){let t=uB(this._layers,e);dxe(this,t,t-1)};ws.prototype.raiseToTop=function(e){let t=uB(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};ws.prototype.lowerToBottom=function(e){let t=uB(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Bdt=new ce;function uxe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!ce.contains(d.rectangle,t))continue;let h=Bdt,p=1/1024;h.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(d)}}ws.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(uxe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};ws.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(uxe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let h=0;h<d.length;++h){let p=d[h];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};ws.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ws.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ws.prototype.isDestroyed=function(){return!1};ws.prototype.destroy=function(){return this.removeAll(!0),me(this)};ws.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var cF=ws;var XFi=T(S(),1);var tFi=T(S(),1);function mxe(e){this._ellipsoid=new Pp(e.ellipsoid,m.ZERO)}Object.defineProperties(mxe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var lF=mxe;var aFi=T(S(),1);function bl(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Jn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}bl.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new bl({tilingScheme:e,x:s,y:r,level:0});return i};bl.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(bl.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new bl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new bl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new bl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new bl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ea.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});bl.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};bl.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};bl.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};bl.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};bl.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};bl.prototype.freeResources=function(){this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),mB(this._southwestChild),this._southwestChild=void 0,mB(this._southeastChild),this._southeastChild=void 0,mB(this._northwestChild),this._northwestChild=void 0,mB(this._northeastChild),this._northeastChild=void 0};function mB(e){l(e)&&e.freeResources()}var dF=bl;var dFi=T(S(),1);function hB(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}hB.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};hB.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),hxe(this,t)),t=i}};function hxe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}hB.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&hxe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var uF=hB;function pm(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new uF,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new lF({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(pm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});pm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Odt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,pxe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}pm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ea.START&&e(t),t=t.replacementNext};pm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};pm.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};pm.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function pxe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}pm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Odt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),pxe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};pm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Kdt(this,e),out(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Ydt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}pm.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(eut(this,e),iut(this,e),Ydt(this,e))};pm.prototype.isDestroyed=function(){return!1};pm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var hF,fxe=new he;function Hdt(e,t){let n=ce.center(e.rectangle,fxe),i=n.longitude-hF.longitude,o=n.latitude-hF.latitude;n=ce.center(t.rectangle,fxe);let r=n.longitude-hF.longitude,s=n.latitude-hF.latitude;return i*i+o*o-(r*r+s*s)}var zdt=new m,mF=[];function Kdt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let _=r.tilingScheme;e._levelZeroTiles=dF.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(mF.length<C)for(mF=new Array(C),o=0;o<C;++o)mF[o]===void 0&&(mF[o]=new fF)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;hF=t.camera.positionCartographic,a.sort(Hdt);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,h=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,d,u);d.length=0,u.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let f=A.getTranslation(g.transform,zdt);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ha(e,s,r,t,c,!1,mF[o]):(x0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function x0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function fF(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function bxe(){this.southwest=new fF,this.southeast=new fF,this.northwest=new fF,this.northeast=new fF}bxe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var x8=new Array(31);for(let e=0;e<x8.length;++e)x8[e]=new bxe;function Jdt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=qdt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Jn.NONE,g=e.tileProvider;if(s||i){let f=Jn.originalResult(p)===Jn.RENDERED,x=Jn.originalResult(p)===Jn.CULLED||p===Jn.NONE,_=n.state===ea.DONE,C=f||x||_;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&x0(e,e._tileLoadQueueMedium,n,t),fB(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&x0(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){fB(e,n),x0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(Qdt(e,a,c,d,u,t,i,o),x!==e._tilesToRender.length){let R=o.allAreRenderable,G=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,v=!1;if(!R&&!G){let P=e._tilesToRender;for(let M=x;M<P.length;++M){let b=P[M];for(;b!==void 0&&b._lastSelectionResult!==Jn.KICKED&&b!==n;)b._lastSelectionResult=Jn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,fB(e,n),n._lastSelectionResult=Jn.RENDERED;let w=p===Jn.RENDERED;!w&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,x0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=w,w||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&x0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,fB(e,n),x0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Qdt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,h=x8[t.level],p=h.southwest,g=h.southeast,f=h.northwest,x=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ha(e,t,d,r,u,s,p),Ha(e,n,d,r,u,s,g),Ha(e,i,d,r,u,s,f),Ha(e,o,d,r,u,s,x)):(Ha(e,i,d,r,u,s,f),Ha(e,t,d,r,u,s,p),Ha(e,o,d,r,u,s,x),Ha(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(Ha(e,n,d,r,u,s,g),Ha(e,t,d,r,u,s,p),Ha(e,o,d,r,u,s,x),Ha(e,i,d,r,u,s,f)):(Ha(e,o,d,r,u,s,x),Ha(e,i,d,r,u,s,f),Ha(e,n,d,r,u,s,g),Ha(e,t,d,r,u,s,p)),h.combine(a)}function jdt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ha(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==cr.NONE)return Jdt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,jdt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&x0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Jn.NONE;c!==Jn.CULLED_BUT_NEEDED&&c!==Jn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Jn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(x0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Jn.CULLED):t._lastSelectionResult=Jn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function qdt(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof an||t.camera.frustum instanceof Pr)return $dt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function $dt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=d/u;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=W.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function fB(e,t){e._tilesToRender.push(t)}function eut(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=xi()+e._loadQueueTimeSlice,s=e._tileProvider,a=g8(e,t,s,r,n,!1);a=g8(e,t,s,r,i,a),g8(e,t,s,r,o,a)}function tut(e,t){return e._loadPriority-t._loadPriority}function g8(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(tut);for(let s=0,a=o.length;s<a&&(xi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var lL=new pn,y8=new he,Ay=new m,nut=[];function iut(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=nut;n.length=0;let i=e._tileToUpdateHeights,o=xi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let x=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Jn.NONE;(x===Jn.RENDERED||x===Jn.CULLED_BUT_NEEDED)&&n.push(h),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,f=!1;for(u=e._lastTileIndex;u<g;++u){let x=p[u],_=h.data.terrainData,C=l(_)&&_.wasCreatedByUpsampling();if(h.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=m.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,d)),a===oe.SCENE3D){let L=d.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,lL.direction),R=d.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,lL.origin);if(!l(R)){let G=0;l(h.data.tileBoundingRegion)&&(G=h.data.tileBoundingRegion.minimumHeight);let I=Math.min(G,-11500),v=m.multiplyByScalar(L,Math.abs(I)+1,Ay);m.subtract(x.positionOnEllipsoidSurface,v,lL.origin)}}else he.clone(x.positionCartographic,y8),y8.height=-11500,c.project(y8,Ay),m.fromElements(Ay.z,Ay.x,Ay.y,Ay),m.clone(Ay,lL.origin),m.clone(m.UNIT_X,lL.direction);let V=h.data.pick(lL,a,c,!1,Ay);l(V)&&(l(x.callback)&&x.callback(V),x.level=h.level)}if(xi()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function out(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var pF=pm;function Bh(e){e=y(e,ne.default);let t=new Tf({ellipsoid:e}),n=new cF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Ow,this._material=void 0,this._surface=new pF({tileProvider:new sF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._undergroundColor=B.clone(B.BLACK),this._undergroundColorAlphaByDistance=new kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new aF,T8(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ze({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Tn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Bh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&T8(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,T8(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=B.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function T8(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[ch,KV];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Dw),e._surfaceShaderSet.baseVertexShaderSource=new De({sources:[ch,KV,Bw],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new De({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function rut(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var sut=[],aut={start:0,stop:0};Bh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=sut;s.length=0;let a=this._surface._tilesToRender,c=a.length,d,u;for(u=0;u<c;++u){d=a[u];let p=d.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let f=qn.raySphere(e,g,aut);l(f)&&s.push(p)}s.sort(rut(e.origin));let h;for(c=s.length,u=0;u<c&&(h=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(h));++u);return h};var cut=new he;Bh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,cut);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var lut=new m,gxe=new m,dut=new he,uut=new pn;function _8(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}Bh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=_8(n._southwestChild,e)||_8(n._southeastChild,e)||_8(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,lut),d=uut,u=a.geodeticSurfaceNormal(c,d.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(h)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(y(g,0),-11500),x=m.multiplyByScalar(u,Math.abs(f)+1,gxe);m.subtract(c,x,d.origin)}let p=n.data.pick(d,void 0,s,!1,gxe);if(l(p))return a.cartesianToCartographic(p,dut).height};Bh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Bh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new vt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Bh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Bh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Bh.prototype.isDestroyed=function(){return!1};Bh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),me(this)};var bF=Bh;var qAi=T(S(),1);var AAi=T(S(),1);var uAi=T(S(),1),dL=`uniform vec3 u_radii;
uniform vec3 u_oneOverEllipsoidRadiiSquared;

in vec3 v_positionEC;

vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
{
    vec3 positionEC = czm_pointAlongRay(ray, intersection);
    vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
    vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
    vec3 sphericalNormal = normalize(positionMC / u_radii);
    vec3 normalMC = geodeticNormal * side;              // normalized surface normal (always facing the viewer) in model coordinates
    vec3 normalEC = normalize(czm_normal * normalMC);   // normalized surface normal in eye coordinates

    vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal);
    vec3 positionToEyeEC = -positionEC;

    czm_materialInput materialInput;
    materialInput.s = st.s;
    materialInput.st = st;
    materialInput.str = (positionMC + u_radii) / u_radii;
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getMaterial(materialInput);

#ifdef ONLY_SUN_LIGHTING
    return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
#else
    return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}

void main()
{
    // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
    // in the vertex shader. Only when it is larger than some constant, march along the ray.
    // Otherwise perform one intersection test which will be the common case.

    // Test if the ray intersects a sphere with the ellipsoid's maximum radius.
    // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
    // may cause false negatives. This will discard fragments before marching the ray forward.
    float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
    vec3 direction = normalize(v_positionEC);
    vec3 ellipsoidCenter = czm_modelView[3].xyz;

    float t1 = -1.0;
    float t2 = -1.0;

    float b = -2.0 * dot(direction, ellipsoidCenter);
    float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;

    float discriminant = b * b - 4.0 * c;
    if (discriminant >= 0.0) {
        t1 = (-b - sqrt(discriminant)) * 0.5;
        t2 = (-b + sqrt(discriminant)) * 0.5;
    }

    if (t1 < 0.0 && t2 < 0.0) {
        discard;
    }

    float t = min(t1, t2);
    if (t < 0.0) {
        t = 0.0;
    }

    // March ray forward to intersection with larger sphere and find
    czm_ray ray = czm_ray(t * direction, direction);

    vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);

    if (czm_isEmpty(intersection))
    {
        discard;
    }

    // If the viewer is outside, compute outsideFaceColor, with normals facing outward.
    vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);

    // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
    vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);

    out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
    out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);

#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
    vec3 positionEC = czm_pointAlongRay(ray, t);
    vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
#ifdef LOG_DEPTH
    czm_writeLogDepth(1.0 + positionCC.w);
#else
    float z = positionCC.z / positionCC.w;

    float n = czm_depthRange.near;
    float f = czm_depthRange.far;

    gl_FragDepth = (z * (f - n) + f + n) * 0.5;
#endif
#endif
}
`;var hAi=T(S(),1),uL=`in vec3 position;

uniform vec3 u_radii;

out vec3 v_positionEC;

void main()
{
    // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
    // Scale to consider the radii.  We could also do this once on the CPU when using the BoxGeometry,
    // but doing it here allows us to change the radii without rewriting the vertex data, and
    // allows all ellipsoids to reuse the same vertex data.
    vec4 p = vec4(u_radii * position, 1.0);

    v_positionEC = (czm_modelView * p).xyz;     // position in eye coordinates
    gl_Position = czm_modelViewProjection * p;  // position in clip coordinates

    // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
    // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
    // ellipsoid (does not write depth) that was rendered in the farther frustum.
    //
    // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
    // artifacts since some fragments can be alpha blended twice.  This is solved by only rendering
    // the ellipsoid in the closest frustum to the viewer.
    gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);

    czm_vertexLogDepth();
}
`;var S8={position:0};function pB(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new le,this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=new A,this._computedModelMatrix=new A,this.show=y(e.show,!0),this.material=y(e.material,zi.fromType(zi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new $e({owner:y(e._owner,this)}),this._pickCommand=new $e({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function mut(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:S8,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}pB.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),l(this._va)||(this._va=mut(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!A.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(A.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),A.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),le.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,h,p;(s||a||i||d)&&(h=new De({sources:[uL]}),p=new De({sources:[this.material.shaderSource,dL]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:S8}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=St(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(u)),f.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(h=new De({sources:[uL]}),p=new De({sources:[this.material.shaderSource,dL],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=$t.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:S8}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=St(St(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(x)}};pB.prototype.isDestroyed=function(){return!1};pB.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var gF=pB;function yF(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ne.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new gF({radii:this.ellipsoid.radii,material:zi.fromType(zi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new qE}Object.defineProperties(yF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var bB=new $,hut=new $,fut=new m,gB=[];yF.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Pt.computeIcrfToFixedMatrix(n,bB))||Pt.computeTemeToPseudoFixedMatrix(n,bB);let i=this._axes.evaluate(n,hut);$.transpose(i,i),$.multiply(bB,i,i);let o=Y0.computeMoonPositionInEarthInertialFrame(n,fut);$.multiplyByVector(bB,o,o),A.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=gB,gB.length=0,t.update(e),e.commandList=r,gB.length===1?gB[0]:void 0};yF.prototype.isDestroyed=function(){return!1};yF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var xF=yF;var Hji=T(S(),1);var m9i=T(S(),1);var e9i=T(S(),1),_F=`in vec2 v_textureCoordinates;
const float M_PI = 3.141592653589793;

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float phi = 2.0 * M_PI * xi.x;
    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
    vec3 tangentX = normalize(cross(upVector, N));
    vec3 tangentY = cross(N, tangentX);
    return tangentX * H.x + tangentY * H.y + N * H.z;
}

/**
 * Estimate the geometric self-shadowing of the microfacets in a surface,
 * using the Smith Joint GGX visibility function.
 * Note: Vis = G / (4 * NdotL * NdotV)
 * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
 * see Real-Time Rendering. Page 331 to 336.
 * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
 * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
 */
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
    float alphaRoughnessSq = alphaRoughness * alphaRoughness;

    float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
    float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);

    float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
    if (GGX > 0.0)
    {
        return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
    }
    return 0.0;
}

vec2 integrateBrdf(float roughness, float NdotV)
{
    vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
    float A = 0.0;
    float B = 0.0;
    const int NumSamples = 1024;
    float alphaRoughness = roughness * roughness;
    for (int i = 0; i < NumSamples; i++)
    {
        vec2 xi = hammersley2D(i, NumSamples);
        vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
        vec3 L = 2.0 * dot(V, H) * H - V;
        float NdotL = clamp(L.z, 0.0, 1.0);
        float NdotH = clamp(H.z, 0.0, 1.0);
        float VdotH = clamp(dot(V, H), 0.0, 1.0);
        if (NdotL > 0.0)
        {
            float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
            float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
            float Fc = pow(1.0 - VdotH, 5.0);
            A += (1.0 - Fc) * G_Vis;
            B += Fc * G_Vis;
        }
    }
    return vec2(A, B) / float(NumSamples);
}

void main()
{
    out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
}
`;function TF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(TF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function put(e,t,n){let i=t.createViewportQuadCommand(_F,{framebuffer:n,renderState:Ue.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}TF.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new vt({context:t,width:256,height:256,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST});this._colorTexture=n;let i=new Wr({context:t,colorTextures:[n],destroyAttachments:!1});put(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};TF.prototype.isDestroyed=function(){return!1};TF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var SF=TF;var nMi=T(S(),1);var V9i=T(S(),1);var Txe={};function but(e,t,n){let i,o,r;if(e instanceof Vi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof Jc)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var gut=new m,yxe=new m;function Sxe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let h=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-h)}}return function(o){return W.lerp(e,t,o)}}function V8(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,h=e.frustum,p=m.subtract(a,c,gut),g=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),yxe)),f=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),yxe));r=Math.min(but(h,g,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function CF(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var Cxe=new m;function yut(e,t,n,i,o,r,s,a){let c=e.camera,d=m.clone(c.position,Cxe),u=c.pitch,h=CF(c.heading,i),p=CF(c.roll,r),g=V8(c,n,d.z,n.z,s),f=Sxe(u,o,g,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:W.lerp(h,i,C),pitch:f(C),roll:W.lerp(p,r,C)}}),D.lerp(d,n,C,c.position),c.position.z=g(C)}return x}function xut(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function _ut(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var Tut=new he,Sut=new he;function Cut(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(u.positionCartographic,Tut),f=u.pitch,x=CF(u.heading,i),_=CF(u.roll,r),C=p.cartesianToCartographic(n,Sut);g.longitude=W.zeroToTwoPi(g.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let I=W.zeroToTwoPi(a),v=Math.min(g.longitude,C.longitude),P=Math.max(g.longitude,C.longitude),w=I>=v&&I<=P;if(l(c)){let M=Math.abs(g.longitude-C.longitude),b=W.TWO_PI-M;(w?M:b)<(w?b:M)*c&&!w&&(V=!0)}else w||(V=!0)}V?xut(g,C):_ut(g,C);let L=V8(u,n,g.height,C.height,s),R=Sxe(f,o,L,d);function G(){let I=g.longitude,v=C.longitude,P=g.latitude,w=C.latitude;return function(b){let Z=b.time/t,E=m.fromRadians(W.lerp(I,v,Z),W.lerp(P,w,Z),L(Z),p);u.setView({destination:E,orientation:{heading:W.lerp(x,i,Z),pitch:R(Z),roll:W.lerp(_,r,Z)}})}}return G()}function Vut(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,Cxe),d=CF(a.heading,i),u=a.frustum.right-a.frustum.left,h=V8(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),D.lerp(c,n,f,a.position);let x=h(f),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var xxe=new he,Lut=new m;function C8(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function _xe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Txe.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===oe.MORPHING)return C8();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,xxe),n=r.project(xxe,Lut));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(m.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=y(t.heading,0),_=y(t.pitch,-W.PI_OVER_TWO),C=y(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=_xe(V,t.complete),R=_xe(V,t.cancel),G=p.frustum,I=e.mode===oe.SCENE2D;if(I=I&&D.equalsEpsilon(p.position,n,W.EPSILON6),I=I&&W.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,W.EPSILON6),I=I||e.mode!==oe.SCENE2D&&m.equalsEpsilon(n,p.position,W.EPSILON10),I=I&&W.equalsEpsilon(W.negativePiToPi(x),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(C),W.negativePiToPi(p.roll),W.EPSILON10),I)return C8(L,R);let v=new Array(4);if(v[oe.SCENE2D]=Vut,v[oe.SCENE3D]=Cut,v[oe.COLUMBUS_VIEW]=yut,f<=0)return C8(function(){v[i](e,1,n,x,_,C,a,c,d,u)({time:1}),typeof L=="function"&&L()},R);let P=v[i](e,f,n,x,_,C,a,c,d,u);if(!l(h)){let w=p.positionCartographic.height,M=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;w>M&&w>11500?h=Fr.CUBIC_OUT:h=Fr.QUINTIC_IN_OUT}return{duration:f,easingFunction:h,startObject:{time:0},stopObject:{time:f},update:P,complete:L,cancel:R}};var VF=Txe;var R9i=T(S(),1),Rut={ROTATE:0,INFINITE_SCROLL:1},nd=Object.freeze(Rut);function tn(e){this._scene=e,this._transform=A.clone(A.IDENTITY),this._invTransform=A.clone(A.IDENTITY),this._actualTransform=A.clone(A.IDENTITY),this._actualInvTransform=A.clone(A.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Vi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new A,this._invViewMatrix=new A,Xxe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,Bxe(this,tn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*tn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}tn.TRANSFORM_2D=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);tn.TRANSFORM_2D_INVERSE=A.inverseTransformation(tn.TRANSFORM_2D,new A);tn.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);tn.DEFAULT_VIEW_FACTOR=.5;tn.DEFAULT_OFFSET=new Pu(0,-W.PI_OVER_FOUR,0);function Xxe(e){A.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),A.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),A.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Zut(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xi()):e.timeSinceMoved=Math.max(xi()-e._lastMovedTimestamp,0)/1e3}}tn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};tn.prototype._updateCameraChanged=function(){let e=this;if(Zut(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,x=e._changedFrustum,_=p.x+f.left,C=p.x+f.right,V=g.x+x.left,L=g.x+x.right,R=p.y+f.bottom,G=p.y+f.top,I=g.y+x.bottom,v=g.y+x.top,P=Math.max(_,V),w=Math.min(C,L),M=Math.max(R,I),b=Math.min(G,v),Z;if(P>=w||M>=G)Z=1;else{let E=x;_<V&&C>L&&R<I&&G>v&&(E=f),Z=1-(w-P)*(b-M)/((E.right-E.left)*(E.top-E.bottom))}Z>t&&(e._changed.raiseEvent(Z),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let h=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||h>t)&&(e._changed.raiseEvent(Math.max(d,h)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Gut(e){Pt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Eut=new he,Iut=new m,yB=new m,Xut=new se,Wut=new se,Put=new se,vut=new se,wut=new se;function Fut(e){let t=e._projection,n=t.ellipsoid,i=A.getColumn(e._transform,3,Xut),o=n.cartesianToCartographic(i,Eut),r=t.project(o,Iut),s=Wut;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,wut),c=se.add(A.getColumn(e._transform,0,yB),i,yB);n.cartesianToCartographic(c,o),t.project(o,r);let d=Put;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,m.subtract(d,s,d),d.x=0;let u=vut;if(m.magnitudeSquared(d)>W.EPSILON10)m.cross(a,d,u);else{let h=se.add(A.getColumn(e._transform,1,yB),i,yB);n.cartesianToCartographic(h,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0,m.magnitudeSquared(u)<W.EPSILON10&&(se.clone(se.UNIT_Y,d),se.clone(se.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),A.setColumn(e._actualTransform,0,d,e._actualTransform),A.setColumn(e._actualTransform,1,u,e._actualTransform),A.setColumn(e._actualTransform,2,a,e._actualTransform),A.setColumn(e._actualTransform,3,s,e._actualTransform)}var L8=new m;function Ec(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,d=!m.equals(c,e.up);d&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let u=e._right,h=!m.equals(u,e.right);h&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(A.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?A.equals(A.IDENTITY,e._transform)?A.clone(tn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?Gut(e):Fut(e):A.clone(e._transform,e._actualTransform),A.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=A.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=L8;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===oe.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||h){let f=m.dot(s,m.cross(c,u,L8));if(Math.abs(1-f)>W.EPSILON2){let x=1/m.magnitudeSquared(c),_=m.dot(c,s)*x,C=m.multiplyByScalar(s,_,L8);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),u=m.cross(s,c,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=A.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=A.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=A.multiplyByPointAsVector(g,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||h||p)&&Xxe(e)}function Wxe(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function Pxe(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function vxe(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var TB=new A,SB=new A;Object.defineProperties(tn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Ec(this),this._invTransform}},viewMatrix:{get:function(){return Ec(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Ec(this),this._invViewMatrix}},positionCartographic:{get:function(){return Ec(this),this._positionCartographic}},positionWC:{get:function(){return Ec(this),this._positionWC}},directionWC:{get:function(){return Ec(this),this._directionWC}},upWC:{get:function(){return Ec(this),this._upWC}},rightWC:{get:function(){return Ec(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=A.clone(this._transform,TB),n=Pt.eastNorthUpToFixedFrame(this.positionWC,e,SB);this._setTransform(n);let i=Wxe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=A.clone(this._transform,TB),n=Pt.eastNorthUpToFixedFrame(this.positionWC,e,SB);this._setTransform(n);let i=Pxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=A.clone(this._transform,TB),n=Pt.eastNorthUpToFixedFrame(this.positionWC,e,SB);this._setTransform(n);let i=vxe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});tn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===oe.SCENE2D&&Mxe(this,this.position)};var Aut=new m,Mut=new m,Nut=new m;tn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,Aut),n=m.clone(this.upWC,Mut),i=m.clone(this.directionWC,Nut);A.clone(e,this._transform),this._transformChanged=!0,Ec(this);let o=this._actualInvTransform;A.multiplyByPoint(o,t,this.position),A.multiplyByPointAsVector(o,i,this.direction),A.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),Ec(this)};var kut=new D,Uut=new pn,Dut=new m,But=new m;function wxe(e){if(!A.equals(A.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=kut;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,Uut);o=n.pickWorldCoordinates(a,t,!0,Dut)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,But));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}tn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof an&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=wxe(this)))};var CB=new m,I8=new A,Out=new A,X8=new ve,W8=new $,Fxe=new he;function Yut(e,t,n){let i=A.clone(e.transform,I8),o=Pt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Out);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=ve.fromHeadingPitchRoll(n,X8),s=$.fromQuaternion(r,W8);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Hut(e,t,n,i){let o=A.clone(e.transform,I8);if(e._setTransform(A.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Fxe);t=a.project(c,CB)}m.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=ve.fromHeadingPitchRoll(n,X8),s=$.fromQuaternion(r,W8);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function zut(e,t,n,i){let o=A.clone(e.transform,I8);if(e._setTransform(A.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,Fxe);t=c.project(d,CB)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===nd.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=ve.fromHeadingPitchRoll(n,X8),s=$.fromQuaternion(r,W8);$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Kut=new m,Jut=new m,Qut=new m;function Axe(e,t,n,i){let o=m.clone(n.direction,Kut),r=m.clone(n.up,Jut);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=Pt.eastNorthUpToFixedFrame(t,a,TB),d=A.inverseTransformation(c,SB);A.multiplyByPointAsVector(d,o,o),A.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,Qut);return i.heading=Wxe(o,r),i.pitch=Pxe(o),i.roll=vxe(o,r,s),i}var E8={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},mL=new Ra;tn.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,m.clone(this.positionWC,CB));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,CB),i=!1),l(t.direction)&&(t=Axe(this,o,t,E8.orientation)),mL.heading=y(t.heading,0),mL.pitch=y(t.pitch,-W.PI_OVER_TWO),mL.roll=y(t.roll,0),n===oe.SCENE3D?Yut(this,o,mL):n===oe.SCENE2D?zut(this,o,mL,i):Hut(this,o,mL,i)};var jut=new m;tn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:tn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:A.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(tn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*tn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:A.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,jut).z),roll:0},endTransform:A.IDENTITY,convert:!1})}};tn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Ec(this),A.multiplyByVector(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),Ec(this),A.multiplyByPoint(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),Ec(this),A.multiplyByPointAsVector(this._actualInvTransform,e,t)};tn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Ec(this),A.multiplyByVector(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),Ec(this),A.multiplyByPoint(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),Ec(this),A.multiplyByPointAsVector(this._actualTransform,e,t)};function Mxe(e,t){let n=e._scene.mapMode2D===nd.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Vxe=new m;tn.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,Vxe),m.add(n,Vxe,n),this._mode===oe.SCENE2D&&Mxe(this,n),this._adjustOrthographicFrustum(!0)};tn.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?VB(this,e):this.move(this.direction,e)};tn.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?VB(this,-e):this.move(this.direction,-e)};tn.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};tn.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};tn.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};tn.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};tn.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,-e)};tn.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,e)};tn.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,-e)};tn.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,e)};var qut=new ve,$ut=new $;tn.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=ve.fromAxisAngle(e,-n,qut),o=$.fromQuaternion(i,$ut),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};tn.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};tn.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var emt=new ve,tmt=new $;tn.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=ve.fromAxisAngle(e,-n,emt),o=$.fromQuaternion(i,tmt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};tn.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Nxe(this,e)};tn.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Nxe(this,-e)};var nmt=new m,imt=new m,omt=new m,Lxe=new m;function Nxe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,W.EPSILON2)){let i=m.normalize(n,nmt),o=m.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,Lxe),W.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,imt),a=m.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=m.dot(i,m.negate(s,Lxe)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=m.cross(s,i,omt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}tn.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),kxe(this,-e)};tn.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),kxe(this,e)};function kxe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function VB(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===nd.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===nd.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Uxe(e,t){e.move(e.direction,t)}tn.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?VB(this,e):Uxe(this,e)};tn.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?VB(this,-e):Uxe(this,-e)};tn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return m.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var rmt=new A;tn.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ne.default),o=Pt.eastNorthUpToFixedFrame(e,i,rmt);this.lookAtTransform(o,t)};var smt=new m,amt=new ve,cmt=new ve,lmt=new $;function Dxe(e,t,n){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let i=ve.fromAxisAngle(m.UNIT_Y,-t,amt),o=ve.fromAxisAngle(m.UNIT_Z,-e,cmt),r=ve.multiply(o,i,o),s=$.fromQuaternion(r,lmt),a=m.clone(m.UNIT_X,smt);return $.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}tn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Dxe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){D.clone(D.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<W.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(A.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<W.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var LF=new he,dmt=new he,umt=new m,mmt=new m,hmt=new m,fmt=new m,pmt=new m,bmt=new m,gmt=new m,R8=new m,ymt={direction:new m,right:new m,up:new m},Rxe;function Gc(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function Bxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:ymt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,h;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)h=0;else{let w=LF;w.longitude=u,w.latitude=s,w.height=0;let M=dmt;M.longitude=u,M.latitude=a,M.height=0;let b=Rxe;(!l(b)||b.ellipsoid!==o)&&(Rxe=b=new Up(void 0,void 0,o)),b.setEndPoints(w,M),h=b.interpolateUsingFraction(.5,LF).latitude}let p=LF;p.longitude=u,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,gmt),f=LF;f.longitude=d,f.latitude=s;let x=o.cartographicToCartesian(f,umt);f.longitude=c;let _=o.cartographicToCartesian(f,hmt);f.longitude=u;let C=o.cartographicToCartesian(f,pmt);f.latitude=a;let V=o.cartographicToCartesian(f,bmt);f.longitude=d;let L=o.cartographicToCartesian(f,fmt);f.longitude=c;let R=o.cartographicToCartesian(f,mmt);m.subtract(_,g,_),m.subtract(L,g,L),m.subtract(x,g,x),m.subtract(R,g,R),m.subtract(C,g,C),m.subtract(V,g,V);let G=o.geodeticSurfaceNormal(g,r.direction);m.negate(G,G);let I=m.cross(G,m.UNIT_Z,r.right);m.normalize(I,I);let v=m.cross(I,G,r.up),P;if(e.frustum instanceof an){let w=Math.max(m.distance(x,_),m.distance(L,R)),M=Math.max(m.distance(x,L),m.distance(_,R)),b,Z,E=e.frustum._offCenterFrustum,X=E.right/E.top,F=M*X;w>F?(b=w,Z=b/X):(Z=M,b=F),P=Math.max(b,Z)}else{let w=Math.tan(e.frustum.fovy*.5),M=e.frustum.aspectRatio*w;if(P=Math.max(Gc(G,v,_,w),Gc(G,v,L,w),Gc(G,v,x,w),Gc(G,v,R,w),Gc(G,v,C,w),Gc(G,v,V,w),Gc(G,I,_,M),Gc(G,I,L,M),Gc(G,I,x,M),Gc(G,I,R,M),Gc(G,I,C,M),Gc(G,I,V,M)),a<0&&s>0){let b=LF;b.longitude=c,b.latitude=0,b.height=0;let Z=o.cartographicToCartesian(b,R8);m.subtract(Z,g,Z),P=Math.max(P,Gc(G,v,Z,w),Gc(G,I,Z,M)),b.longitude=d,Z=o.cartographicToCartesian(b,R8),m.subtract(Z,g,Z),P=Math.max(P,Gc(G,v,Z,w),Gc(G,I,Z,M))}}return m.add(g,m.multiplyByScalar(G,-P,R8),n)}var xmt=new he,_mt=new m,Tmt=new m;function Smt(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=xmt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,_mt);A.multiplyByPoint(o,a,a),A.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Tmt);if(A.multiplyByPoint(o,c,c),A.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var Cmt=new he,Vmt=new m,Lmt=new m;function Rmt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===nd.INFINITE_SCROLL?o+=W.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=Cmt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Vmt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Lmt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,h,p=e.frustum.right/e.frustum.top,g=d*p;return c>g?(u=c,h=u/p):(h=d,u=g),d=Math.max(2*u,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}tn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===oe.SCENE3D)return Bxe(this,e,t);if(n===oe.COLUMBUS_VIEW)return Smt(this,e,t);if(n===oe.SCENE2D)return Rmt(this,e,t)};var Zmt=new pn;function Gmt(e,t,n,i){n=y(n,ne.default);let o=e.getPickRay(t,Zmt),r=qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return pn.getPoint(o,s,i)}var Emt=new pn;function Imt(e,t,n,i){let r=e.getPickRay(t,Emt).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Xmt=new pn;function Wmt(e,t,n,i){let o=e.getPickRay(t,Xmt),r=-o.origin.x/o.direction.x;pn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}tn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,ne.default),this._mode===oe.SCENE3D)n=Gmt(this,e,t,n);else if(this._mode===oe.SCENE2D)n=Imt(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=Wmt(this,e,this._projection,n);else return;return n}};var Pmt=new m,vmt=new m,wmt=new m;function Fmt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,h=e.positionWC;m.clone(h,n.origin);let p=m.multiplyByScalar(e.directionWC,c,Pmt);m.add(h,p,p);let g=m.multiplyByScalar(e.rightWC,d*c*a,vmt),f=m.multiplyByScalar(e.upWC,u*c*s,wmt),x=m.add(p,g,n.direction);return m.add(x,f,x),m.subtract(x,h,x),m.normalize(x,x),n}var xB=new m;function Amt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return m.clone(e.position,u),m.multiplyByScalar(e.right,c,xB),m.add(xB,u,u),m.multiplyByScalar(e.up,d,xB),m.add(xB,u,u),m.clone(e.directionWC,n.direction),(e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}tn.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Fmt(this,e,t):Amt(this,e,t)};var Mmt=new m,Nmt=new m;tn.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Mmt),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Nmt);return Math.max(0,m.magnitude(n)-e.radius)};var kmt=new D;tn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,kmt);return Math.max(o.x,o.y)};function Umt(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Fr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Dmt=new m,Zxe=new m,Bmt=new m,Omt=new m;function Ymt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,Dmt),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,Zxe),Zxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Bmt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,Omt)),u=c*d,h=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(h-g,g);if(n.z<-f||n.z>f||n.y<-x||n.y>x){let _=s.y<-f||s.y>f,C=s.z<-x||s.z>x;if(_||C)return Umt(e,n,s,f,x,t)}}tn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return Ymt(this,e)};var Hmt=new m,ta={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};tn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};tn.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ta.destination,e.orientation.heading=ta.heading,e.orientation.pitch=ta.pitch,e.orientation.roll=ta.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};tn.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Hmt));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=Axe(this,t,o,E8.orientation)),l(e.duration)&&e.duration<=0){let u=E8;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;ta.destination=t,ta.heading=o.heading,ta.pitch=o.pitch,ta.roll=o.roll,ta.duration=e.duration,ta.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ta.cancel=e.cancel,ta.endTransform=e.endTransform,ta.convert=i?!1:e.convert,ta.maximumHeight=e.maximumHeight,ta.pitchAdjustHeight=e.pitchAdjustHeight,ta.flyOverLongitude=e.flyOverLongitude,ta.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ta.easingFunction=e.easingFunction;let a=this._scene,c=VF.createTween(a,ta);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(d)||(d=tn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function zmt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Kmt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Jmt=100;function Oxe(e,t,n){n=Pu.clone(l(n)?n:tn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Jmt:e.frustum instanceof an||e._mode===oe.SCENE2D?n.range=Kmt(e,s):n.range=zmt(e,s),n.range=W.clamp(n.range,i,o)}return n}tn.prototype.viewBoundingSphere=function(e,t){t=Oxe(this,e,t),this.lookAt(e.center,t)};var Qmt=new A,jmt=new m,qmt=new m,$mt=new m,eht=new m,tht=new se,nht=new ve,iht=new $;tn.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(A.IDENTITY);let i=Oxe(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,jmt):o=Dxe(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ne.default),a=Pt.eastNorthUpToFixedFrame(e.center,s,Qmt);A.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=m.subtract(e.center,o,qmt),m.normalize(c,c),d=A.multiplyByPointAsVector(a,m.UNIT_Z,$mt),1-Math.abs(m.dot(c,d))<W.EPSILON6){let h=ve.fromAxisAngle(c,i.heading,nht),p=$.fromQuaternion(h,iht);m.fromCartesian4(A.getColumn(a,1,tht),d),$.multiplyByVector(p,d,d)}let u=m.cross(c,d,eht);m.cross(u,c,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Gxe=new m,Exe=new m,Z8=new m,Ixe=new m,RF=[new m,new m,new m,new m];function oht(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,Gxe),r=m.magnitude(o),s=m.normalize(o,Exe),a,c;m.equalsEpsilon(s,m.UNIT_Z,W.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,Z8),Z8),c=m.normalize(m.cross(s,a,Ixe),Ixe));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,Gxe),h=d/r,p=m.multiplyByScalar(a,h,Exe),g=m.multiplyByScalar(c,h,Z8),f=m.add(u,g,RF[0]);m.subtract(f,p,f),m.multiplyComponents(n,f,f);let x=m.subtract(u,g,RF[1]);m.subtract(x,p,x),m.multiplyComponents(n,x,x);let _=m.subtract(u,g,RF[2]);m.add(_,p,_),m.multiplyComponents(n,_,_);let C=m.add(u,g,RF[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),RF}var G8=new D,rht=new m,My=[new he,new he,new he,new he];function _B(e,t,n,i,o,r){G8.x=e,G8.y=t;let s=i.pickEllipsoid(G8,o,rht);return l(s)?(My[n]=o.cartesianToCartographic(s,My[n]),1):(My[n]=o.cartesianToCartographic(r[n],My[n]),0)}tn.prototype.computeViewRectangle=function(e,t){e=y(e,ne.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Ht.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=oht(this,e);if(c+=_B(0,0,0,this,e,d),c+=_B(0,a,1,this,e,d),c+=_B(s,a,2,this,e,d),c+=_B(s,0,3,this,e,d),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(My,t);let u=0,h=My[3].longitude;for(let p=0;p<4;++p){let g=My[p].longitude,f=Math.abs(g-h);f>W.PI?u+=W.TWO_PI-f:u+=f,h=g}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,My[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};tn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Vi)return;let e=this._scene;this.frustum=new Vi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};tn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof an)return;let e=wxe(this),t=this._scene;this.frustum=new an,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};tn.clone=function(e,t){return l(t)||(t=new tn(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),A.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=tn;var oMi=T(S(),1);function sht(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var bm=sht;var mMi=T(S(),1);var Jxe=T(dd(),1),Yxe=576,aht=100,ZF="#ffffff",LB="#48b";function Qxe(e,t){this.credit=e,this.count=y(t,1)}function cht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Ct.equals(o,t))return!0}return!1}function lht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Ct.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var jxe="cesium-credit-delimiter";function Hxe(e){let t=document.createElement("span");return t.textContent=e,t.className=jxe,t}function zxe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Kxe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(Hxe(n));else{let u=o[d];u.className!==jxe&&e.replaceChild(Hxe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(zxe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(zxe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function dht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Yxe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Yxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function uht(e){let t=`
.cesium-credit-lightbox-overlay {
  display: none;
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(80, 80, 80, 0.8);
}

.cesium-credit-lightbox {
  background-color: #303336;
  color: ${ZF};
  position: relative;
  min-height: ${aht}px;
  margin: auto;
}
.cesium-credit-lightbox > ul > li a,
.cesium-credit-lightbox > ul > li a:visited,
.cesium-credit-wrapper a,
.cesium-credit-wrapper a:visited {
  color: ${ZF};
}
.cesium-credit-lightbox > ul > li a:hover {
  color: ${LB};
}
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
  border: 1px solid #444;
  border-radius: 5px;
  max-width: 370px;
}
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
  height: 100%;
  width: 100%;
}
.cesium-credit-lightbox-title {
  padding: 20px 20px 0 20px;
}
.cesium-credit-lightbox-close {
  font-size: 18pt;
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 6px;
  color: ${ZF};
}
.cesium-credit-lightbox-close:hover {
  color: ${LB};
}
.cesium-credit-lightbox > ul {
  margin: 0;
  padding: 12px 20px 12px 40px;
  font-size: 13px;
}
.cesium-credit-lightbox > ul > li {
  padding-bottom: 6px;
}
.cesium-credit-lightbox > ul > li * {
  padding: 0;
  margin: 0;
}

.cesium-credit-expand-link {
  padding-left: 5px;
  cursor: pointer;
  text-decoration: underline;
  color: ${ZF};
}
.cesium-credit-expand-link:hover {
  color: ${LB};
}

.cesium-credit-text {
  color: ${ZF};
}

.cesium-credit-delimiter {
  padding: 0 5px;
}

.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
  display: inline;
}

.cesium-credit-textContainer a:hover {
  color: ${LB}
}

.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
  padding-left: 5px;
}
`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function fr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),uht(e);let g=Ct.clone(fr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=h,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Gt,lightboxCredits:new Gt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function qxe(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Qxe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}fr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Ct.clone($xe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,qxe(this,t,e)};fr.prototype.addStaticCredit=function(e){let t=this._staticCredits;cht(t,e)||t.push(e)};fr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};fr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};fr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};fr.prototype.update=function(){this._expanded&&dht(this)};fr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Ct.equals(fr.cesiumCredit,this._cesiumCredit)||qxe(this,s,r,Number.MAX_VALUE)}Ct.equals(fr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Ct.clone(fr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};fr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Kxe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Kxe(this._creditList,t,void 0,"li"),lht(this)};fr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),me(this)};fr.prototype.isDestroyed=function(){return!1};fr._cesiumCredit=void 0;fr._cesiumCreditInitialized=!1;var RB;function $xe(){if(!l(RB)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Jxe.default(e).path()),RB=new Ct(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return fr._cesiumCreditInitialized||(fr._cesiumCredit=RB,fr._cesiumCreditInitialized=!0),RB}Object.defineProperties(fr,{cesiumCredit:{get:function(){return $xe(),fr._cesiumCredit},set:function(e){fr._cesiumCredit=e,fr._cesiumCreditInitialized=!0}}});fr.CreditDisplayElement=Qxe;var GF=fr;var XMi=T(S(),1);function ZB(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,B.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var mht=new m,hht=new $,fht=new ve,pht=new Vi,bht=new Jc,ght=new an,yht=new Pr,xht=new B,_ht=[1,1e5];ZB.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Vi?a=pht:s instanceof Jc?a=bht:s instanceof an?a=ght:a=yht,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=_ht,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,mht);let f=hht;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,h,f);let x=ve.fromRotationMatrix(f,fht);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Et({geometry:new Ox({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(B.fromAlpha(this._color,.1,xht))},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Et({geometry:new HE({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};ZB.prototype.isDestroyed=function(){return!1};ZB.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return me(this)};var op=ZB;var oNi=T(S(),1);var PMi=T(S(),1),EF=`in vec4 positionEC;

void main()
{
    vec3 position;
    vec3 direction;
    if (czm_orthographicIn3D == 1.0)
    {
        vec2 uv = (gl_FragCoord.xy -  czm_viewport.xy) / czm_viewport.zw;
        vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
        vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
        position = vec3(mix(minPlane, maxPlane, uv), 0.0);
        direction = vec3(0.0, 0.0, -1.0);
    } 
    else 
    {
        position = vec3(0.0);
        direction = normalize(positionEC.xyz);
    }

    czm_ray ray = czm_ray(position, direction);

    vec3 ellipsoid_center = czm_view[3].xyz;

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
    if (!czm_isEmpty(intersection))
    {
        out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
    }
    else
    {
        discard;
    }

    czm_writeLogDepth();
}
`;var wMi=T(S(),1),IF=`in vec4 position;

out vec4 positionEC;

void main()
{
    positionEC = czm_modelView * position;
    gl_Position = czm_projection * positionEC;

    czm_vertexLogDepth();
}
`;function WF(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var XF=Bt.supportsTypedArrays()?new Float32Array(12):[],e_e=new m,t_e=new m,P8=new m,n_e=new m,GB=new m;function Tht(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof an)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,h,e_e),g=m.normalize(p,t_e),f=m.normalize(m.cross(m.UNIT_Z,p,P8),P8),x=m.normalize(m.cross(g,f,n_e),n_e),_=m.magnitude(p),C=Math.sqrt(_*_-1);o=m.multiplyByScalar(g,1/_,e_e);let V=C/_;r=m.multiplyByScalar(f,V,t_e),s=m.multiplyByScalar(x,V,P8)}let a=m.add(o,s,GB);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,XF,0);let c=m.subtract(o,s,GB);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,XF,3);let d=m.add(o,s,GB);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,XF,6);let u=m.subtract(o,s,GB);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,XF,9),XF}WF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new $e({renderState:this._rs,boundingVolume:new le(m.ZERO,i.maximumRadius),pass:Ee.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new De({sources:[IF]}),a=new De({sources:[EF]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Tht(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new lt({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:we.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};WF.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};WF.prototype.isDestroyed=function(){return!1};WF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var PF=WF;var hNi=T(S(),1);function fL(){}var Sht=/\bgl_FragDepth\b/,Cht=/\bdiscard\b/;function Vht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(Sht.test(r[a])||Cht.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main()
{
    out_FragColor = vec4(1.0);
}
`;i=new De({sources:[a]})}else if(!o&&s){let a=`void main()
{
    out_FragColor = vec4(1.0);
    czm_writeLogDepth();
}
`;i=new De({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Lht(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ue.fromCache(o);return n[t.id]=r,r}fL.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=$e.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Vht(n,t.shaderProgram),i.depthOnlyCommand.renderState=Lht(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Rht=/\s+czm_writeLogDepth\(/,Zht=/\s+czm_vertexLogDepth\(/;function Ght(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(Zht.test(c[u])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=De.replaceMain(c[h],"czm_log_depth_main");c.push(`

void main()
{
    czm_log_depth_main();
    czm_vertexLogDepth();
}
`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)Rht.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=De.replaceMain(c[u],"czm_log_depth_main");d=`
void main()
{
    czm_log_depth_main();
    czm_writeLogDepth();
}
`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}fL.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Ght(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Eht(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () 
{ 
    czm_non_pick_main(); 
    if (${c}.a == 0.0) { 
        discard; 
    } 
    ${c} = ${n}; 
} `,u=r.length,h=new Array(u+1);for(let g=0;g<u;++g)h[g]=De.replaceMain(r[g],"czm_non_pick_main");h[u]=d;let p=new De({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function i_e(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ue.fromCache(o);return n[t.id]=r,r}fL.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=$e.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Eht(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=i_e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function hL(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function o_e(e){return e.isArray?e.arrayLength:ct.getComponentCount(e.type)}function Iht(e){let t=o_e(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function r_e(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function s_e(e,t){let n=Ft.getMaximum(t);return`(${e}) / float(${n})`}function Xht(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=r_e(n,i,o)}return e.normalized||(n=s_e(n,e.componentType)),n}function Wht(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=r_e(o,r,s)}return e.normalized||(o=s_e(o,e.componentType)),o}function Pht(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=Iht(d),h=["0.0","0.0","0.0","0.0"],p=o_e(d);if(p===1)h[0]=Xht(d,c);else{let _=["x","y","z","w"];for(let C=0;C<p;C++)h[C]=Wht(d,c,_[C])}let g=t.fragmentShaderSource.defines.slice();g.push(Pd.METADATA_PICKING_ENABLED),hL(g,Pd.METADATA_PICKING_VALUE_TYPE,u),hL(g,Pd.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),hL(g,Pd.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),hL(g,Pd.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),hL(g,Pd.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),hL(g,Pd.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let f=new De({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}fL.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=$e.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Pht(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=i_e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function vht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}fL.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=vht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var rp=fL;var _Ni=T(S(),1);function EB(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var wht=new ve,a_e=new ve,Fht=new $;function Aht(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=ve.fromAxisAngle(o,n,a_e),c=ve.fromAxisAngle(r,i,wht),d=ve.multiply(c,a,c),u=ve.fromAxisAngle(s,t,a_e);ve.multiply(u,d,d);let h=$.fromQuaternion(d,Fht);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}EB.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Aht(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};EB.prototype.isDestroyed=function(){return!1};EB.prototype.destroy=function(){return this._removeListener(),me(this)};var vF=EB;var RNi=T(S(),1);function v8(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(v8.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Mht=new m;v8.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,W.EPSILON4),-Math.max(this._heightFalloff,0)),s=m.normalize(n.positionWC,Mht),a=Math.abs(m.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var wF=v8;var ENi=T(S(),1);function Nht(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var FF=Nht;var BNi=T(S(),1);var Ta={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},$T=Ta.DERIVED_COMMANDS_MAXIMUM_LENGTH,g_e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function eS(){this._frontFaceAlphaByDistance=new kt(0,1,0,1),this._backFaceAlphaByDistance=new kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array($T),this._derivedBlendCommandTypes=new Array($T),this._derivedPickCommandTypes=new Array($T),this._derivedCommandTypesToUpdate=new Array($T),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(eS.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});eS.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=c_e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=c_e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=l_e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=l_e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Bht(this,e,t),this._sunVisibleThroughGlobe=kht(this,e),this._environmentVisible=Uht(this,e),this._useDepthPlane=Dht(this,e),this._numberOfTextureUniforms=Oht(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Yht(this,e)};function c_e(e,t,n,i){return e?l(n)?(kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function l_e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function kht(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Uht(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Dht(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Bht(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Oht(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Yht(e,t){e._derivedCommandsLength=w8(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=w8(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=w8(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<$T;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=sft())}function w8(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?Ta.PICK_FRONT_FACE:d?Ta.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ta.TRANSLUCENT_FRONT_FACE,h=i?Ta.PICK_BACK_FACE:d?Ta.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ta.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=Ta.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=Ta.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=h):(o[r++]=h,o[r++]=u)):c?(n||(o[r++]=Ta.DEPTH_ONLY_BACK_FACE),o[r++]=Ta.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=Ta.DEPTH_ONLY_FRONT_FACE),o[r++]=Ta.OPAQUE_BACK_FACE,o[r++]=u),r)}function gm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function d_e(e,t){return e.indexOf(t)>-1}function Hht(e,t){gm(e.defines,"TRANSLUCENT"),gm(t.defines,"TRANSLUCENT")}function zht(e,t){gm(e.defines,"GROUND_ATMOSPHERE"),gm(t.defines,"GROUND_ATMOSPHERE"),gm(e.defines,"FOG"),gm(t.defines,"FOG"),gm(e.defines,"TRANSLUCENT"),gm(t.defines,"TRANSLUCENT")}function F8(e,t){if(d_e(t.defines,"TILE_LIMIT_RECTANGLE")||d_e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() 
{ 
    out_FragColor = vec4(1.0); 
} 
`;t.sources=[n]}function A8(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=De.replaceMain(n[r],"czm_globe_translucency_main");n.push(`

uniform sampler2D u_classificationTexture; 
void main() 
{ 
    vec2 st = gl_FragCoord.xy / czm_viewport.zw; 
#ifdef MANUAL_DEPTH_TEST 
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); 
    if (logDepthOrDepth != 0.0) 
    { 
        vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); 
        float depthEC = eyeCoordinate.z / eyeCoordinate.w; 
        if (v_positionEC.z < depthEC) 
        { 
            discard; 
        } 
    } 
#endif 
    czm_globe_translucency_main(); 
    vec4 classificationColor = texture(u_classificationTexture, st); 
    if (classificationColor.a > 0.0) 
    { 
        // Reverse premultiplication process to get the correct composited result of the classification primitives 
        classificationColor.rgb /= classificationColor.a; 
    } 
    out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); 
} 
`)}function y_e(e,t){A8(e,t),gm(e.defines,"GROUND_ATMOSPHERE"),gm(t.defines,"GROUND_ATMOSPHERE"),gm(e.defines,"FOG"),gm(t.defines,"FOG")}function Kht(e,t){A8(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Jht(e,t){y_e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function u_e(e,t){let n=`uniform sampler2D u_classificationTexture; 
void main() 
{ 
    vec2 st = gl_FragCoord.xy / czm_viewport.zw; 
    vec4 pickColor = texture(u_classificationTexture, st); 
    if (pickColor == vec4(0.0)) 
    { 
        discard; 
    } 
    out_FragColor = pickColor; 
} 
`;t.sources=[n]}function Qht(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function jht(e){e.cull.face=Ti.BACK,e.cull.enabled=!0}function qht(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0}function $ht(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function eft(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function tft(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function m_e(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function h_e(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function nft(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function ift(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function oft(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ue.getState(e);i(s),r=Ue.fromCache(s),o[e.id]=r}return r}function pL(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function rft(e,t,n,i,o){return l(o)?!i&&l(n)?n:St(t,o(e),!1):t}function Oh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function sft(){return[new Oh({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Hht,getRenderStateFunction:jht,getUniformMapFunction:void 0}),new Oh({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:zht,getRenderStateFunction:qht,getUniformMapFunction:void 0}),new Oh({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:F8,getRenderStateFunction:$ht,getUniformMapFunction:void 0}),new Oh({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:F8,getRenderStateFunction:eft,getUniformMapFunction:void 0}),new Oh({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:F8,getRenderStateFunction:tft,getUniformMapFunction:void 0}),new Oh({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:A8,getRenderStateFunction:m_e,getUniformMapFunction:pL}),new Oh({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:y_e,getRenderStateFunction:h_e,getUniformMapFunction:pL}),new Oh({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Kht,getRenderStateFunction:m_e,getUniformMapFunction:pL}),new Oh({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Jht,getRenderStateFunction:h_e,getUniformMapFunction:pL}),new Oh({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:u_e,getRenderStateFunction:nft,getUniformMapFunction:pL}),new Oh({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:u_e,getRenderStateFunction:ift,getUniformMapFunction:pL})]}var f_e=new Array($T),p_e=new Array($T);eS.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)p_e[o]=this._derivedCommandPacks[n[o]],f_e[o]=g_e[n[o]];aft(this,e,i,n,f_e,p_e,t)}};function aft(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=y(a.uniformMapDirtyFrame,0),h=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),x&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],R=a[L],G,I,v;l(R)?(G=R.uniformMap,I=R.shaderProgram,v=R.renderState):(G=void 0,I=void 0,v=void 0),R=$e.shallowClone(t,R),a[L]=R;let P=y(R.derivedCommands.uniformMapDirtyFrame,0),w=y(R.derivedCommands.shaderProgramDirtyFrame,0),M=y(R.derivedCommands.renderStateDirtyFrame,0),b=g||P<u,Z=f||w<h,E=x||M<p;b&&(R.derivedCommands.uniformMapDirtyFrame=d),Z&&(R.derivedCommands.shaderProgramDirtyFrame=d),E&&(R.derivedCommands.renderStateDirtyFrame=d),R.derivedCommands.type=V,R.pass=C.pass,R.pickOnly=C.pickOnly,R.uniformMap=rft(e,t.uniformMap,G,b,C.getUniformMapFunction),R.shaderProgram=Qht(s.context,t.shaderProgram,I,Z,C.getShaderProgramFunction,L),R.renderState=oft(t.renderState,v,E,C.getRenderStateFunction,C.renderStateCache)}}}eS.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=g_e[o[a]];n.commandList.push(s[c])}};function x_e(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function b_e(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var cft=[Ta.OPAQUE_FRONT_FACE,Ta.OPAQUE_BACK_FACE],lft=[Ta.DEPTH_ONLY_FRONT_FACE,Ta.DEPTH_ONLY_BACK_FACE,Ta.DEPTH_ONLY_FRONT_AND_BACK_FACE];eS.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ee.GLOBE],a=e.indices[Ee.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),x_e(s,a,t,i,o,cft))};eS.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Ee.GLOBE],c=e.indices[Ee.GLOBE],d=e.commands[Ee.TERRAIN_CLASSIFICATION],u=e.indices[Ee.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&b_e(d,u,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,x_e(a,c,t,i,o,lft),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}b_e(d,u,t,i,o),s.globeDepthTexture=g,o.framebuffer=f};var AF=eS;var d5i=T(S(),1);var YNi=T(S(),1),id=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function sp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new fi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new fi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ti({color:new B(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new B(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(sp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});sp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var dft={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Bn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Bn.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},uft={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Bn.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},mft={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},hft=`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform sampler2D classifiedTexture;
in vec2 v_textureCoordinates;
void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    if (color.a == 0.0)
    {
        discard;
    }
    bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
#ifdef UNCLASSIFIED
    vec4 highlightColor = czm_invertClassificationColor;
    if (isClassified)
    {
        discard;
    }
#else
    vec4 highlightColor = vec4(1.0);
    if (!isClassified)
    {
        discard;
    }
#endif
    out_FragColor = color * highlightColor;
    gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
}
`,fft=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    if (color.a == 0.0)
    {
        discard;
    }
#ifdef UNCLASSIFIED
    out_FragColor = color * czm_invertClassificationColor;
#else
    out_FragColor = color;
#endif
}
`;sp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new vt({context:e,width:s,height:a,pixelFormat:it.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new fd({context:e,width:s,height:a,format:Mc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ue.fromCache(dft),this._rsClassified=Ue.fromCache(uft),this._rsDefault=Ue.fromCache(mft)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?fft:hft,u=new De({defines:["UNCLASSIFIED"],sources:[d]}),h=new De({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(id,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};sp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};sp.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};sp.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};sp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),me(this)};var bL=sp;var p5i=T(S(),1);function IB(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(IB.prototype,{total:{get:function(){return this._total}}});function Ny(e){let t=new Array(Ma.NUMBER_OF_JOB_TYPES);t[Ma.TEXTURE]=new IB(l(e)?e[Ma.TEXTURE]:10),t[Ma.PROGRAM]=new IB(l(e)?e[Ma.PROGRAM]:10),t[Ma.BUFFER]=new IB(l(e)?e[Ma.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Ny.getTimestamp=xi;Object.defineProperties(Ny.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Ny.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Ny.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Ny.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Ny.getTimestamp();e.execute();let a=Ny.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var MF=Ny;var T5i=T(S(),1);function XB(e){e=y(e,y.EMPTY_OBJECT);let t=Xn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xi(),this._lastMsSampleTime=xi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(XB.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});XB.prototype.update=function(e){let t=xi(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};XB.prototype.destroy=function(){return me(this)};var _0=XB;var IBi=T(S(),1);var v5i=T(S(),1);var Sa={};Sa.decodeRawMetadataValue=function(e,t,n){switch(e){case Ft.INT8:return t.getInt8(n);case Ft.UINT8:return t.getUint8(n);case Ft.INT16:return t.getInt16(n,!0);case Ft.UINT16:return t.getUint16(n,!0);case Ft.INT32:return t.getInt32(n,!0);case Ft.UINT32:return t.getUint32(n,!0);case Ft.INT64:return t.getBigInt64(n,!0);case Ft.UINT64:return t.getBigUint64(n,!0);case Ft.FLOAT32:return t.getFloat32(n,!0);case Ft.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};Sa.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Sa.decodeRawMetadataValue(i,t,n);return e.normalized?Ft.normalize(o,i):o};Sa.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Ft.getSizeInBytes(i),r=e.type,s=ct.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=Sa.decodeRawMetadataValueComponent(e,t,p);u[h]=g}return u}let c=n*a;return Sa.decodeRawMetadataValueComponent(e,t,c)};Sa.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=Sa.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Sa.decodeRawMetadataValueElement(e,n,0)};Sa.convertToObjectType=function(e,t){if(!l(t)||e===ct.SCALAR||e===ct.STRING||e===ct.BOOLEAN||e===ct.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case ct.VEC2:return D.unpack(n,0,new D);case ct.VEC3:return m.unpack(n,0,new m);case ct.VEC4:return se.unpack(n,0,new se);case ct.MAT2:return Ii.unpack(n,0,new Ii);case ct.MAT3:return $.unpack(n,0,new $);case ct.MAT4:return A.unpack(n,0,new A)}throw new ae(`Invalid metadata object type: ${e}`)};Sa.convertFromObjectType=function(e,t){if(!l(t)||e===ct.SCALAR||e===ct.STRING||e===ct.BOOLEAN||e===ct.ENUM)return t;switch(e){case ct.VEC2:return D.pack(t,Array(2));case ct.VEC3:return m.pack(t,Array(3));case ct.VEC4:return se.pack(t,Array(4));case ct.MAT2:return Ii.pack(t,Array(4));case ct.MAT3:return $.pack(t,Array(9));case ct.MAT4:return A.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};Sa.decodeMetadataValues=function(e,t,n){let i=Sa.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Sa.convertFromObjectType(e.type,t.offset),s=Sa.convertFromObjectType(e.type,t.scale);i=Ef.valueTransformInPlace(i,r,s,Ft.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=Sa.convertToObjectType(e.type,c);s[a]=d}return s}return Sa.convertToObjectType(e.type,i)};var NF=Object.freeze(Sa);var U5i=T(S(),1);function tS(){this._framebuffer=new fi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(tS.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function pft(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function bft(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
  vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
  float globeDepth = czm_unpackDepth(globeDepthPacked);
  float depth = texture(colorTexture, v_textureCoordinates).r;
  out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
    czm_packDepth(depth), globeDepthPacked);
}
`,{renderState:Ue.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}tS.prototype.update=function(e,t){pft(this,e,t),bft(this,e,t)};var gft=new se,yft=new se(1,1/255,1/65025,1/16581375);tS.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,gft);return se.divideByScalar(o,255,o),se.dot(o,yft)};tS.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};tS.prototype.isDestroyed=function(){return!1};tS.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var kF=tS;var iBi=T(S(),1);var Y5i=T(S(),1);function xft(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ee.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var UF=xft;var lki=T(S(),1);var z5i=T(S(),1),ky=`uniform highp sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function ap(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new fi,this._tempCopyDepthFramebuffer=new fi,this._updateDepthFramebuffer=new fi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(ap.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function __e(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Ke.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!Ke.equals(r,e._rs.viewport)||a)&&(e._rs=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Bn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Bn.NEVER,reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(ky,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(id,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(ky,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(id,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new B(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}ap.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),__e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};ap.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};ap.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};ap.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),__e(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};ap.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};ap.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(B.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),me(this)};var DF=ap;var _ki=T(S(),1);function nS(){this._framebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new fi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(nS.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function _ft(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Tft(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Sft(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(ky,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ti({color:new B(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}nS.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Tft(this,n,o,r,e),Sft(this,n,o,r,i),this._useHdr=e};nS.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};nS.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};nS.prototype.isDestroyed=function(){return!1};nS.prototype.destroy=function(){return _ft(this),me(this)};var BF=nS;var Bki=T(S(),1);var Ski=T(S(),1),gL=`#ifdef MRT
layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;
#else
layout (location = 0) out vec4 out_FragColor;
#endif

uniform vec4 u_bgColor;
uniform sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
    {
#ifdef MRT
        out_FragData_0 = u_bgColor;
        out_FragData_1 = vec4(u_bgColor.a);
#else
        out_FragColor = u_bgColor;
#endif
        return;
    }
    
    discard;
}
`;var Vki=T(S(),1),OF=`/**
 * Compositing for Weighted Blended Order-Independent Transparency. See:
 * - http://jcgt.org/published/0002/02/09/
 * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
 */

uniform sampler2D u_opaque;
uniform sampler2D u_accumulation;
uniform sampler2D u_revealage;

in vec2 v_textureCoordinates;

void main()
{
    vec4 opaque = texture(u_opaque, v_textureCoordinates);
    vec4 accum = texture(u_accumulation, v_textureCoordinates);
    float r = texture(u_revealage, v_textureCoordinates).r;

#ifdef MRT
    vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
#else
    vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
#endif

    out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;

    if (opaque != czm_backgroundColor)
    {
        out_FragColor.a = 1.0;
    }
}
`;function T0(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new fi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new fi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new fi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new fi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new B(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new B(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new B(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new B(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function T_e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function M8(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function S_e(e){T_e(e),M8(e)}function Cft(e,t,n,i){T_e(e),e._accumulationTexture=new vt({context:t,width:n,height:i,pixelFormat:it.RGBA,pixelDatatype:je.FLOAT}),e._revealageTexture=new vt({context:t,pixelFormat:it.RGBA,pixelDatatype:je.FLOAT,width:n,height:i,flipY:!1})}function Vft(e,t){M8(e);let n=ie.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(M8(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(S_e(e),e._translucentMultipassSupport=!1,i=!1)}return i}T0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,Cft(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!Vft(this,e))return;this._useHDR=i;let u=this,h,p;l(this._compositeCommand)||(h=new De({sources:[OF]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new De({defines:["MRT"],sources:[gL]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new De({sources:[gL]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=Ue.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Lft={enabled:!0,color:new B(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Vo.ONE,functionDestinationRgb:Vo.ONE,functionSourceAlpha:Vo.ZERO,functionDestinationAlpha:Vo.ONE_MINUS_SOURCE_ALPHA},Rft={enabled:!0,color:new B(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Vo.ONE,functionDestinationRgb:Vo.ONE,functionSourceAlpha:Vo.ONE,functionDestinationAlpha:Vo.ONE},Zft={enabled:!0,color:new B(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Vo.ZERO,functionDestinationRgb:Vo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Vo.ZERO,functionDestinationAlpha:Vo.ONE_MINUS_SOURCE_ALPHA};function N8(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ue.getState(i);r.depthMask=!1,r.blending=t,o=Ue.fromCache(r),n[i.id]=o}return o}function Gft(e,t,n){return N8(t,Lft,e._translucentRenderStateCache,n)}function Eft(e,t,n){return N8(t,Rft,e._translucentRenderStateCache,n)}function Ift(e,t,n){return N8(t,Zft,e._alphaRenderStateCache,n)}var Xft=`    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
    float ai = czm_out_FragColor.a;
    float wzi = czm_alphaWeight(ai);
    out_FragData_0 = vec4(Ci * wzi, ai);
    out_FragData_1 = vec4(ai * wzi);
`,Wft=`    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
    float ai = czm_out_FragColor.a;
    float wzi = czm_alphaWeight(ai);
    out_FragColor = vec4(Ci, ai) * wzi;
`,Pft=`    float ai = czm_out_FragColor.a;
    out_FragColor = vec4(ai);
`;function k8(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return De.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
bool czm_discard = false;
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let h=c[u];d=`layout (location = ${h[1]}) out vec4 ${h[0]};
${d}`}return a.sources.push(d),a.sources.push(`void main()
{
    czm_translucent_main();
    if (czm_discard)
    {
        discard;
    }
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function vft(e,t){return k8(e,t,"translucentMRT",Xft)}function wft(e,t){return k8(e,t,"translucentMultipass",Wft)}function Fft(e,t){return k8(e,t,"alphaMultipass",Pft)}T0.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=vft(t,e.shaderProgram),n.translucentCommand.renderState=Gft(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),n.alphaCommand=$e.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=wft(t,e.shaderProgram),n.translucentCommand.renderState=Eft(this,t,e.renderState),n.alphaCommand.shaderProgram=Fft(t,e.shaderProgram),n.alphaCommand.renderState=Ift(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Aft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(x,t,i,g)}i.framebuffer=h}function Mft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=h}T0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Mft(this,e,t,n,i,o);return}Aft(this,e,t,n,i,o)};T0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};T0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,B.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};T0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};T0.prototype.isDestroyed=function(){return!1};T0.prototype.destroy=function(){return S_e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),me(this)};var YF=T0;var Jki=T(S(),1);function HF(){this._framebuffer=new fi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(HF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Nft(e){e._framebuffer.destroy()}function kft(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new oc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}HF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&kft(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};HF.prototype.isDestroyed=function(){return!1};HF.prototype.destroy=function(){return Nft(this),me(this)};var zF=HF;var oUi=T(S(),1);function yL(e){let t=new oc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new fi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}yL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var KF=new B;yL.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),d=0,u=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);KF.red=B.byteToFloat(o[f]),KF.green=B.byteToFloat(o[f+1]),KF.blue=B.byteToFloat(o[f+2]),KF.alpha=B.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(KF);if(l(x))return x}if(d===u||d<0&&-d===u||d>0&&d===1-u){let f=h;h=-p,p=f}d+=h,u+=p}};yL.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};yL.prototype.isDestroyed=function(){return!1};yL.prototype.destroy=function(){return this._fb.destroy(),me(this)};var JF=yL;var uUi=T(S(),1);function S0(){this._numSamples=1,this._colorFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new B(0,0,0,0),this._clearCommand=new ti({color:new B(0,0,0,0),depth:1,owner:this})}function Uft(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(S0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});S0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};S0.prototype.clear=function(e,t,n){B.clone(n,this._clearCommand.color),B.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};S0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};S0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};S0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};S0.prototype.isDestroyed=function(){return!1};S0.prototype.destroy=function(){return Uft(this),me(this)};var iS=S0;var cDi=T(S(),1);var pUi=T(S(),1);function oS(){}oS.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};oS.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=De.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=De.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; 
void main() 
{ 
    czm_shadow_cast_main(); 
    v_positionEC = (czm_inverseProjection * gl_Position).xyz; 
}`)}return new De({defines:i,sources:o})};oS.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=De.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=De.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC; 
`),d+=`uniform vec4 shadowMap_lightPositionEC; 
`),i?d+=`void main() 
{ 
`:d+=`void main() 
{ 
    czm_shadow_cast_main(); 
    if (out_FragColor.a == 0.0) 
    { 
       discard; 
    } 
`,t?d+=`    float distance = length(${s}); 
    if (distance >= shadowMap_lightPositionEC.w) 
    { 
        discard; 
    } 
    distance /= shadowMap_lightPositionEC.w; // radius 
    out_FragColor = czm_packDepth(distance); 
`:n?d+=`    out_FragColor = vec4(1.0); 
`:d+=`    out_FragColor = czm_packDepth(gl_FragCoord.z); 
`,d+=`} 
`,r.push(d),new De({defines:o,sources:r})};oS.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};oS.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new De({defines:i,sources:o})};oS.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=De.findNormalVarying(e),s=!i&&l(r)||i&&o,a=De.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,f=t.debugCascadeColors,x=t.softShadows,_=h?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let I=0;I<L;++I)V[I]=De.replaceMain(V[I],"czm_shadow_receive_main");h?C.push("USE_CUBE_MAP_SHADOW"):d&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!h&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let R="";h?R+=`uniform samplerCube shadowMap_textureCube; 
`:R+=`uniform sampler2D shadowMap_texture; 
`;let G;return c?G=`    return vec4(${a}, 1.0); 
`:G=`#ifndef LOG_DEPTH 
    return czm_windowToEyeCoordinates(gl_FragCoord); 
#else 
    return vec4(v_logPositionEC, 1.0); 
#endif 
`,R+=`uniform mat4 shadowMap_matrix; 
uniform vec3 shadowMap_lightDirectionEC; 
uniform vec4 shadowMap_lightPositionEC; 
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; 
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; 
#ifdef LOG_DEPTH 
in vec3 v_logPositionEC; 
#endif 
vec4 getPositionEC() 
{ 
${G}} 
vec3 getNormalEC() 
{ 
${s?`    return normalize(${r}); 
`:`    return vec3(1.0); 
`}} 
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) 
{ 
${_.normalOffset&&s?`    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; 
    float normalOffsetScale = 1.0 - nDotL; 
    vec3 offset = normalOffset * normalOffsetScale * normalEC; 
    positionEC.xyz += offset; 
`:""}} 
`,R+=`void main() 
{ 
    czm_shadow_receive_main(); 
    vec4 positionEC = getPositionEC(); 
    vec3 normalEC = getNormalEC(); 
    float depth = -positionEC.z; 
`,R+=`    czm_shadowParameters shadowParameters; 
    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; 
    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; 
    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; 
    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; 
`,i?R+=`    shadowParameters.depthBias *= max(depth * 0.01, 1.0); 
`:u||(R+=`    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); 
`),h?R+=`    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; 
    float distance = length(directionEC); 
    directionEC = normalize(directionEC); 
    float radius = shadowMap_lightPositionEC.w; 
    // Stop early if the fragment is beyond the point light radius 
    if (distance > radius) 
    { 
        return; 
    } 
    vec3 directionWC  = czm_inverseViewRotation * directionEC; 
    shadowParameters.depth = distance / radius; 
    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    shadowParameters.texCoords = directionWC; 
    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); 
`:p?R+=`    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); 
    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Spot light uses a perspective projection, so perform the perspective divide 
    shadowPosition /= shadowPosition.w; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
`:g?R+=`    float maxDepth = shadowMap_cascadeSplits[1].w; 
    // Stop early if the eye depth exceeds the last cascade 
    if (depth > maxDepth) 
    { 
        return; 
    } 
    // Get the cascade based on the eye-space depth 
    vec4 weights = czm_cascadeWeights(depth); 
    // Apply normal offset 
    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    // Transform position into the cascade 
    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; 
    // Get visibility 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
    // Fade out shadows that are far away 
    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; 
    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); 
    visibility = mix(visibility, 1.0, fade); 
${f?`    // Draw cascade colors for debugging 
    out_FragColor *= czm_cascadeColor(weights); 
`:""}`:R+=`    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
`,R+=`    out_FragColor.rgb *= visibility; 
} 
`,V.push(R),new De({defines:C,sources:V})};var cp=oS;function lp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Bt.isInternetExplorer()||Bt.isEdge()||(Bt.isChrome()||Bt.isFirefox())&&Bt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new A,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new WB,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new A,new A,new A,new A],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Dft(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,D8(this),this._clearCommand=new ti({depth:1,color:new B}),this._clearPassState=new oc(t),this._size=y(e.size,2048),this.size=this._size}lp.MAXIMUM_DISTANCE=2e4;function Dft(e){this.camera=new WB,this.passState=new oc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function U8(e,t){return Ue.fromCache({cull:{enabled:!0,face:Ti.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function D8(e){let t=!e._usesDepthTexture;e._primitiveRenderState=U8(t,e._primitiveBias),e._terrainRenderState=U8(t,e._terrainBias),e._pointRenderState=U8(t,e._pointBias)}lp.prototype.debugCreateRenderStates=function(){D8(this)};Object.defineProperties(lp.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Kft(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function B8(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Bft(e,t){let n=new fd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Mc.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST}),o=new Wr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Oft(e,t){let n=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:it.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:qt.NEAREST}),i=new Wr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Yft(e,t){let n=new fd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Mc.DEPTH_COMPONENT16}),i=new xr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Wr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function L_e(e,t){e._isPointLight?Yft(e,t):e._usesDepthTexture?Oft(e,t):Bft(e,t)}function Hft(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,D8(e),B8(e),L_e(e,t))}function zft(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(B8(e),L_e(e,t),Hft(e,t),R_e(e,t))}function R_e(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Kft(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=At.maximumCubeMapSize>=t?t:At.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=At.maximumTextureSize>=t?t:At.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=At.maximumTextureSize>=t*2?t:At.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,h=a.height/o.y;s.textureOffsets=new A(u,0,0,c,0,h,0,d,0,0,1,0,0,0,0,1)}}var Jft=new Ke;function Qft(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; 
in vec2 v_textureCoordinates; 
void main() 
{ 
    vec2 uv = v_textureCoordinates; 
    vec3 dir; 
 
    if (uv.y < 0.5) 
    { 
        if (uv.x < 0.333) 
        { 
            dir.x = -1.0; 
            dir.y = uv.x * 6.0 - 1.0; 
            dir.z = uv.y * 4.0 - 1.0; 
        } 
        else if (uv.x < 0.666) 
        { 
            dir.y = -1.0; 
            dir.x = uv.x * 6.0 - 3.0; 
            dir.z = uv.y * 4.0 - 1.0; 
        } 
        else 
        { 
            dir.z = -1.0; 
            dir.x = uv.x * 6.0 - 5.0; 
            dir.y = uv.y * 4.0 - 1.0; 
        } 
    } 
    else 
    { 
        if (uv.x < 0.333) 
        { 
            dir.x = 1.0; 
            dir.y = uv.x * 6.0 - 1.0; 
            dir.z = uv.y * 4.0 - 3.0; 
        } 
        else if (uv.x < 0.666) 
        { 
            dir.y = 1.0; 
            dir.x = uv.x * 6.0 - 3.0; 
            dir.z = uv.y * 4.0 - 3.0; 
        } 
        else 
        { 
            dir.z = 1.0; 
            dir.x = uv.x * 6.0 - 5.0; 
            dir.y = uv.y * 4.0 - 3.0; 
        } 
    } 
 
    float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); 
    out_FragColor = vec4(vec3(shadow), 1.0); 
} 
`:n=`uniform sampler2D shadowMap_texture; 
in vec2 v_textureCoordinates; 
void main() 
{ 
${e._usesDepthTexture?`    float shadow = texture(shadowMap_texture, v_textureCoordinates).r; 
`:`    float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); 
`}    out_FragColor = vec4(vec3(shadow), 1.0); 
} 
`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ee.OVERLAY,i}function jft(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Jft;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Qft(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var dp=new Array(8);dp[0]=new se(-1,-1,-1,1);dp[1]=new se(1,-1,-1,1);dp[2]=new se(1,1,-1,1);dp[3]=new se(-1,1,-1,1);dp[4]=new se(-1,-1,1,1);dp[5]=new se(1,-1,1,1);dp[6]=new se(1,1,1,1);dp[7]=new se(-1,1,1,1);var Uy=new A,O8=new Array(8);for(let e=0;e<8;++e)O8[e]=new se;function qft(e,t){let n=new Et({geometry:new Am({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new Et({geometry:new tb({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var $ft=[B.RED,B.GREEN,B.BLUE,B.MAGENTA],ept=new m;function tpt(e,t){jft(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new op({camera:e._sceneCamera,color:B.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new op({camera:e._passes[i].camera,color:$ft[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=ve.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,ept),a=A.fromTranslationQuaternionRotationScale(i,o,s,Uy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=qft(a,B.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function WB(){this.viewMatrix=new A,this.inverseViewMatrix=new A,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new A}WB.prototype.clone=function(e){A.clone(e.viewMatrix,this.viewMatrix),A.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var npt=new A(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);WB.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return A.multiply(t,e,this.viewProjectionMatrix),A.multiply(npt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var ipt=new Array(5),opt=new Vi,rpt=new Array(4),Z_e=new m,G_e=new m;function spt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,u=.9);let p=rpt,g=ipt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let M=(a+1)/s,b=o*Math.pow(d,M),Z=o+c*M,E=W.lerp(Z,b,u);g[a+1]=E,p[a]=E-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let M=g[0];for(a=0;a<s-1;++a)M+=p[a],g[a+1]=M}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let f=n.frustum,x=f.left,_=f.right,C=f.bottom,V=f.top,L=f.near,R=f.far,G=n.positionWC,I=n.directionWC,v=n.upWC,P=i.frustum.clone(opt),w=n.getViewProjection();for(a=0;a<s;++a){P.near=g[a],P.far=g[a+1];let M=A.multiply(P.projectionMatrix,i.viewMatrix,Uy),b=A.inverse(M,Uy),Z=A.multiply(w,b,Uy),E=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Z_e),X=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,G_e);for(let Y=0;Y<8;++Y){let k=se.clone(dp[Y],O8[Y]);A.multiplyByVector(Z,k,k),m.divideByScalar(k,k.w,k),m.minimumByComponent(k,E,E),m.maximumByComponent(k,X,X)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,X.x=Math.min(X.x,1),X.y=Math.min(X.y,1),X.z=Math.min(X.z,1);let F=e._passes[a],N=F.camera;N.clone(n);let O=N.frustum;O.left=x+E.x*(_-x),O.right=x+X.x*(_-x),O.bottom=C+E.y*(V-C),O.top=C+X.y*(V-C),O.near=L+E.z*(R-L),O.far=L+X.z*(R-L),F.cullingVolume=N.frustum.computeCullingVolume(G,I,v);let U=e._cascadeMatrices[a];A.multiply(N.getViewProjection(),i.inverseViewMatrix,U),A.multiply(F.textureOffsets,U,U)}}var apt=new A,cpt=new m,lpt=new m,C_e=new m;function dpt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=A.multiply(i.frustum.projectionMatrix,i.viewMatrix,Uy),r=A.inverse(o,Uy),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,cpt);a=m.cross(c,s,lpt),m.normalize(a,a),m.normalize(c,c);let d=m.fromElements(0,0,0,C_e),u=A.computeView(d,s,a,c,apt),h=A.multiply(u,r,Uy),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Z_e),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,G_e);for(let R=0;R<8;++R){let G=se.clone(dp[R],O8[R]);A.multiplyByVector(h,G,G),m.divideByScalar(G,G.w,G),m.minimumByComponent(G,p,p),m.maximumByComponent(G,g,g)}g.z+=1e3,p.z-=10;let f=C_e;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let x=A.fromTranslation(f,Uy);u=A.multiply(x,u,u);let _=.5*(g.x-p.x),C=.5*(g.y-p.y),V=g.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,A.clone(u,n.viewMatrix),A.inverse(u,n.inverseViewMatrix),A.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var upt=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],mpt=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],hpt=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function fpt(e,t){let n=new Vi;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=upt[i],o.upWC=mpt[i],o.rightWC=hpt[i],A.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),A.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var ppt=new m,bpt=new m,E_e=new le,V_e=E_e.center;function gpt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=E_e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,ppt),s=m.negate(i.directionWC,bpt),a=m.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Ht.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,V_e),V_e);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Ht.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function ypt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;A.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),A.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,gpt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}lp.prototype.update=function(e){if(ypt(this,e),this._needsUpdate)if(zft(this,e.context),this._isPointLight&&fpt(this,e),this._cascadesEnabled&&(dpt(this,e),this._numberOfCascades>1&&spt(this,e)),this._isPointLight)this._shadowMapCullingVolume=hs.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;A.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&tpt(this,e)};lp.prototype.updatePass=function(e,t){R_e(this,e,t)};var xpt=new D;function I_e(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=xpt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return St(t,o,!1)}function _pt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=$e.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ee.GLOBE,h=n.pass!==Ee.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=cp.getShadowCastShaderKeyword(p,u,g,h);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let _=d.vertexShaderSource,C=d.fragmentShaderSource,V=cp.createShadowCastVertexShader(_,p,u),L=cp.createShadowCastFragmentShader(C,p,g,h);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=I_e(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}lp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ee.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=$e.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||f||n||g){let x=cp.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(h=i.shaderCache.getDerivedShaderProgram(s,x),!l(h)){let _=cp.createShadowReceiveVertexShader(a,d,u),C=cp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);h=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=I_e(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};lp.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=_pt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){B8(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return me(this)};var C0=lp;var PDi=T(S(),1);var dDi=T(S(),1),QF=`uniform sampler2D u_opaqueDepthTexture;
uniform sampler2D u_translucentDepthTexture;

in vec2 v_textureCoordinates;

void main()
{
    float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
    float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
    translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
    out_FragColor = czm_packDepth(translucentDepth);
}
`;var mDi=T(S(),1),rS=`uniform sampler2D colorTexture;

#ifdef DEBUG_SHOW_DEPTH
uniform sampler2D u_packedTranslucentDepth;
#endif

in vec2 v_textureCoordinates;

void main()
{
#ifdef DEBUG_SHOW_DEPTH
    if (v_textureCoordinates.x < 0.5)
    {
        out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
        out_FragColor.a = 1.0;
    }
#else
    vec4 color = texture(colorTexture, v_textureCoordinates);

#ifdef PICK
    if (color == vec4(0.0))
    {
        discard;
    }
#else
    // Reverse premultiplication process to get the correct composited result of the classification primitives
    color.rgb /= color.a;
#endif
    out_FragColor = color;
#endif
}
`;var Tpt=!1;function Dy(e){this._drawClassificationFBO=new fi({createDepthAttachments:!1}),this._accumulationFBO=new fi({createDepthAttachments:!1}),this._packFBO=new fi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ti({color:new B(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Dy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function X_e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function W_e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Spt(e,t,n,i){X_e(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:it.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:qt.NEAREST})}function Cpt(e,t,n,i){W_e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Vpt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(Spt(e,t,o,r),Cpt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new De({sources:[QF]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new De({sources:[rS]}),a={colorTexture:function(){return e._textureToComposite}},Tpt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,h=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new De({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=$e.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new De({sources:[rS]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new De({sources:[rS]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Ke.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Bn.EQUAL,reference:Ut.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Dy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Vpt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Dy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Dy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Lpt(this,e,t)};function Lpt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Dy.prototype.isSupported=function(){return this._supported};Dy.prototype.isDestroyed=function(){return!1};Dy.prototype.destroy=function(){return X_e(this),W_e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),me(this)};var jF=Dy;function Rpt(){this.command=void 0,this.near=void 0,this.far=void 0}function PB(e,t,n){let i=e.context,o;i.depthTexture&&(o=new DF);let r;e._useOIT&&i.depthTexture&&(r=new YF(i));let s=new oc(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=ro.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new JF(i),this.pickDepthFramebuffer=new zF,this.sceneFramebuffer=new iS,this.globeDepth=o,this.globeTranslucencyFramebuffer=new BF,this.oit=r,this.translucentTileClassification=new jF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Y8=new m,H8=new m;function Zpt(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,Y8)),m.maximumComponent(m.abs(t.position,H8))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,Y8),m.multiplyByScalar(t.position,o,H8),m.equalsEpsilon(Y8,H8,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&A.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}PB.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Zpt(t,n,W.EPSILON15)?(this._cameraStartFired&&xi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xi(),ro.clone(t,n),!0)};function Gpt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,d=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=u;for(let p=0;p<u;++p){let g,f;c?(g=Math.min(i-d,n+p*d),f=Math.min(i,g+d)):(g=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*g));let x=h[p];l(x)?(x.near=g,x.far=f):x=h[p]=new UF(g,f)}}function Ept(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var P_e=new hs,Ipt=new Ga;PB.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let w=0;w<u.length;++w)for(let M=0;M<Ee.NUMBER_OF_PASSES;++M)u[w].indices[M]=0;c.length=0,d.length=0;let h=this._commandExtents,p=h.length,g=0,f=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:_}=o,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,R=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:G}=t,I=P_e.planes;for(let w=0;w<5;++w)I[w]=G.planes[w];G=P_e;for(let w=0;w<i.length;++w){let M=i[w],{pass:b,boundingVolume:Z}=M;if(b===Ee.COMPUTE)c.push(M);else if(b===Ee.OVERLAY)d.push(M);else{let E,X;if(l(Z)){if(!e.isVisible(G,M,R))continue;let N=Z.computePlaneDistances(r,s,Ipt);if(E=N.start,X=N.stop,f=Math.min(f,E),x=Math.max(x,X),_&&M.receiveShadows&&E<C0.MAXIMUM_DISTANCE&&!(b===Ee.GLOBE&&E<-100&&X>100)){let O=X-E;b!==Ee.GLOBE&&E<100&&(L=Math.min(L,O)),C=Math.min(C,E),V=Math.max(V,X)}}else M instanceof ti?(E=a.near,X=a.far):(E=a.near,X=a.far,f=Math.min(f,E),x=Math.max(x,X));let F=h[g];l(F)||(F=h[g]=new Rpt),F.command=M,F.near=E,F.far=X,g++}}_&&(C=Math.min(Math.max(C,a.near),a.far),V=Math.max(Math.min(V,a.far),C),o.nearPlane=C,o.farPlane=V,o.closestObjectSize=L),Gpt(this,e,f,x);for(let w=0;w<g;w++)Ept(this,e,h[w]);if(g<p)for(let w=g;w<p;w++){let M=h[w];if(!l(M.command))break;M.command=void 0}let v=u.length,{frustumSplits:P}=t;P.length=v+1;for(let w=0;w<v;++w)P[w]=u[w].near,w===v-1&&(P[w+1]=u[w].far)};PB.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var sS=PB;var w_e=.1,Xpt=new bm({pass:wo.MOST_DETAILED_PRELOAD}),Wpt=new bm({pass:wo.MOST_DETAILED_PICK}),qF=new bm({pass:wo.PICK});function na(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new ro(e);n.frustum=new an({width:w_e,aspectRatio:1,near:.1}),this._pickOffscreenView=new sS(e,n,t)}na.prototype.update=function(){this._pickPositionCacheDirty=!0};na.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new kF,n[t]=i),i};var Ppt=new Pr,vpt=new m,vB=new m,wpt=new D,Fpt=new A;function Apt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=A.clone(r.transform,Fpt);r._setTransform(A.IDENTITY);let h=m.clone(r.position,vpt);m.multiplyByScalar(r.right,c,vB),m.add(vB,h,h),m.multiplyByScalar(r.up,d,vB),m.add(vB,h,h),r._setTransform(u),e.mode===oe.SCENE2D&&m.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,wpt),g=Ppt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var Mpt=new Jc,Npt=new D;function kpt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,g=h*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,Npt),x=f.x*n*.5,_=f.y*i*.5,C=Mpt;return C.top=g+_,C.bottom=g-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function wB(e,t,n,i,o){let r=e.camera.frustum;return r instanceof an||r instanceof Pr?Apt(e,t,n,i,o):kpt(e,t,n,i,o)}var FB=new Ke(0,0,3,3),AB=new D,$F=new B(0,0,0,0);function z8(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}na.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=Ke.clone(a,d.viewport);let u=Di.transformWindowToDrawingBuffer(e,t,AB),h=z8(o.drawingBufferHeight,u,n,i,FB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=wB(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=qF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,$F),e.resolveFramebuffers(d);let p=c.end(h);return o.endFrame(),p};na.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=Ke.clone(a,d.viewport);let u=Di.transformWindowToDrawingBuffer(e,t,AB),h=z8(o.drawingBufferHeight,u,n,i,FB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=wB(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=qF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,$F),e.resolveFramebuffers(d);let p=c.readCenterPixel(h);return o.endFrame(),p};na.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=Ke.clone(s,c.viewport);let d=Di.transformWindowToDrawingBuffer(e,t,AB),u=z8(i.drawingBufferHeight,d,1,1,FB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=wB(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=qF,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,$F);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,NF.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Upt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Ke.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=wB(e,t,1,1,s),o.tilesetPassState=qF,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,$F),e.resolveFramebuffers(c),i.endFrame()}var Dpt=new Vi,Bpt=new Jc,Opt=new an,Ypt=new Pr;na.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=Di.transformWindowToDrawingBuffer(e,t,AB);e.pickTranslucentDepth?Upt(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(Dpt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(Bpt):l(s.frustum.width)?u=s.frustum.clone(Opt):u=s.frustum.clone(Ypt);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(x)&&x>0&&x<1){let _=h[g],C;return e.mode===oe.SCENE2D?(C=s.position.z,s.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=Di.drawingBufferToWorldCoordinates(e,d,x,n),e.mode===oe.SCENE2D&&(s.position.z=C,c.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Hpt=new he;na.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Hpt);o.cartographicToCartesian(r,n)}return n};function F_e(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let d=c.object,u=c.position,h=c.exclude;if(l(u)&&!l(d)){o.push(c);break}if(!l(d)||!l(d.primitive)||!h&&(o.push(c),0>=--e))break;let p=d.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(g=!0,i.show=_n.toValue(!1,i.show),s.push(i))),d instanceof Os&&(g=!0,d.show=!1,a.push(d)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=_n.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}na.prototype.drillPick=function(e,t,n,i,o){let r=this;return F_e(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var v_e=new m,zpt=new m;function Kpt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function A_e(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,v_e),s=m.cross(o,r,v_e),a=m.cross(o,s,zpt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,w_e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Jpt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=A_e(e,o,r,a),d=Xpt;d.camera=a,d.cullingVolume=c;let u=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}na.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Jpt(this,e,t[n])&&t.splice(n--,1)};function M_e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof ul&&M_e(o,t,n))}}function MB(e,t,n,i,o,r){let s=[];if(M_e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Kpt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Qpt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function jpt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,A_e(e,n,o,u.camera);let h=Ke.clone(u.viewport,FB),p=u.pickFramebuffer.begin(h,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Wpt:c.tilesetPassState=qF,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,$F),t.resolveFramebuffers(p);let g,f=u.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:x}=u,_=x.length;for(let C=0;C<_;++C){let L=e.getPickDepth(t,C).getDepth(a,0,0);if(l(L)&&L>0&&L<1){let R=x[C],G=R.near*(C!==0?t.opaqueFrustumNearOffset:1),I=R.far,v=G+L*(I-G);g=pn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(g))return{object:f,position:g,exclude:!l(g)&&r||Qpt(f,i)}}function N_e(e,t,n,i,o,r,s,a){return F_e(i,function(){return jpt(e,t,n,o,r,s,a)})}function xL(e,t,n,i,o,r,s){let a=N_e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function k_e(e,t,n,i,o,r,s,a){return N_e(e,t,n,i,o,r,s,a)}function NB(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}na.prototype.pickFromRay=function(e,t,n,i){return xL(this,e,t,n,i,!1,!1)};na.prototype.drillPickFromRay=function(e,t,n,i,o){return k_e(this,e,t,n,i,o,!1,!1)};na.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=pn.clone(t),n=l(n)?n.slice():n,NB(e,MB(o,e,t,n,i,function(){return xL(o,e,t,n,i,!1,!0)}))};na.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=pn.clone(t),i=l(i)?i.slice():i,NB(e,MB(r,e,t,i,o,function(){return k_e(r,e,t,n,i,o,!1,!0)}))};var qpt=new m,$pt=new m,ebt=new pn,U_e=new he;function K8(e,t){let n=e.ellipsoid,i=di._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,$pt),r=he.toCartesian(t,n,qpt),s=ebt;s.origin=r,s.direction=o;let a=new pn;return pn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function D_e(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,U_e);return K8(e,i)}function B_e(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,U_e).height}function tbt(e,t,n,i,o){let r=K8(t,n);return MB(e,t,r,i,o,function(){let s=xL(e,t,r,i,o,!0,!0);if(l(s))return B_e(t,s.position)})}function nbt(e,t,n,i,o,r){let s=D_e(t,n);return MB(e,t,s,i,o,function(){let a=xL(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}na.prototype.sampleHeight=function(e,t,n,i){let o=K8(e,t),r=xL(this,e,o,n,i,!0,!1);if(l(r))return B_e(e,r.position)};na.prototype.clampToHeight=function(e,t,n,i,o){let r=D_e(e,t),s=xL(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};na.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=tbt(this,e,t[s],n,i);return NB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};na.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=nbt(this,e,t[s],n,i,t[s]);return NB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};na.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var eA=na;var iYi=T(S(),1);var X3i=T(S(),1);var WBi=T(S(),1),tA=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#else
    color *= vec3(exposure);
#endif
    color = czm_acesTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var vBi=T(S(),1),nA=`precision highp float;

uniform sampler2D randomTexture;
uniform sampler2D depthTexture;
uniform float intensity;
uniform float bias;
uniform float lengthCap;
uniform int stepCount;
uniform int directionCount;

vec4 pixelToEye(vec2 screenCoordinate)
{
    vec2 uv = screenCoordinate / czm_viewport.zw;
    float depth = czm_readDepth(depthTexture, uv);
    vec2 xy = 2.0 * uv - vec2(1.0);
    vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
    posEC = posEC / posEC.w;
    // Avoid numerical error at far plane
    if (depth >= 1.0) {
        posEC.z = czm_currentFrustum.y;
    }
    return posEC;
}

// Reconstruct surface normal in eye coordinates, avoiding edges
vec3 getNormalXEdge(vec3 positionEC)
{
    // Find the 3D surface positions at adjacent screen pixels
    vec2 centerCoord = gl_FragCoord.xy;
    vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0)).xyz;
    vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0)).xyz;
    vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0)).xyz;
    vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0)).xyz;

    // Compute potential tangent vectors
    vec3 dx0 = positionEC - positionLeft;
    vec3 dx1 = positionRight - positionEC;
    vec3 dy0 = positionEC - positionDown;
    vec3 dy1 = positionUp - positionEC;

    // The shorter tangent is more likely to be on the same surface
    vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
    vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;

    return normalize(cross(dx, dy));
}

const float sqrtTwoPi = sqrt(czm_twoPi);

float gaussian(float x, float standardDeviation) {
    float argument = x / standardDeviation;
    return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation);
}

void main(void)
{
    vec4 positionEC = pixelToEye(gl_FragCoord.xy);

    // Exit if we are too close to the back of the frustum, where the depth value is invalid.
    float maxValidDepth = czm_currentFrustum.y - lengthCap;
    if (-positionEC.z > maxValidDepth)
    {
        out_FragColor = vec4(1.0);
        return;
    }

    vec3 normalEC = getNormalXEdge(positionEC.xyz);
    float gaussianVariance = lengthCap * sqrt(-positionEC.z);
    // Choose a step length such that the marching stops just before 3 * variance.
    float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
    float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
    // Minimum step is 1 pixel to avoid double sampling
    float pixelsPerStep = max(stepLength / metersPerPixel, 1.0);
    stepLength = pixelsPerStep * metersPerPixel;

    float angleStepScale = 1.0 / float(directionCount);
    float angleStep = angleStepScale * czm_twoPi;
    float cosStep = cos(angleStep);
    float sinStep = sin(angleStep);
    mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);

    // Initial sampling direction (different for each pixel)
    const float randomTextureSize = 255.0;
    vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
    float randomVal = texture(randomTexture, randomTexCoord).x;
    vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));

    float ao = 0.0;
    // Loop over sampling directions
#if __VERSION__ == 300
    for (int i = 0; i < directionCount; i++)
    {
#else
    for (int i = 0; i < 16; i++)
    {
        if (i >= directionCount) {
            break;
        }
#endif
        sampleDirection = rotateStep * sampleDirection;

        float localAO = 0.0;
        vec2 radialStep = pixelsPerStep * sampleDirection;

#if __VERSION__ == 300
        for (int j = 0; j < stepCount; j++)
        {
#else
        for (int j = 0; j < 64; j++)
        {
            if (j >= stepCount) {
                break;
            }
#endif
            // Step along sampling direction, away from output pixel
            vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);

            // Exit if we stepped off the screen
            if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
                break;
            }

            // Compute step vector from output point to sampled point
            vec4 samplePositionEC = pixelToEye(samplePixel);
            vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;

            // Estimate the angle from the surface normal.
            float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
            dotVal = czm_branchFreeTernary(dotVal > bias, dotVal, 0.0);
            dotVal = czm_branchFreeTernary(-samplePositionEC.z <= maxValidDepth, dotVal, 0.0);

            // Weight contribution based on the distance from the output point
            float sampleDistance = length(stepVector);
            float weight = gaussian(sampleDistance, gaussianVariance);
            localAO += weight * dotVal;
        }
        ao += localAO;
    }

    ao *= angleStepScale * stepLength;
    ao = 1.0 - clamp(ao, 0.0, 1.0);
    ao = pow(ao, intensity);
    out_FragColor = vec4(vec3(ao), 1.0);
}
`;var FBi=T(S(),1),iA=`uniform sampler2D colorTexture;
uniform sampler2D ambientOcclusionTexture;
uniform bool ambientOcclusionOnly;
in vec2 v_textureCoordinates;

void main(void)
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
    out_FragColor = ambientOcclusionOnly ? ao : ao * color;
}
`;var MBi=T(S(),1),oA=`uniform sampler2D colorTexture;
uniform float gradations;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
#ifdef CZM_SELECTED_FEATURE
    if (czm_selected()) {
        out_FragColor = vec4(rgb, 1.0);
        return;
    }
#endif
    float luminance = czm_luminance(rgb);
    float darkness = luminance * gradations;
    darkness = (darkness - fract(darkness)) / gradations;
    out_FragColor = vec4(vec3(darkness), 1.0);
}
`;var kBi=T(S(),1),rA=`uniform sampler2D colorTexture;
uniform sampler2D bloomTexture;
uniform bool glowOnly;

in vec2 v_textureCoordinates;

void main(void)
{
    vec4 color = texture(colorTexture, v_textureCoordinates);

#ifdef CZM_SELECTED_FEATURE
    if (czm_selected()) {
        out_FragColor = color;
        return;
    }
#endif

    vec4 bloom = texture(bloomTexture, v_textureCoordinates);
    out_FragColor = glowOnly ? bloom : bloom + color;
}
`;var DBi=T(S(),1),sA=`uniform sampler2D colorTexture;
uniform float brightness;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
    vec3 target = vec3(0.0);
    out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
}
`;var OBi=T(S(),1),aA=`uniform sampler2D colorTexture;
uniform float contrast;
uniform float brightness;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
    sceneColor = czm_RGBToHSB(sceneColor);
    sceneColor.z += brightness;
    sceneColor = czm_HSBToRGB(sceneColor);

    float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
    sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
    out_FragColor = vec4(sceneColor, 1.0);
}
`;var HBi=T(S(),1),cA=`uniform sampler2D colorTexture;
uniform sampler2D blurTexture;
uniform sampler2D depthTexture;
uniform float focalDistance;

in vec2 v_textureCoordinates;

vec4 toEye(vec2 uv, float depth)
{
   vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
   vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
   posInCamera = posInCamera / posInCamera.w;
   return posInCamera;
}

float computeDepthBlur(float depth)
{
    float f;
    if (depth < focalDistance)
    {
        f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
    }
    else
    {
        f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
        f = pow(f, 0.1);
    }
    f *= f;
    f = clamp(f, 0.0, 1.0);
    return pow(f, 0.5);
}

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    vec4 posInCamera = toEye(v_textureCoordinates, depth);
    float d = computeDepthBlur(-posInCamera.z);
    out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
}
`;var KBi=T(S(),1),lA=`uniform sampler2D depthTexture;

in vec2 v_textureCoordinates;

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    out_FragColor = vec4(vec3(depth), 1.0);
}
`;var QBi=T(S(),1),dA=`uniform sampler2D depthTexture;
uniform float length;
uniform vec4 color;

in vec2 v_textureCoordinates;

void main(void)
{
    float directions[3];
    directions[0] = -1.0;
    directions[1] = 0.0;
    directions[2] = 1.0;

    float scalars[3];
    scalars[0] = 3.0;
    scalars[1] = 10.0;
    scalars[2] = 3.0;

    float padx = czm_pixelRatio / czm_viewport.z;
    float pady = czm_pixelRatio / czm_viewport.w;

#ifdef CZM_SELECTED_FEATURE
    bool selected = false;
    for (int i = 0; i < 3; ++i)
    {
        float dir = directions[i];
        selected = selected || czm_selected(vec2(-padx, dir * pady));
        selected = selected || czm_selected(vec2(padx, dir * pady));
        selected = selected || czm_selected(vec2(dir * padx, -pady));
        selected = selected || czm_selected(vec2(dir * padx, pady));
        if (selected)
        {
            break;
        }
    }
    if (!selected)
    {
        out_FragColor = vec4(color.rgb, 0.0);
        return;
    }
#endif

    float horizEdge = 0.0;
    float vertEdge = 0.0;

    for (int i = 0; i < 3; ++i)
    {
        float dir = directions[i];
        float scale = scalars[i];

        horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
        horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;

        vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
        vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
    }

    float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
    out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
}
`;var qBi=T(S(),1),uA=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

// See slides 142 and 143:
//     http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#else
    color *= vec3(exposure);
#endif

	const float A = 0.22; // shoulder strength
	const float B = 0.30; // linear strength
	const float C = 0.10; // linear angle
	const float D = 0.20; // toe strength
	const float E = 0.01; // toe numerator
	const float F = 0.30; // toe denominator

	const float white = 11.2; // linear white point value

	vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
	float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;

	c = czm_inverseGamma(c / w);
	out_FragColor = vec4(c, fragmentColor.a);
}
`;var eOi=T(S(),1),mA=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#else
    color *= vec3(exposure);
#endif
    color = czm_pbrNeutralTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var nOi=T(S(),1),hA=`in vec2 v_textureCoordinates;

uniform sampler2D colorTexture;

const float fxaaQualitySubpix = 0.5;
const float fxaaQualityEdgeThreshold = 0.125;
const float fxaaQualityEdgeThresholdMin = 0.0833;

void main()
{
    vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
    vec4 color = FxaaPixelShader(
        v_textureCoordinates,
        colorTexture,
        fxaaQualityRcpFrame,
        fxaaQualitySubpix,
        fxaaQualityEdgeThreshold,
        fxaaQualityEdgeThresholdMin);
    float alpha = texture(colorTexture, v_textureCoordinates).a;
    out_FragColor = vec4(color.rgb, alpha);
}
`;var oOi=T(S(),1),By=`#define SAMPLES 8

uniform float delta;
uniform float sigma;
uniform float direction; // 0.0 for x direction, 1.0 for y direction

uniform sampler2D colorTexture;

#ifdef USE_STEP_SIZE
uniform float stepSize;
#else
uniform vec2 step;
#endif

in vec2 v_textureCoordinates;

//  Incremental Computation of the Gaussian:
//  https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html

void main()
{
    vec2 st = v_textureCoordinates;
    vec2 dir = vec2(1.0 - direction, direction);

#ifdef USE_STEP_SIZE
    vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
#else
    vec2 step = step;
#endif

    vec3 g;
    g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
    g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
    g.z = g.y * g.y;

    vec4 result = texture(colorTexture, st) * g.x;
    for (int i = 1; i < SAMPLES; ++i)
    {
        g.xy *= g.yz;

        vec2 offset = float(i) * dir * step;
        result += texture(colorTexture, st - offset) * g.x;
        result += texture(colorTexture, st + offset) * g.x;
    }

    out_FragColor = result;
}
`;var sOi=T(S(),1),fA=`uniform sampler2D colorTexture;
uniform sampler2D dirtTexture;
uniform sampler2D starTexture;
uniform vec2 dirtTextureDimensions;
uniform float distortion;
uniform float ghostDispersal;
uniform float haloWidth;
uniform float dirtAmount;
uniform float earthRadius;
uniform float intensity;

in vec2 v_textureCoordinates;

// whether it is in space or not
// 6500000.0 is empirical value
#define DISTANCE_TO_SPACE 6500000.0

// return ndc from world coordinate biased earthRadius
vec4 getNDCFromWC(vec3 WC, float earthRadius)
{
    vec4 positionEC = czm_view * vec4(WC, 1.0);
    positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
    return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
}

// Check if current pixel is included Earth
// if then mask it gradually
float isInEarth(vec2 texcoord, vec2 sceneSize)
{
    vec2 NDC = texcoord * 2.0 - 1.0;
    vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
    vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
    NDC.xy -= earthPosSC.xy;

    float X = abs(NDC.x) * sceneSize.x;
    float Y = abs(NDC.y) * sceneSize.y;

    return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
}

// For Chromatic effect
vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
{
    vec2 sceneSize = czm_viewport.zw;
    vec3 color;
    if(isSpace)
    {
        color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
        color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
        color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
    }
    else
    {
        color.r = texture(tex, texcoord + direction * distortion.r).r;
        color.g = texture(tex, texcoord + direction * distortion.g).g;
        color.b = texture(tex, texcoord + direction * distortion.b).b;
    }
    return vec4(clamp(color, 0.0, 1.0), 0.0);
}

void main(void)
{
    vec4 originalColor = texture(colorTexture, v_textureCoordinates);
    vec3 rgb = originalColor.rgb;
    bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;

    // Sun position
    vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
    vec4 sunPositionEC = czm_view * sunPos;
    vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
    sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);

    // If sun is not in the screen space, use original color.
    if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
    {
        // Lens flare is disabled when not in space until #5932 is fixed.
        //    https://github.com/CesiumGS/cesium/issues/5932
        out_FragColor = originalColor;
        return;
    }

    vec2 texcoord = vec2(1.0) - v_textureCoordinates;
    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
    vec2 invPixelSize = 1.0 / pixelSize;
    vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);

    // ghost vector to image centre:
    vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
    vec3 direction = normalize(vec3(ghostVec, 0.0));

    // sample ghosts:
    vec4 result = vec4(0.0);
    vec4 ghost = vec4(0.0);
    for (int i = 0; i < 4; ++i)
    {
        vec2 offset = fract(texcoord + ghostVec * float(i));
        // Only bright spots from the centre of the source image
        ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
    }
    result += ghost;

    // sample halo
    vec2 haloVec = normalize(ghostVec) * haloWidth;
    float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
    weightForHalo = pow(1.0 - weightForHalo, 5.0);

    result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;

    // dirt on lens
    vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
    if (dirtTexCoords.x > 1.0)
    {
        dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) :  fract(dirtTexCoords.x);
    }
    if (dirtTexCoords.y > 1.0)
    {
        dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) :  fract(dirtTexCoords.y);
    }
    result += dirtAmount * texture(dirtTexture, dirtTexCoords);

    // Rotating starburst texture's coordinate
    // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
    float camrot = czm_view[0].z + czm_view[1].y;
    float cosValue = cos(camrot);
    float sinValue = sin(camrot);
    mat3 rotation = mat3(
        cosValue, -sinValue, 0.0,
        sinValue, cosValue, 0.0,
        0.0, 0.0, 1.0
    );

    vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
    vec3 st2 = vec3((rotation * st1).xy, 1.0);
    vec3 st3 = st2 * 0.5 + vec3(0.5);
    vec2 lensStarTexcoord = st3.xy;
    float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
    float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);

    if (!isSpace)
    {
        result *= oneMinusWeightForLensFlare * intensity * 0.2;
    }
    else
    {
        result *= oneMinusWeightForLensFlare * intensity;
        result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
    }

    result += texture(colorTexture, v_textureCoordinates);

    out_FragColor = result;
}
`;var cOi=T(S(),1),pA=`uniform sampler2D colorTexture;
uniform vec3 white;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

// See equation 4:
//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#else
    color *= vec3(exposure);
#endif
    color = (color * (1.0 + color / white)) / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var dOi=T(S(),1),bA=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

float rand(vec2 co)
{
    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
}

void main(void)
{
    float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
    vec3 green = vec3(0.0, 1.0, 0.0);
    out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
}
`;var mOi=T(S(),1),gA=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

// See equation 3:
//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#else
    color *= vec3(exposure);
#endif
    color = color / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var fOi=T(S(),1),yA=`uniform sampler2D colorTexture;
uniform sampler2D silhouetteTexture;

in vec2 v_textureCoordinates;

void main(void)
{
    vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
    vec4 color = texture(colorTexture, v_textureCoordinates);
    out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
}
`;var bOi=T(S(),1);/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */var xA=`/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h

// Steps used to integrate into Cesium:
// * The following defines are set:
//       #define FXAA_PC 1
//       #define FXAA_WEBGL_1 1
//       #define FXAA_GREEN_AS_LUMA 1
//       #define FXAA_EARLY_EXIT 1
//       #define FXAA_GLSL_120 1
// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
//   /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
// * There are no implicit conversions from ivec* to vec* so replace:
//       #define FxaaInt2 ivec2
//           with
//       #define FxaaInt2 vec2
// * The texture2DLod function is only available in vertex shaders so replace:
//       #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
//       #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
//           with
//       #define FxaaTexTop(t, p) texture(t, p)
//       #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
// * The following parameters to FxaaPixelShader are unused and can be removed:
//       fxaaConsolePosPos
//       fxaaConsoleRcpFrameOpt
//       fxaaConsoleRcpFrameOpt2
//       fxaaConsole360RcpFrameOpt2
//       fxaaConsoleEdgeSharpness
//       fxaaConsoleEdgeThreshold
//       fxaaConsoleEdgeThresholdMi
//       fxaaConsole360ConstDir

//
// Choose the quality preset.
// This needs to be compiled into the shader as it effects code.
// Best option to include multiple presets is to
// in each shader define the preset, then include this file.
//
// OPTIONS
// -----------------------------------------------------------------------
// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
// 39       - no dither, very expensive
//
// NOTES
// -----------------------------------------------------------------------
// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
// 13 = about same speed as FXAA 3.9 and better than 12
// 23 = closest to FXAA 3.9 visually and performance wise
//  _ = the lowest digit is directly related to performance
// _  = the highest digit is directly related to style
//
//#define FXAA_QUALITY_PRESET 12


#if (FXAA_QUALITY_PRESET == 10)
    #define FXAA_QUALITY_PS 3
    #define FXAA_QUALITY_P0 1.5
    #define FXAA_QUALITY_P1 3.0
    #define FXAA_QUALITY_P2 12.0
#endif
#if (FXAA_QUALITY_PRESET == 11)
    #define FXAA_QUALITY_PS 4
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 3.0
    #define FXAA_QUALITY_P3 12.0
#endif
#if (FXAA_QUALITY_PRESET == 12)
    #define FXAA_QUALITY_PS 5
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 4.0
    #define FXAA_QUALITY_P4 12.0
#endif
#if (FXAA_QUALITY_PRESET == 13)
    #define FXAA_QUALITY_PS 6
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 4.0
    #define FXAA_QUALITY_P5 12.0
#endif
#if (FXAA_QUALITY_PRESET == 14)
    #define FXAA_QUALITY_PS 7
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 4.0
    #define FXAA_QUALITY_P6 12.0
#endif
#if (FXAA_QUALITY_PRESET == 15)
    #define FXAA_QUALITY_PS 8
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 4.0
    #define FXAA_QUALITY_P7 12.0
#endif
#if (FXAA_QUALITY_PRESET == 20)
    #define FXAA_QUALITY_PS 3
    #define FXAA_QUALITY_P0 1.5
    #define FXAA_QUALITY_P1 2.0
    #define FXAA_QUALITY_P2 8.0
#endif
#if (FXAA_QUALITY_PRESET == 21)
    #define FXAA_QUALITY_PS 4
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 8.0
#endif
#if (FXAA_QUALITY_PRESET == 22)
    #define FXAA_QUALITY_PS 5
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 8.0
#endif
#if (FXAA_QUALITY_PRESET == 23)
    #define FXAA_QUALITY_PS 6
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 8.0
#endif
#if (FXAA_QUALITY_PRESET == 24)
    #define FXAA_QUALITY_PS 7
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 3.0
    #define FXAA_QUALITY_P6 8.0
#endif
#if (FXAA_QUALITY_PRESET == 25)
    #define FXAA_QUALITY_PS 8
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 4.0
    #define FXAA_QUALITY_P7 8.0
#endif
#if (FXAA_QUALITY_PRESET == 26)
    #define FXAA_QUALITY_PS 9
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 4.0
    #define FXAA_QUALITY_P8 8.0
#endif
#if (FXAA_QUALITY_PRESET == 27)
    #define FXAA_QUALITY_PS 10
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 4.0
    #define FXAA_QUALITY_P9 8.0
#endif
#if (FXAA_QUALITY_PRESET == 28)
    #define FXAA_QUALITY_PS 11
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 4.0
    #define FXAA_QUALITY_P10 8.0
#endif
#if (FXAA_QUALITY_PRESET == 29)
    #define FXAA_QUALITY_PS 12
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 2.0
    #define FXAA_QUALITY_P10 4.0
    #define FXAA_QUALITY_P11 8.0
#endif
#if (FXAA_QUALITY_PRESET == 39)
    #define FXAA_QUALITY_PS 12
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.0
    #define FXAA_QUALITY_P2 1.0
    #define FXAA_QUALITY_P3 1.0
    #define FXAA_QUALITY_P4 1.0
    #define FXAA_QUALITY_P5 1.5
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 2.0
    #define FXAA_QUALITY_P10 4.0
    #define FXAA_QUALITY_P11 8.0
#endif

#define FxaaBool bool
#define FxaaFloat float
#define FxaaFloat2 vec2
#define FxaaFloat3 vec3
#define FxaaFloat4 vec4
#define FxaaHalf float
#define FxaaHalf2 vec2
#define FxaaHalf3 vec3
#define FxaaHalf4 vec4
#define FxaaInt2 vec2
#define FxaaTex sampler2D

#define FxaaSat(x) clamp(x, 0.0, 1.0)
#define FxaaTexTop(t, p) texture(t, p)
#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))

FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }

FxaaFloat4 FxaaPixelShader(
    //
    // Use noperspective interpolation here (turn off perspective interpolation).
    // {xy} = center of pixel
    FxaaFloat2 pos,
    //
    // Input color texture.
    // {rgb_} = color in linear or perceptual color space
    // if (FXAA_GREEN_AS_LUMA == 0)
    //     {___a} = luma in perceptual color space (not linear)
    FxaaTex tex,
    //
    // Only used on FXAA Quality.
    // This must be from a constant/uniform.
    // {x_} = 1.0/screenWidthInPixels
    // {_y} = 1.0/screenHeightInPixels
    FxaaFloat2 fxaaQualityRcpFrame,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_SUBPIX define.
    // It is here now to allow easier tuning.
    // Choose the amount of sub-pixel aliasing removal.
    // This can effect sharpness.
    //   1.00 - upper limit (softer)
    //   0.75 - default amount of filtering
    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
    //   0.25 - almost off
    //   0.00 - completely off
    FxaaFloat fxaaQualitySubpix,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
    // It is here now to allow easier tuning.
    // The minimum amount of local contrast required to apply algorithm.
    //   0.333 - too little (faster)
    //   0.250 - low quality
    //   0.166 - default
    //   0.125 - high quality
    //   0.063 - overkill (slower)
    FxaaFloat fxaaQualityEdgeThreshold,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
    // It is here now to allow easier tuning.
    // Trims the algorithm from processing darks.
    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
    //   0.0625 - high quality (faster)
    //   0.0312 - visible limit (slower)
    // Special notes when using FXAA_GREEN_AS_LUMA,
    //   Likely want to set this to zero.
    //   As colors that are mostly not-green
    //   will appear very dark in the green channel!
    //   Tune by looking at mostly non-green content,
    //   then start at zero and increase until aliasing is a problem.
    FxaaFloat fxaaQualityEdgeThresholdMin
) {
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posM;
    posM.x = pos.x;
    posM.y = pos.y;
    FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
    #define lumaM rgbyM.y
    FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
    FxaaFloat maxSM = max(lumaS, lumaM);
    FxaaFloat minSM = min(lumaS, lumaM);
    FxaaFloat maxESM = max(lumaE, maxSM);
    FxaaFloat minESM = min(lumaE, minSM);
    FxaaFloat maxWN = max(lumaN, lumaW);
    FxaaFloat minWN = min(lumaN, lumaW);
    FxaaFloat rangeMax = max(maxWN, maxESM);
    FxaaFloat rangeMin = min(minWN, minESM);
    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
    FxaaFloat range = rangeMax - rangeMin;
    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
    FxaaBool earlyExit = range < rangeMaxClamped;
/*--------------------------------------------------------------------------*/
    if(earlyExit)
        return rgbyM;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNS = lumaN + lumaS;
    FxaaFloat lumaWE = lumaW + lumaE;
    FxaaFloat subpixRcpRange = 1.0/range;
    FxaaFloat subpixNSWE = lumaNS + lumaWE;
    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNESE = lumaNE + lumaSE;
    FxaaFloat lumaNWNE = lumaNW + lumaNE;
    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNWSW = lumaNW + lumaSW;
    FxaaFloat lumaSWSE = lumaSW + lumaSE;
    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
/*--------------------------------------------------------------------------*/
    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
    FxaaBool horzSpan = edgeHorz >= edgeVert;
    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
/*--------------------------------------------------------------------------*/
    if(!horzSpan) lumaN = lumaW;
    if(!horzSpan) lumaS = lumaE;
    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
/*--------------------------------------------------------------------------*/
    FxaaFloat gradientN = lumaN - lumaM;
    FxaaFloat gradientS = lumaS - lumaM;
    FxaaFloat lumaNN = lumaN + lumaM;
    FxaaFloat lumaSS = lumaS + lumaM;
    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
    if(pairN) lengthSign = -lengthSign;
    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posB;
    posB.x = posM.x;
    posB.y = posM.y;
    FxaaFloat2 offNP;
    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
    if(!horzSpan) posB.x += lengthSign * 0.5;
    if( horzSpan) posB.y += lengthSign * 0.5;
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posN;
    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
    FxaaFloat2 posP;
    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
    FxaaFloat subpixE = subpixC * subpixC;
    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
/*--------------------------------------------------------------------------*/
    if(!pairN) lumaNN = lumaSS;
    FxaaFloat gradientScaled = gradient * 1.0/4.0;
    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
    FxaaFloat subpixF = subpixD * subpixE;
    FxaaBool lumaMLTZero = lumaMM < 0.0;
/*--------------------------------------------------------------------------*/
    lumaEndN -= lumaNN * 0.5;
    lumaEndP -= lumaNN * 0.5;
    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
    FxaaBool doneNP = (!doneN) || (!doneP);
    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
/*--------------------------------------------------------------------------*/
    if(doneNP) {
        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
        doneN = abs(lumaEndN) >= gradientScaled;
        doneP = abs(lumaEndP) >= gradientScaled;
        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
        doneNP = (!doneN) || (!doneP);
        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
/*--------------------------------------------------------------------------*/
        #if (FXAA_QUALITY_PS > 3)
        if(doneNP) {
            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
            doneN = abs(lumaEndN) >= gradientScaled;
            doneP = abs(lumaEndP) >= gradientScaled;
            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
            doneNP = (!doneN) || (!doneP);
            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
/*--------------------------------------------------------------------------*/
            #if (FXAA_QUALITY_PS > 4)
            if(doneNP) {
                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                doneN = abs(lumaEndN) >= gradientScaled;
                doneP = abs(lumaEndP) >= gradientScaled;
                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
                doneNP = (!doneN) || (!doneP);
                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
/*--------------------------------------------------------------------------*/
                #if (FXAA_QUALITY_PS > 5)
                if(doneNP) {
                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                    doneN = abs(lumaEndN) >= gradientScaled;
                    doneP = abs(lumaEndP) >= gradientScaled;
                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
                    doneNP = (!doneN) || (!doneP);
                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
/*--------------------------------------------------------------------------*/
                    #if (FXAA_QUALITY_PS > 6)
                    if(doneNP) {
                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                        doneN = abs(lumaEndN) >= gradientScaled;
                        doneP = abs(lumaEndP) >= gradientScaled;
                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
                        doneNP = (!doneN) || (!doneP);
                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
/*--------------------------------------------------------------------------*/
                        #if (FXAA_QUALITY_PS > 7)
                        if(doneNP) {
                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                            doneN = abs(lumaEndN) >= gradientScaled;
                            doneP = abs(lumaEndP) >= gradientScaled;
                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
                            doneNP = (!doneN) || (!doneP);
                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
/*--------------------------------------------------------------------------*/
    #if (FXAA_QUALITY_PS > 8)
    if(doneNP) {
        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
        doneN = abs(lumaEndN) >= gradientScaled;
        doneP = abs(lumaEndP) >= gradientScaled;
        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
        doneNP = (!doneN) || (!doneP);
        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
/*--------------------------------------------------------------------------*/
        #if (FXAA_QUALITY_PS > 9)
        if(doneNP) {
            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
            doneN = abs(lumaEndN) >= gradientScaled;
            doneP = abs(lumaEndP) >= gradientScaled;
            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
            doneNP = (!doneN) || (!doneP);
            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
/*--------------------------------------------------------------------------*/
            #if (FXAA_QUALITY_PS > 10)
            if(doneNP) {
                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                doneN = abs(lumaEndN) >= gradientScaled;
                doneP = abs(lumaEndP) >= gradientScaled;
                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
                doneNP = (!doneN) || (!doneP);
                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
/*--------------------------------------------------------------------------*/
                #if (FXAA_QUALITY_PS > 11)
                if(doneNP) {
                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                    doneN = abs(lumaEndN) >= gradientScaled;
                    doneP = abs(lumaEndP) >= gradientScaled;
                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
                    doneNP = (!doneN) || (!doneP);
                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
/*--------------------------------------------------------------------------*/
                    #if (FXAA_QUALITY_PS > 12)
                    if(doneNP) {
                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                        doneN = abs(lumaEndN) >= gradientScaled;
                        doneP = abs(lumaEndP) >= gradientScaled;
                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
                        doneNP = (!doneN) || (!doneP);
                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
/*--------------------------------------------------------------------------*/
                    }
                    #endif
/*--------------------------------------------------------------------------*/
                }
                #endif
/*--------------------------------------------------------------------------*/
            }
            #endif
/*--------------------------------------------------------------------------*/
        }
        #endif
/*--------------------------------------------------------------------------*/
    }
    #endif
/*--------------------------------------------------------------------------*/
                        }
                        #endif
/*--------------------------------------------------------------------------*/
                    }
                    #endif
/*--------------------------------------------------------------------------*/
                }
                #endif
/*--------------------------------------------------------------------------*/
            }
            #endif
/*--------------------------------------------------------------------------*/
        }
        #endif
/*--------------------------------------------------------------------------*/
    }
/*--------------------------------------------------------------------------*/
    FxaaFloat dstN = posM.x - posN.x;
    FxaaFloat dstP = posP.x - posM.x;
    if(!horzSpan) dstN = posM.y - posN.y;
    if(!horzSpan) dstP = posP.y - posM.y;
/*--------------------------------------------------------------------------*/
    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
    FxaaFloat spanLength = (dstP + dstN);
    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
    FxaaFloat spanLengthRcp = 1.0/spanLength;
/*--------------------------------------------------------------------------*/
    FxaaBool directionN = dstN < dstP;
    FxaaFloat dst = min(dstN, dstP);
    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
    FxaaFloat subpixG = subpixF * subpixF;
    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
/*--------------------------------------------------------------------------*/
    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
    return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
}
`;var LOi=T(S(),1);function aS(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new fi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(aS.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function O_e(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function ibt(e,t){O_e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new fi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Y_e(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function obt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function rbt(e,t){let n=`uniform sampler2D colorTexture; 
in vec2 v_textureCoordinates; 
float sampleTexture(vec2 offset) { 
`;return e===0?n+=`    vec4 color = texture(colorTexture, v_textureCoordinates + offset); 
    return czm_luminance(color.rgb); 
`:n+=`    return texture(colorTexture, v_textureCoordinates + offset).r; 
`,n+=`}

`,n+=`uniform vec2 colorTextureDimensions; 
uniform vec2 minMaxLuminance; 
uniform sampler2D previousLuminance; 
void main() { 
    float color = 0.0; 
    float xStep = 1.0 / colorTextureDimensions.x; 
    float yStep = 1.0 / colorTextureDimensions.y; 
    int count = 0; 
    for (int i = 0; i < 3; ++i) { 
        for (int j = 0; j < 3; ++j) { 
            vec2 offset; 
            offset.x = -xStep + float(i) * xStep; 
            offset.y = -yStep + float(j) * yStep; 
            if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { 
                continue; 
            } 
            color += sampleTexture(offset); 
            ++count; 
        } 
    } 
    if (count > 0) { 
        color /= float(count); 
    } 
`,e===t-1&&(n+=`    float previous = texture(previousLuminance, vec2(0.5)).r; 
    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); 
    color = previous + (color - previous) / (60.0 * 1.5); 
    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); 
`),n+=`    out_FragColor = vec4(color); 
} 
`,n}function sbt(e,t){Y_e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(rbt(r,i),{framebuffer:n[r].framebuffer,uniformMap:obt(e,r)});e._commands=o}aS.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ti({color:new B(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};aS.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,ibt(this,e),sbt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};aS.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};aS.prototype.isDestroyed=function(){return!1};aS.prototype.destroy=function(){return O_e(this),Y_e(this),me(this)};var _A=aS;var KOi=T(S(),1);var ZOi=T(S(),1),abt={NEAREST:0,LINEAR:1},ou=abt;function cS(e){e=y(e,y.EMPTY_OBJECT);let{name:t=Hn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=ou.NEAREST,pixelFormat:a=it.RGBA,pixelDatatype:c=je.UNSIGNED_BYTE,clearColor:d=B.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new oc;h.scissorTest={enabled:!0,rectangle:l(u)?Ke.clone(u):new Ke},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(cS.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var cbt=/uniform\s+sampler2D\s+depthTexture/g;cS.prototype._isSupported=function(e){return!cbt.test(this._fragmentShader)||e.depthTexture};function lbt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof vt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof vt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function dbt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function ubt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function mbt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=dbt(e,r),n[r]=lbt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof vt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=ubt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=St(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function hbt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE
uniform sampler2D czm_idTexture;
uniform sampler2D czm_selectedIdTexture;
uniform float czm_selectedIdTextureStep;
in vec2 v_textureCoordinates;
bool czm_selected(vec2 offset)
{
    bool selected = false;
    vec4 id = texture(czm_idTexture, v_textureCoordinates + offset);
    for (int i = 0; i < ${t}; ++i)
    {
        vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
        if (all(equal(id, selectedId)))
        {
            return true;
        }
    }
    return false;
}
bool czm_selected()
{
    return czm_selected(vec2(0.0));
}

${e}`}function fbt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=hbt(n,o)}let i=new De({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function pbt(e){let t=e._sampleMode,n,i;t===ou.LINEAR?(n=jt.LINEAR,i=hi.LINEAR):(n=jt.NEAREST,i=hi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function bbt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function gbt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ybt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new vt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=gbt(e,d);else if(typeof d=="string"){let h=new Ze({url:d});s.push(h.fetchImage().then(bbt(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function H_e(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof vt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function xbt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function _bt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new vt({context:t,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:qt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,d=c.length;for(let u=0;u<d;++u){let h=c[u].color;r[o]=B.floatToByte(h.red),r[o+1]=B.floatToByte(h.green),r[o+2]=B.floatToByte(h.blue),r[o+3]=B.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=B.floatToByte(c.red),r[o+1]=B.floatToByte(c.green),r[o+2]=B.floatToByte(c.blue),r[o+3]=B.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new vt({context:t,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:qt.NEAREST})}cS.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&H_e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=xbt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,_bt(this,e),mbt(this),ybt(this,e),fbt(this,e),pbt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ue.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};cS.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,qt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};cS.prototype.isDestroyed=function(){return!1};cS.prototype.destroy=function(){return H_e(this),me(this)};var ho=cS;var e3i=T(S(),1);function lS(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Hn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(lS.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});lS.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};lS.prototype.get=function(e){return this._stages[e]};function Tbt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}lS.prototype.update=function(e,t){this._selectedDirty=Tbt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};lS.prototype.isDestroyed=function(){return!1};lS.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var od=lS;var Zr={};function J8(e){let o=`#define USE_STEP_SIZE
${By}`,r=new ho({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ou.LINEAR}),s=new ho({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ou.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new od({name:e,stages:[r,s],uniforms:a})}Zr.createBlurStage=function(){return J8("czm_blur")};Zr.createDepthOfFieldStage=function(){let e=J8("czm_depth_of_field_blur"),t=new ho({name:"czm_depth_of_field_composite",fragmentShader:cA,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new od({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Zr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Zr.createEdgeDetectionStage=function(){let e=Hn();return new ho({name:`czm_edge_detection_${e}`,fragmentShader:dA,uniforms:{length:.25,color:B.clone(B.BLACK)}})};Zr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Sbt(e){if(!l(e))return Zr.createEdgeDetectionStage();let t=new od({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; 
`,o+=`        vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); 
        if (edge${a}.a > 0.0) 
        { 
            color = edge${a}; 
            break; 
        } 
`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates; 
void main() { 
    vec4 color = vec4(0.0); 
    for (int i = 0; i < ${e.length}; i++) 
    { 
${o}    } 
    out_FragColor = color; 
} 
`,s=new ho({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new od({name:"czm_edge_detection_composite",stages:[t,s]})}Zr.createSilhouetteStage=function(e){let t=Sbt(e),n=new ho({name:"czm_silhouette_color_edges",fragmentShader:yA,uniforms:{silhouetteTexture:t.name}});return new od({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Zr.isSilhouetteSupported=function(e){return e.context.depthTexture};Zr.createBloomStage=function(){let e=new ho({name:"czm_bloom_contrast_bias",fragmentShader:aA,uniforms:{contrast:128,brightness:-.3}}),t=J8("czm_bloom_blur"),n=new od({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new ho({name:"czm_bloom_generate_composite",fragmentShader:rA,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new od({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Zr.createAmbientOcclusionStage=function(){let e=new ho({name:"czm_ambient_occlusion_generate",fragmentShader:nA,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new ho({name:"czm_ambient_occlusion_composite",fragmentShader:iA,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new od({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Zr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Cbt=`#define FXAA_QUALITY_PRESET 39 
${xA}
${hA}`;Zr.createFXAAStage=function(){return new ho({name:"czm_FXAA",fragmentShader:Cbt,sampleMode:ou.LINEAR})};Zr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=tA,new ho({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=uA,new ho({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=mA,new ho({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=gA,new ho({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=pA,new ho({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:B.WHITE,autoExposure:void 0,exposure:1}})};Zr.createAutoExposureStage=function(){return new _A};Zr.createBlackAndWhiteStage=function(){return new ho({name:"czm_black_and_white",fragmentShader:oA,uniforms:{gradations:5}})};Zr.createBrightnessStage=function(){return new ho({name:"czm_brightness",fragmentShader:sA,uniforms:{brightness:.5}})};Zr.createNightVisionStage=function(){return new ho({name:"czm_night_vision",fragmentShader:bA})};Zr.createDepthViewStage=function(){return new ho({name:"czm_depth_view",fragmentShader:lA})};Zr.createLensFlareStage=function(){return new ho({name:"czm_lens_flare",fragmentShader:fA,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var ru=Zr;var N3i=T(S(),1);function V0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function SA(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Q8(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[SA(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let h=e.getStageByName(u);l(h)&&(r[SA(h)]=!0)}}}return i.name}function TA(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=TA(e,t,n,p,o):a=Q8(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=SA(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=SA(i.get(d));let h=n[u];for(let p=0;p<d;++p)h[SA(i.get(p))]=!0}return a}function Vbt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=TA(e,t,n,i,void 0);a=TA(e,t,n,o,a),a=Q8(e,t,n,r,a),a=TA(e,t,n,e,a),Q8(e,t,n,s,a)}else TA(e,t,n,e,void 0);return n}function Lbt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,h,p=e._framebuffers,g=p.length;for(u=0;u<g;++u){if(h=p[u],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!B.equals(d,h.clearColor))continue;let f=h.stages,x=f.length,_=!1;for(let C=0;C<x;++C)if(n[f[C]]){_=!0;break}if(!_)break}return l(h)&&u<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new fi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function Rbt(e,t){let n=Vbt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Lbt(e,i,n[i]))}function j8(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Zbt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),h=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(h)||(h=W.nextPowerOfTwo(h)),d=h,u=h),a.buffer.update(t,d,u),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}V0.prototype.updateDependencies=function(){this._updateDependencies=!0};V0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(j8(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Rbt(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,j8(this),Zbt(this,e))};V0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};V0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};V0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};V0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){return j8(this),me(this)};var dS=V0;var U3i=T(S(),1),Gbt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var L0=Object.freeze(Gbt);var q8=[];function gl(){let e=ru.createFXAAStage(),t=ru.createAmbientOcclusionStage(),n=ru.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=ru.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=L0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new dS(this),r={},s=q8;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(gl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return $8(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case L0.REINHARD:n=ru.createReinhardTonemappingStage(t);break;case L0.MODIFIED_REINHARD:n=ru.createModifiedReinhardTonemappingStage(t);break;case L0.FILMIC:n=ru.createFilmicTonemappingStage(t);break;case L0.PBR_NEUTRAL:n=ru.createPbrNeutralTonemappingStage(t);break;default:n=ru.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function $8(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}gl.prototype.add=function(e){let t=this._stageNames,n=q8;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};gl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=q8;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};gl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};gl.prototype.get=function(e){return $8(this),this._stages[e]};gl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};gl.prototype.getStageByName=function(e){return this._stageNames[e]};gl.prototype.update=function(e,t,n){$8(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&(o[s++]=V)}o.length=s;let a=s!==i.length;if(!a){for(let C=0;C<s;++C)if(o[C]!==i[C]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),x=h.enabled&&h._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||f!==this._bloomEnabled||x!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=f,this._tonemappingEnabled=x,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let V=new Uint8Array(196608);for(let L=0;L<196608;L+=3)V[L]=Math.floor(Math.random()*255);this._randomTexture=new vt({context:e,pixelFormat:it.RGB,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:V,width:256,height:256},sampler:new qt({wrapS:Vn.REPEAT,wrapT:Vn.REPEAT,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),h.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let C=0;C<r.length;++C)r[C].update(e,t);s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};gl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function uS(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}gl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return uS(t)};function up(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){up(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)up(e.get(r),t,uS(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)up(e.get(r),t,n,i,o)}gl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!h&&!p&&!f&&r===0)return;let _=t;h&&a.ready&&(up(a,e,_,n,i),_=uS(a)),p&&c.ready&&(up(c,e,_,n,i),_=uS(c)),g&&d.ready&&up(d,e,_,n,i),f&&u.ready&&(up(u,e,_,n,i),_=uS(u));let C=_;if(r>0){up(o[0],e,_,n,i);for(let V=1;V<r;++V)up(o[V],e,uS(o[V-1]),n,i);C=uS(o[r-1])}x&&s.ready&&up(s,e,C,n,i)};gl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(id,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};gl.prototype.isDestroyed=function(){return!1};gl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),me(this)};var CA=gl;var TYi=T(S(),1);function mS(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}mS.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};mS.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof an,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(A.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?a0t(this,e):f0t(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Ebt=new m,Ibt=new m,Xbt=new m,Wbt=new m,Pbt=new m,vbt=new m,wbt=new m,Fbt=new he,Abt=new A,Mbt=new Vi,Nbt=new an,kbt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};mS.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(A.IDENTITY);let i=Ebt,o=Ibt,r=Xbt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===oe.SCENE2D)m.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(d.positionWC,i),m.clone(d.directionWC,o),m.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,wbt),h=Pt.eastNorthUpToFixedFrame(u,t,Abt);A.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Fbt),i),A.multiplyByPointAsVector(h,o,o),A.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Nbt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Mbt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=kbt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=b0t(a);VA(this,c),this._previousMode===oe.SCENE2D?p0t(this,e,a,c):(a.position2D=A.multiplyByPoint(ro.TRANSFORM_2D,i,Wbt),a.direction2D=A.multiplyByPointAsVector(ro.TRANSFORM_2D,o,Pbt),a.up2D=A.multiplyByPointAsVector(ro.TRANSFORM_2D,r,vbt),n._mode=oe.MORPHING,iTe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var n7={position:new m,direction:new m,up:new m,frustum:void 0},K_e=new Vi;mS.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(A.IDENTITY),this._previousMode===oe.SCENE2D)jbt(this,e,t);else{let i;e>0?(i=n7,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=J_e(this,t);let o,r=n.camera;r.frustum instanceof an?o=r.frustum.clone():(o=K_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=rTe(i);VA(this,s),t7(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};mS.prototype.isDestroyed=function(){return!1};mS.prototype.destroy=function(){return kB(this),me(this)};function VA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Cd(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,xn.LEFT_DOWN),e._morphHandler.setInputAction(n,xn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,xn.RIGHT_DOWN),e._morphHandler.setInputAction(n,xn.WHEEL)}}function kB(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Ubt=new he,Dbt=new m,Bbt=new A;function J_e(e,t){let n=e._scene,i=n.camera,o=n7,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Ubt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,Dbt),u=Pt.eastNorthUpToFixedFrame(d,t,Bbt);return A.multiplyByPointAsVector(u,i.direction,s),A.multiplyByPointAsVector(u,i.up,a),o}var Obt=new m,Ybt=new m,Hbt=new m,zbt=new m,Kbt=new m,Jbt=new m;function t7(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,Obt),a=m.clone(r.direction,Ybt),c=m.clone(r.up,Hbt),d=A.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,zbt),u=A.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,Kbt),h=A.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,Jbt);function p(f){ym(s,d,f.time,r.position),ym(a,u,f.time,r.direction),ym(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Fr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){oTe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Qbt=new an,Q_e=new m,j_e=new m,q_e=new m,i7=new m,$_e=new m,eTe=new m;function jbt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=n7,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=J_e(e,n));let s;e._morphToOrthographic?(s=Qbt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=K_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=rTe(r);VA(e,a);let c;e._morphToOrthographic?c=function(){t7(e,t,r,a)}:c=function(){nTe(e,t,r,function(){t7(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,i7),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function ym(e,t,n,i){return m.lerp(e,t,n,i)}function tTe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof an)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Fr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var qbt=new m,$bt=new m,e0t=new m,e7=new m,t0t=new m,n0t=new m,i0t=new Pr,o0t=new pn,r0t=new m,s0t={position:void 0,direction:void 0,up:void 0,frustum:void 0};function a0t(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,qbt),r=m.clone(i.direction,$bt),s=m.clone(i.up,e0t),a=m.negate(m.UNIT_Z,t0t),c=m.clone(m.UNIT_Y,n0t),d=e7;if(t>0)m.clone(m.ZERO,e7),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,e7);let _=o0t;A.multiplyByPoint(ro.TRANSFORM_2D,o,_.origin),A.multiplyByPointAsVector(ro.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,r0t);l(V)&&(A.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,V,d),d.z+=m.distance(o,d))}}let u=i0t;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let h=s0t;h.position=d,h.direction=a,h.up=c,h.frustum=u;let p=sTe(h);VA(e,p);function g(_){ym(o,d,_.time,i.position),ym(r,a,_.time,i.direction),ym(s,c,_.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Fr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){tTe(e,t,h,f,p)}});e._currentTweens.push(x)}var z_e=new he,c0t={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Pr},l0t={position:new m,direction:new m,up:new m,frustum:void 0},d0t=new m,u0t=new pn,m0t=new A,h0t=new m;function f0t(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=c0t;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,z_e),i.mapProjection.project(z_e,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let h=u0t;m.clone(r.position2D,h.origin);let p=m.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,h0t),f=Pt.eastNorthUpToFixedFrame(g,n,m0t);A.inverseTransformation(f,f),A.multiplyByPointAsVector(f,p,p),A.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(h,i,!0,d0t);if(l(_)){let C=m.distance(r.position2D,_);_.x+=C,m.clone(_,r.position2D)}}}function s(h,p){h.position.x=p}A.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),A.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),A.multiplyByPointAsVector(ro.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=l0t;A.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let d=sTe(c);VA(e,d);function u(){tTe(e,t,r,s,d)}iTe(e,t,r,u)}function nTe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Fr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(h)}function p0t(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,i7),a=m.clone(n.direction,$_e),c=m.clone(n.up,eTe);o._mode=oe.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,Q_e),h=m.clone(r.direction,j_e),p=m.clone(r.up,q_e);u.z=s.z;function g(x){ym(u,s,x.time,r.position),ym(h,a,x.time,r.direction),ym(p,c,x.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:Fr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():nTe(e,0,n,d)}function iTe(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,Q_e),a=m.clone(r.direction,j_e),c=m.clone(r.up,q_e),d=m.clone(n.position2D,i7),u=m.clone(n.direction2D,$_e),h=m.clone(n.up2D,eTe);function p(f){ym(s,d,f.time,r.position),ym(a,u,f.time,r.direction),ym(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Fr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){oTe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function oTe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Fr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function rTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),kB(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function sTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),kB(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function b0t(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),kB(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var LA=mS;var bHi=T(S(),1);var PYi=T(S(),1);var CYi=T(S(),1),g0t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ai=Object.freeze(g0t);function ia(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function y0t(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function aTe(e,t,n){let i=ia(Ai.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new D,endPosition:new D},d.angleAndHeight={startPosition:new D,endPosition:new D},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},xn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},xn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(y0t(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,d.distance.endPosition),D.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let h=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;d.angleAndHeight.endPosition.x=-h*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},xn.PINCH_MOVE,t)}function cTe(e,t){let n=ia(Ai.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},xn.WHEEL,t)}function _L(e,t,n){let i=ia(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let c,d;n===Ai.LEFT_DRAG?(c=xn.LEFT_DOWN,d=xn.LEFT_UP):n===Ai.RIGHT_DRAG?(c=xn.RIGHT_DOWN,d=xn.RIGHT_UP):n===Ai.MIDDLE_DRAG&&(c=xn.MIDDLE_DOWN,d=xn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,D.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){o7(ia(n,void 0),e);for(let u of Object.values(Ds)){let h=ia(n,u);o7(h,e)}},d,t)}function o7(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function lTe(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function x0t(e,t,n){let i=n._isDown,o=!1,r=ia(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,o7(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new D,endPosition:new D,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function dTe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Ai)if(Ai.hasOwnProperty(s)){let a=Ai[s];if(l(a)){let c=ia(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new D,endPosition:new D,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Ai)if(Ai.hasOwnProperty(a)){let c=Ai[a];if(l(c)){let d=ia(c,t);x0t(c,t,e),r[d]&&(n[d]?(lTe(i[d],o[d]),o[d].valid=!0,lTe(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},xn.MOUSE_MOVE,t)}function xm(e){this._eventHandler=new Cd(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,cTe(this,void 0),aTe(this,void 0,e),_L(this,void 0,Ai.LEFT_DRAG),_L(this,void 0,Ai.RIGHT_DRAG),_L(this,void 0,Ai.MIDDLE_DRAG),dTe(this,void 0);for(let t in Ds)if(Ds.hasOwnProperty(t)){let n=Ds[t];l(n)&&(cTe(this,n),aTe(this,n,e),_L(this,n,Ai.LEFT_DRAG),_L(this,n,Ai.RIGHT_DRAG),_L(this,n,Ai.MIDDLE_DRAG),dTe(this,n))}}Object.defineProperties(xm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ia(Ai.WHEEL)]||!this._update[ia(Ai.WHEEL,Ds.SHIFT)]||!this._update[ia(Ai.WHEEL,Ds.CTRL)]||!this._update[ia(Ai.WHEEL,Ds.ALT)];return this._buttonsDown>0||e}}});xm.prototype.isMoving=function(e,t){let n=ia(e,t);return!this._update[n]};xm.prototype.getMovement=function(e,t){let n=ia(e,t);return this._movement[n]};xm.prototype.getLastMovement=function(e,t){let n=ia(e,t),i=this._lastMovement[n];if(i.valid)return i};xm.prototype.isButtonDown=function(e,t){let n=ia(e,t);return this._isDown[n]};xm.prototype.getStartMousePosition=function(e,t){if(e===Ai.WHEEL)return this._currentMousePosition;let n=ia(e,t);return this._eventStartPosition[n]};xm.prototype.getButtonPressTime=function(e,t){let n=ia(e,t);return this._pressTime[n]};xm.prototype.getButtonReleaseTime=function(e,t){let n=ia(e,t);return this._releaseTime[n]};xm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};xm.prototype.isDestroyed=function(){return!1};xm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var RA=xm;var DYi=T(S(),1);function UB(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(UB.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});UB.prototype.cancelTween=function(){this._tweens.remove(this)};function Yh(){this._tweens=[]}Object.defineProperties(Yh.prototype,{length:{get:function(){return this._tweens.length}}});Yh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new UB(this);let t=e.duration/Kn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Kn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Fr.LINEAR_NONE),r=e.startObject,s=new Joe(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new UB(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Yh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Yh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Yh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Yh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Yh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Yh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Yh.prototype.get=function(e){return this._tweens[e]};Yh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Kn.SECONDS_PER_MILLISECOND:xi();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var hS=Yh;function GA(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Ai.LEFT_DRAG,this.zoomEventTypes=[Ai.RIGHT_DRAG,Ai.WHEEL,Ai.PINCH],this.rotateEventTypes=Ai.LEFT_DRAG,this.tiltEventTypes=[Ai.MIDDLE_DRAG,Ai.PINCH,{eventType:Ai.LEFT_DRAG,modifier:Ds.CTRL},{eventType:Ai.RIGHT_DRAG,modifier:Ds.CTRL}],this.lookEventTypes={eventType:Ai.LEFT_DRAG,modifier:Ds.SHIFT};let t=y(e.ellipsoid,ne.default);this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new RA(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new hS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,W.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function _0t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function T0t(e){return D.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var S0t=.4;function C0t(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<S0t){let g=_0t(p,i),f=e.getLastMovement(t,n);if(!l(f)||T0t(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=D.clone(f.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function V0t(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var uTe=[];function yl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(uTe[0]=n,n=uTe);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,h=d.modifier,p=s.isMoving(u,h)&&s.getMovement(u,h),g=s.getStartMousePosition(u,h);e.enableInputs&&t&&(p?(i(e,g,p),V0t(e,r)):o<1&&C0t(s,u,h,o,i,e,r))}}var DB=new pn,L0t=new m,R0t=new D,Z0t=new m,G0t=new D,E0t=new m,I0t=new m,X0t=new m,W0t=new m,CTe=new m,P0t=new m,v0t=new m,w0t=new m,F0t=new m,A0t=new m,M0t=new m,N0t=new m,k0t=new m,U0t=new m,D0t=new m,fS=new m,mTe=new m,hTe=new m,r7={orientation:new Ra};function h7(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,h=o-d,p=i*h;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let x=e._scene,_=x.camera,C=x.mode,V=r7.orientation;V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll;let L=y(n.inertiaEnabled,D.equals(t,e._zoomMouseStart)),R=e._zoomingOnVector,G=e._rotatingZoom,I;if(L||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(I=_.getPickRay(t,DB).origin,I=m.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=R0(e,t,L0t)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,R=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let v=C===oe.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,w=_.position;if(!m.equals(P,w)&&_.positionCartographic.height<e._maxCoord.x*2){let M=_.position.x,b=m.subtract(P,w,Z0t);m.normalize(b,b);let Z=m.distance(P,w)*f/(_.getMagnitude()*.5);_.move(b,Z*.5),(_.position.x<0&&M>0||_.position.x>0&&M<0)&&(I=_.getPickRay(t,DB).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=m.normalize(_.position,CTe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(m.dot(_.direction,P))<.6)v=!0;else{let w=x.canvas,M=G0t;M.x=w.clientWidth/2,M.y=w.clientHeight/2;let b=R0(e,M,E0t);if(!l(b))v=!0;else if(_.positionCartographic.height<1e6)if(m.dot(_.direction,P)>=-.5)v=!0;else{let Z=v0t;m.clone(_.position,Z);let E=e._zoomWorldPosition,X=P0t;if(X=m.normalize(E,X),m.dot(X,P)<0)return;let F=D0t,N=A0t;m.clone(_.direction,N),m.add(Z,m.multiplyByScalar(N,1e3,fS),F);let O=M0t,U=N0t;m.subtract(E,Z,O),m.normalize(O,U);let Y=m.dot(P,U);if(Y>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-Y),H=m.magnitude(Z),K=m.magnitude(E),te=H-f,z=m.magnitude(O),j=Math.asin(W.clamp(z/K*Math.sin(k),-1,1)),ee=Math.asin(W.clamp(te/K*Math.sin(k),-1,1)),fe=j-ee+k,Te=w0t;m.normalize(Z,Te);let de=F0t;de=m.cross(U,Te,de),de=m.normalize(de,de),m.normalize(m.cross(Te,de,fS),N),m.multiplyByScalar(m.normalize(F,fS),m.magnitude(F)-f,F),m.normalize(Z,Z),m.multiplyByScalar(Z,te,Z);let xe=k0t;m.multiplyByScalar(m.add(m.multiplyByScalar(Te,Math.cos(fe)-1,mTe),m.multiplyByScalar(N,Math.sin(fe),hTe),fS),te,xe),m.add(Z,xe,Z),m.normalize(F,Te),m.normalize(m.cross(Te,de,fS),N);let Ce=U0t;m.multiplyByScalar(m.add(m.multiplyByScalar(Te,Math.cos(fe)-1,mTe),m.multiplyByScalar(N,Math.sin(fe),hTe),fS),m.magnitude(F),Ce),m.add(F,Ce,F),m.clone(Z,_.position),m.normalize(m.subtract(F,Z,fS),_.direction),m.clone(_.direction,_.direction),m.cross(_.direction,_.up,_.right),m.cross(_.right,_.direction,_.up),_.setView(r7);return}else{let Z=m.normalize(b,I0t),E=m.normalize(e._zoomWorldPosition,X0t),X=m.dot(E,Z);if(X>0&&X<1){let F=W.acosClamped(X),N=m.cross(E,Z,W0t),O=Math.abs(F)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,U=f/O;_.rotate(N,F*U)}}}}e._rotatingZoom=!v}if(!L&&v||R){let P,w=Di.worldToWindowCoordinates(x,e._zoomWorldPosition,R0t);C!==oe.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&l(w)?P=_.getPickRay(w,DB):P=_.getPickRay(t,DB);let M=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&m.fromElements(M.y,M.z,M.x,M),_.move(M,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(r7)}var B0t=new pn,O0t=new pn,Y0t=new m;function H0t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,B0t).origin,s=o.getPickRay(n.endPosition,O0t).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,Y0t),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function fTe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;h7(e,t,n,e.zoomFactor,o.getMagnitude())}var z0t=new D,K0t=new D;function pTe(e,t,n){if(l(n.angleAndHeight)){J0t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=z0t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=D.normalize(c,c);let d=K0t;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=D.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let h=W.acosClamped(d.x);d.y<0&&(h=W.TWO_PI-h);let p=h-u;o.twistRight(p)}function J0t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function Q0t(e){let t=e._scene.mapMode2D===nd.ROTATE;A.equals(A.IDENTITY,e._scene.camera.transform)?(yl(e,e.enableTranslate,e.translateEventTypes,H0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),yl(e,e.enableZoom,e.zoomEventTypes,fTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&yl(e,e.enableRotate,e.tiltEventTypes,pTe,e.inertiaSpin,"_lastInertiaTiltMovement")):(yl(e,e.enableZoom,e.zoomEventTypes,fTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&yl(e,e.enableRotate,e.translateEventTypes,pTe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var VTe=new pn,j0t=new m,q0t=new m;function R0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,j0t)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,VTe),d=o.pickWorldCoordinates(c,i,a,q0t),u=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<h?m.clone(s,n):m.clone(d,n)}var $0t=new he;function JB(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,$0t);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var egt=new m;function LTe(e,t){let n=t.origin,i=t.direction,o=JB(e),r=m.normalize(n,egt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function RTe(e,t,n,i){let o=m.distance(t.origin,n),r=JB(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),pn.getPoint(t,o,i)}function ZTe(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=JB(e))):o=JB(e),pn.getPoint(t,o,i)}var tgt=new D;function GTe(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,tgt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,f7(e,t,e._strafeStartPosition),t.endPosition=n}var bTe=new pn,ngt=new pn,s7=new m,igt=new m,ogt=new m,rgt=new m,sgt=new sn(m.UNIT_X,0),agt=new D,cgt=new D;function lgt(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){au(e,t,n);return}if(e._strafing){GTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,agt),a=D.clone(n.endPosition,cgt),c=o.getPickRay(s,bTe),d=m.clone(m.ZERO,rgt),u=m.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=R0(e,s,s7),l(h)&&(d.x=h.x)),r||d.x>o.position.z&&l(h)){let L=h;r&&(L=ZTe(e,c,h,s7)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),m.clone(L,e._strafeStartPosition),e._strafing=!0,f7(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(d,u,sgt);c=o.getPickRay(s,bTe);let g=qn.rayPlane(c,p,s7),f=o.getPickRay(a,ngt),x=qn.rayPlane(f,p,igt);if(!l(g)||!l(x)){e._looking=!0,au(e,t,n),D.clone(t,e._translateMousePosition);return}let _=m.subtract(g,x,ogt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=m.magnitude(_);V>W.EPSILON6&&(m.normalize(_,_),o.move(_,V))}var ETe=new D,YB=new pn,HB=new m,dgt=new m,ITe=new A,ugt=new A,mgt=new m,hgt=new sn(m.UNIT_X,0),a7=new m,d7=new he,XTe=new A,fgt=new ve,pgt=new $,zB=new m;function bgt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){au(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,ggt(e,t,n)):ygt(e,t,n)}function ggt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=ETe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,YB),c=m.UNIT_X,d=a.origin,u=a.direction,h,p=m.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(h=-m.dot(c,d)/p),!l(h)||h<=0){e._looking=!0,au(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(u,h,HB);m.add(d,g,g);let f=i.mapProjection,x=f.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let _=f.unproject(g,d7);x.cartographicToCartesian(_,g);let C=Pt.eastNorthUpToFixedFrame(g,x,ITe),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let R=A.clone(o.transform,XTe);o._setTransform(C),su(e,t,n,m.UNIT_Z),o._setTransform(R),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function ygt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,HB);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=R0(e,t,HB)),!l(s)){a=o.getPickRay(t,YB);let b=a.origin,Z=a.direction,E,X=m.dot(c,Z);if(Math.abs(X)>W.EPSILON6&&(E=-m.dot(c,b)/X),!l(E)||E<=0){e._looking=!0,au(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(Z,E,HB),m.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,YB)),RTe(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=ETe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,YB);let h=m.clone(m.ZERO,mgt);h.x=s.x;let p=sn.fromPointNormal(h,c,hgt),g=qn.rayPlane(a,p,dgt),f=o._projection,x=f.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,d7);x.cartographicToCartesian(_,s);let C=Pt.eastNorthUpToFixedFrame(s,x,ITe),V;l(g)?(m.fromElements(g.y,g.z,g.x,g),_=f.unproject(g,d7),x.cartographicToCartesian(_,g),V=Pt.eastNorthUpToFixedFrame(g,x,ugt)):V=C;let L=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=m.UNIT_Z,I=A.clone(o.transform,XTe);o._setTransform(C);let v=m.cross(m.UNIT_Z,m.normalize(o.position,a7),a7),P=m.dot(o.right,v);if(su(e,t,n,G,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(G=void 0);let Z=o.constrainedAxis;o.constrainedAxis=void 0,su(e,t,n,G,!0,!1),o.constrainedAxis=Z}else su(e,t,n,G,!0,!1);if(l(o.constrainedAxis)){let b=m.cross(o.direction,o.constrainedAxis,zB);m.equalsEpsilon(b,m.ZERO,W.EPSILON6)||(m.dot(b,o.right)<0&&m.negate(b,b),m.cross(b,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=L,e._ellipsoid=R;let w=R.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let M=m.clone(o.positionWC,a7);if(e.enableCollisionDetection&&g7(e,!0),!m.equals(o.positionWC,M)){o._setTransform(V),o.worldToCameraCoordinatesPoint(M,M);let b=m.magnitudeSquared(M);m.magnitudeSquared(o.position)>b&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(b),o.position));let Z=m.angleBetween(M,o.position),E=m.cross(M,o.position,M);m.normalize(E,E);let X=ve.fromAxisAngle(E,Z,fgt),F=$.fromQuaternion(X,pgt);$.multiplyByVector(F,o.direction,o.direction),$.multiplyByVector(F,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var WTe=new D,PTe=new pn,vTe=new m;function xgt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=WTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,PTe),d=c.origin,u=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=R0(e,a,vTe));let g;if(l(p)&&(g=m.distance(d,p)),s){let f=LTe(e,c,h);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=m.UNIT_X;g=-m.dot(f,d)/m.dot(f,u)}h7(e,t,n,e.zoomFactor,g)}function _gt(e){let n=e._scene.camera;if(!A.equals(A.IDENTITY,n.transform))yl(e,e.enableRotate,e.rotateEventTypes,su,e.inertiaSpin,"_lastInertiaSpinMovement"),yl(e,e.enableZoom,e.zoomEventTypes,FTe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),yl(e,e.enableTilt,e.tiltEventTypes,bgt,e.inertiaSpin,"_lastInertiaTiltMovement"),yl(e,e.enableTranslate,e.translateEventTypes,lgt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),yl(e,e.enableZoom,e.zoomEventTypes,xgt,e.inertiaZoom,"_lastInertiaZoomMovement"),yl(e,e.enableLook,e.lookEventTypes,au),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Tgt=new pn,Sgt=new sn(m.UNIT_X,0),Cgt=new m,Vgt=new m;function f7(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Tgt),s=m.clone(o.direction,Vgt);i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,Sgt),c=qn.rayPlane(r,a,Cgt);l(c)&&(s=m.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var gTe=new m,wTe=new he,u7=new m,m7=new ne,Lgt=new m,Rgt=new m,Zgt=new m;function Ggt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!A.equals(o.transform,A.IDENTITY)){su(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,Lgt);if(D.equals(t,e._rotateMousePosition)){if(e._looking)au(e,t,n,d);else if(e._rotating)su(e,t,n);else if(e._strafing)GTe(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=u7,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,m7),l7(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,wTe).height,h=e._globe;if(l(h)&&u<e._minimumPickingTerrainHeight){let p=R0(e,n.startPosition,Zgt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,VTe);if(r)g=!0,ZTe(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,Rgt);Math.abs(m.dot(f.direction,x))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(D.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,f7(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=u7,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,m7),l7(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,au(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,gTe))?(l7(e,t,n,e._ellipsoid),m.clone(gTe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,su(e,t,n)):(e._looking=!0,au(e,t,n,d));D.clone(t,e._rotateMousePosition)}function su(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),h=e._rotateFactor*(u-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=h*p*Math.PI*2,x=h*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,C=m.dot(a.direction,i),V=Math.PI-Math.acos(C)+x;V>_&&(x-=V-_)}o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=d}var c7=se.clone(se.UNIT_W),yTe=se.clone(se.UNIT_W),BB=new m,TL=new m,OB=new m,xTe=new m,Egt=new D,Igt=new D,Xgt=new D,Wgt=new D,Pgt=new pn;function l7(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,Egt),a=D.clone(n.endPosition,Igt),c=i.cartesianToCartographic(r.positionWC,wTe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,c7),!l(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=R0(e,s,c7)),!l(e._globe)&&l(d))){let h=m.subtract(d,r.positionWC,TL),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,h),TL),g=m.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,Wgt),x=D.subtract(a,s,Xgt),_=m.multiplyByScalar(r.rightWC,x.x*f.x,TL),C=m.normalize(r.positionWC,CTe),V=r.getPickRay(a,Pgt).direction,L=m.subtract(V,m.projectVector(V,r.rightWC,OB),OB),R=m.angleBetween(L,r.directionWC),G=1;l(r.frustum.fov)&&(G=Math.max(Math.tan(R),.1));let I=Math.abs(m.dot(r.directionWC,C)),v=-x.y*f.y*2/Math.sqrt(G)*(1-I),P=m.multiplyByScalar(V,v,OB);I=Math.abs(m.dot(r.upWC,C));let w=m.multiplyByScalar(r.upWC,-x.y*(1-I)*f.y,xTe);u=m.add(d,_,yTe),u=m.add(u,P,u),u=m.add(u,w,u),m.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,c7),u=r.pickEllipsoid(a,i,yTe)),!l(d)||!l(u)){e._rotating=!0,su(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let h=r.constrainedAxis,p=m.mostOrthogonalAxis(h,BB);m.cross(p,h,p),m.normalize(p,p);let g=m.cross(h,p,TL),f=m.magnitude(d),x=m.dot(h,d),_=Math.acos(x/f),C=m.multiplyByScalar(h,x,OB);m.subtract(d,C,C),m.normalize(C,C);let V=m.magnitude(u),L=m.dot(h,u),R=Math.acos(L/V),G=m.multiplyByScalar(h,L,xTe);m.subtract(u,G,G),m.normalize(G,G);let I=Math.acos(m.dot(C,p));m.dot(C,g)<0&&(I=W.TWO_PI-I);let v=Math.acos(m.dot(G,p));m.dot(G,g)<0&&(v=W.TWO_PI-v);let P=I-v,w;m.equalsEpsilon(h,r.position,W.EPSILON2)?w=r.right:w=m.cross(h,r.position,BB);let M=m.cross(h,w,BB),b=m.dot(M,m.subtract(d,h,TL)),Z=m.dot(M,m.subtract(u,h,TL)),E;b>0&&Z>0?E=R-_:b>0&&Z<=0?m.dot(r.position,h)>0?E=-_-R:E=_+R:E=_-R,r.rotateRight(P),r.rotateUp(E)}else{m.normalize(d,d),m.normalize(u,u);let h=m.dot(d,u),p=m.cross(d,u,BB);if(h<1&&!m.equalsEpsilon(p,m.ZERO,W.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var vgt=new m,wgt=new he,_Te=0;function FTe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=WTe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,PTe),h,p=o.cartesianToCartographic(s.position,wgt).height,g=Math.abs(_Te)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=R0(e,d,vTe));let x;if(l(h)&&(x=m.distance(u.origin,h),_Te=x),c){let C=LTe(e,u,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=m.normalize(s.position,vgt);h7(e,t,n,e.zoomFactor,x,m.dot(_,s.direction))}var ATe=new D,KB=new pn,ZA=new m,Fgt=new m,MTe=new A,Agt=new A,NTe=new A,Mgt=new ve,Ngt=new $,p7=new he,b7=new m;function kgt(e,t,n){let o=e._scene.camera;if(!A.equals(o.transform,A.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,b7);au(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,p7);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Dgt(e,t,n)):Bgt(e,t,n)}var Ugt=new he;function Dgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Ugt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=ATe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,KB),h,p=qn.rayEllipsoid(u,i);if(l(p))h=pn.getPoint(u,p.start,ZA);else if(a>e._minimumTrackBallHeight){let V=qn.grazingAltitudeLocation(u,i);if(!l(V))return;let L=i.cartesianToCartographic(V,p7);L.height=0,h=i.cartographicToCartesian(L,ZA)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,b7);au(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let g=Pt.eastNorthUpToFixedFrame(h,i,MTe),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=A.clone(r.transform,NTe);r._setTransform(g),su(e,t,n,m.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function Bgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(D.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,ZA);else{if(a=R0(e,t,ZA),!l(a)){if(c=r.getPickRay(t,KB),d=qn.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,p7).height<=e._minimumTrackBallHeight){e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,b7);au(e,t,n,Z),D.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,d.start,ZA)}s&&(l(c)||(c=r.getPickRay(t,KB)),RTe(e,c,a,a)),D.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,h=ATe;h.x=u.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,KB);let p=m.magnitude(a),g=m.fromElements(p,p,p,u7),f=ne.fromCartesian3(g,m7);if(d=qn.rayEllipsoid(c,f),!l(d))return;let x=m.magnitude(c.origin)>p?d.start:d.stop,_=pn.getPoint(c,x,Fgt),C=Pt.eastNorthUpToFixedFrame(a,i,MTe),V=Pt.eastNorthUpToFixedFrame(_,f,Agt),L=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=m.UNIT_Z,I=A.clone(r.transform,NTe);r._setTransform(V);let v=m.cross(_,r.positionWC,zB);if(m.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(G=void 0);let Z=r.constrainedAxis;r.constrainedAxis=void 0,su(e,t,n,G,!0,!1),r.constrainedAxis=Z}else su(e,t,n,G,!0,!1);if(r._setTransform(C),su(e,t,n,G,!1,!0),l(r.constrainedAxis)){let b=m.cross(r.direction,r.constrainedAxis,zB);m.equalsEpsilon(b,m.ZERO,W.EPSILON6)||(m.dot(b,r.right)<0&&m.negate(b,b),m.cross(b,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=L,e._ellipsoid=R;let w=R.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let M=m.clone(r.positionWC,zB);if(e.enableCollisionDetection&&g7(e,!0),!m.equals(r.positionWC,M)){r._setTransform(V),r.worldToCameraCoordinatesPoint(M,M);let b=m.magnitudeSquared(M);m.magnitudeSquared(r.position)>b&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(b),r.position));let Z=m.angleBetween(M,r.position),E=m.cross(M,r.position,M);m.normalize(E,E);let X=ve.fromAxisAngle(E,Z,Mgt),F=$.fromQuaternion(X,Ngt);$.multiplyByVector(F,r.direction,r.direction),$.multiplyByVector(F,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var Ogt=new D,Ygt=new D,TTe=new pn,STe=new pn,Hgt=new m,zgt=new m;function au(e,t,n,i){let r=e._scene.camera,s=Ogt;s.x=n.startPosition.x,s.y=0;let a=Ygt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,TTe),d=r.getPickRay(a,STe),u=0,h,p;r.frustum instanceof an?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction);let g=m.dot(h,p);g<1&&(u=Math.acos(g)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,TTe),d=r.getPickRay(a,STe),u=0,r.frustum instanceof an?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction),g=m.dot(h,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=y(i,f),l(i)){let x=r.direction,_=m.negate(i,Hgt),C=m.equalsEpsilon(x,i,W.EPSILON2),V=m.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){g=m.dot(x,i);let L=W.acosClamped(g);u>0&&u>L&&(u=L-W.EPSILON4),g=m.dot(x,_),L=W.acosClamped(g),u<0&&-u>L&&(u=-L+W.EPSILON4);let R=m.cross(i,x,zgt);r.look(R,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function Kgt(e){yl(e,e.enableRotate,e.rotateEventTypes,Ggt,e.inertiaSpin,"_lastInertiaSpinMovement"),yl(e,e.enableZoom,e.zoomEventTypes,FTe,e.inertiaZoom,"_lastInertiaZoomMovement"),yl(e,e.enableTilt,e.tiltEventTypes,kgt,e.inertiaSpin,"_lastInertiaTiltMovement"),yl(e,e.enableLook,e.lookEventTypes,au)}var Jgt=new A,Qgt=new he;function g7(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ne.WGS84),s=n.mapProjection,a,c;A.equals(o.transform,A.IDENTITY)||(a=A.clone(o.transform,Jgt),c=m.magnitude(o.position),o._setTransform(A.IDENTITY));let d=Qgt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===oe.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}GA.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var jgt=new m,qgt=new m;GA.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;A.equals(t.transform,A.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ne.default)):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Tr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Tr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Tr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,jgt),c=m.clone(t.directionWC,qgt);if(i===oe.SCENE2D?Q0t(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,_gt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,Kgt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC);g7(this,d)}this._aggregator.reset()};GA.prototype.isDestroyed=function(){return!1};GA.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var EA=GA;var NHi=T(S(),1);var yHi=T(S(),1),IA=`uniform sampler2D colorTexture;
uniform sampler2D colorTexture2;

uniform vec2 center;
uniform float radius;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color0 = texture(colorTexture, v_textureCoordinates);
    vec4 color1 = texture(colorTexture2, v_textureCoordinates);

    float x = length(gl_FragCoord.xy - center) / radius;
    float t = smoothstep(0.5, 0.8, x);
    out_FragColor = mix(color0 + color1, color1, t);
}
`;var _Hi=T(S(),1),XA=`uniform sampler2D colorTexture;

uniform float avgLuminance;
uniform float threshold;
uniform float offset;

in vec2 v_textureCoordinates;

float key(float avg)
{
    float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
    return max(0.0, guess) + 0.1;
}

// See section 9. "The bright-pass filter" of Realtime HDR Rendering
// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf

void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    vec3 xyz = czm_RGBToXYZ(color.rgb);
    float luminance = xyz.r;

    float scaledLum = key(avgLuminance) * luminance / avgLuminance;
    float brightLum = max(scaledLum - threshold, 0.0);
    float brightness = brightLum / (offset + brightLum);

    xyz.r = brightness;
    out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
}
`;function Z0(){this._sceneFramebuffer=new iS;let e=.125,t=new Array(6);t[0]=new ho({fragmentShader:id,textureScale:e,forcePowerOfTwo:!0,sampleMode:ou.LINEAR});let n=t[1]=new ho({fragmentShader:XA,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new ho({fragmentShader:By,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new ho({fragmentShader:By,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new ho({fragmentShader:id,sampleMode:ou.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new ho({fragmentShader:IA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new od({stages:t});let o=new dS(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Z0.prototype.get=function(e){return this._stages.get(e)};Z0.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var $gt=new se,kTe=new D,eyt=new D,UTe=new A;function tyt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=A.computeViewportTransformation(n,0,1,UTe),d=A.multiplyByPoint(r,o,$gt),u=Pt.pointToGLWindowCoordinates(s,c,o,kTe);d.x+=W.SOLAR_RADIUS;let h=Pt.pointToGLWindowCoordinates(a,c,d,d),p=D.magnitude(D.subtract(h,u,h))*30*2,g=eyt;g.x=p,g.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,R=new Ke;R.width=V,R.height=L,c=A.computeViewportTransformation(R,0,1,UTe),u=Pt.pointToGLWindowCoordinates(s,c,o,kTe),g.x*=V/f,g.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(u.x-g.x*.5,0),G.y=Math.max(u.y-g.y*.5,0),G.width=Math.min(g.x,f),G.height=Math.min(g.y,x);for(let I=1;I<4;++I)Ke.clone(G,_.get(I).scissorRectangle)}Z0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Z0.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),tyt(this,t,n),o};Z0.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};Z0.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(id,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Z0.prototype.isDestroyed=function(){return!1};Z0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var WA=Z0;var HHi=T(S(),1);function DTe(){this._cachedShowFrustumsShaders={}}function nyt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function iyt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=De.replaceMain(u,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
`,a+=`uniform vec3 debugShowFrustumsColor;
`,a+=`void main() 
{ 
    czm_Debug_main(); 
`;let c;if(s>0)for(c=0;c<s;++c)a+=`    out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
`,a+=`    out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
`;else a+=`    out_FragColor.rgb *= debugShowCommandsColor;
`,a+=`    out_FragColor.rgb *= debugShowFrustumsColor;
`;a+="}",o.sources.push(a);let d=nyt(i);return $t.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var PA=new B;function oyt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=B.fromRandom()),t._debugColor):B.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(PA.red=t.debugOverlappingFrustums&1?1:0,PA.green=t.debugOverlappingFrustums&2?1:0,PA.blue=t.debugOverlappingFrustums&4?1:0,PA.alpha=1,PA):B.WHITE}),n}var ryt=new $e;DTe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=iyt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=$e.shallowClone(t,ryt);r.shaderProgram=o,r.uniformMap=oyt(e,t),r.execute(e.context,n)};var vA=DTe;var qHi=T(S(),1);function pS(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Gn}pS.fromKeyframeNode=function(e,t,n,i){let o=new pS(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=syt(e,s,n),o._orientedBoundingBox=cyt(e,r,n,o._orientedBoundingBox),o};function syt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],d=ct.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[c]=u}return s}var BTe=new m,ayt=new m;function cyt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=m.fromElements(d,c,s,BTe),h=m.divideComponents(m.subtract(u,e._paddingBefore,BTe),e.dimensions,ayt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(pS.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});pS.prototype.hasProperty=function(e){return l(this._metadata[e])};pS.prototype.getNames=function(){return Object.keys(this._metadata)};pS.prototype.getProperty=function(e){return this._metadata[e]};var wA=pS;var d4i=T(S(),1);var _Ki=T(S(),1);var nKi=T(S(),1);var ezi=T(S(),1),FA=`struct Ray {
    vec3 pos;
    vec3 dir;
    vec3 rawDir;
};

#if defined(JITTER)
/**
 * Generate a pseudo-random value for a given 2D screen coordinate.
 * Similar to https://www.shadertoy.com/view/4djSRW with a modified hashscale.
 */
float hash(vec2 p)
{
    vec3 p3 = fract(vec3(p.xyx) * 50.0);
    p3 += dot(p3, p3.yzx + 19.19);
    return fract((p3.x + p3.y) * p3.z);
}
#endif

float minComponent(in vec3 v) {
    return min(min(v.x, v.y), v.z);
}

float maxComponent(in vec3 v) {
    return max(max(v.x, v.y), v.z);
}

struct PointJacobianT {
    vec3 point;
    mat3 jacobianT;
};
`;var nzi=T(S(),1),AA=`// See Intersection.glsl for the definition of intersectScene
// See IntersectionUtils.glsl for the definition of nextIntersection
// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl
// for the definition of convertUvToShapeUvSpace. The appropriate function is 
// selected based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See Octree.glsl for the definitions of TraversalData, SampleData,
// traverseOctreeFromBeginning, and traverseOctreeFromExisting
// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture

#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
#if defined(PICKING_VOXEL)
    #define ALPHA_ACCUM_MAX 0.1
#else
    #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
#endif

uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionUv;
uniform float u_stepSize;

#if defined(PICKING)
    uniform vec4 u_pickColor;
#endif

vec3 getSampleSize(in int level) {
    vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
    vec3 sampleSizeUv = 1.0 / sampleCount;
    return scaleShapeUvToShapeSpace(sampleSizeUv);
}

#define MINIMUM_STEP_SCALAR (0.02)
#define SHIFT_FRACTION (0.001)

/**
 * Given a coordinate within a tile, and sample spacings along a ray through
 * the coordinate, find the distance to the points where the ray entered and
 * exited the voxel cell, along with the surface normals at those points.
 * The surface normals are returned in shape space coordinates.
 */
RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
    vec3 voxelCoord = tileUv * vec3(u_dimensions);
    vec3 directions = sign(sampleSizeAlongRay);
    vec3 positiveDirections = max(directions, 0.0);
    vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
    vec3 exitCoord = entryCoord + directions;

    vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
    float lastEntry = maxComponent(distanceFromEntry);
    bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
    vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
    vec4 entry = vec4(entryNormal, lastEntry);

    vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
    float firstExit = minComponent(distanceToExit);
    bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
    vec3 exitNormal = vec3(isFirstExit) * directions;
    vec4 exit = vec4(exitNormal, firstExit);

    return RayShapeIntersection(entry, exit);
}

vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
    // The Jacobian is computed in a space where the shape spans [-1, 1].
    // But the ray is marched in a space where the shape fills [0, 1].
    // So we need to scale the Jacobian by 2.
    vec3 gradient = 2.0 * viewRay.rawDir * jacobianT;
    vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;

    RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);

    // Transform normal from shape space to Cartesian space
    vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);
    // Compare with the shape intersection, to choose the appropriate normal
    vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
    vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);

    float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
    float shift = fixedStep * SHIFT_FRACTION;
    float dt = voxelIntersection.exit.w + shift;
    if ((currentT + dt) > shapeIntersection.exit.w) {
        // Stop at end of shape
        dt = shapeIntersection.exit.w - currentT + shift;
    }
    float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);

    return vec4(entry.xyz, stepSize);
}

vec2 packIntToVec2(int value) {
    float shifted = float(value) / 255.0;
    float lowBits = fract(shifted);
    float highBits = floor(shifted) / 255.0;
    return vec2(highBits, lowBits);
}

vec2 packFloatToVec2(float value) {
    float lowBits = fract(value);
    float highBits = floor(value) / 255.0;
    return vec2(highBits, lowBits);
}

int getSampleIndex(in SampleData sampleData) {
    // tileUv = 1.0 is a valid coordinate but sampleIndex = u_inputDimensions is not.
    // (tileUv = 1.0 corresponds to the far edge of the last sample, at index = u_inputDimensions - 1).
    // Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
    vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
    vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
    ivec3 sampleIndex = ivec3(floor(inputCoordinate));
    // Convert to a 1D index for lookup in a 1D data array
    return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
}

void main()
{
    vec4 fragCoord = gl_FragCoord;
    vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
    vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
    vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case
    vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case
    vec3 viewPosUv = u_cameraPositionUv;
    #if defined(SHAPE_ELLIPSOID)
        // viewDirUv has been scaled to a space where the ellipsoid is a sphere.
        // Undo this scaling to get the raw direction.
        vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;
        Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);
    #else
        Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv);
    #endif

    Intersections ix;
    RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);

    // Exit early if the scene was completely missed.
    if (shapeIntersection.entry.w == NO_HIT) {
        discard;
    }

    float currentT = shapeIntersection.entry.w;
    float endT = shapeIntersection.exit.w;
    vec3 positionUv = viewPosUv + currentT * viewDirUv;
    PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);

    // Traverse the tree from the start position
    TraversalData traversalData;
    SampleData sampleDatas[SAMPLE_COUNT];
    traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);
    vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);

    #if defined(JITTER)
        float noise = hash(screenCoord); // [0,1]
        currentT += noise * step.w;
        positionUv += noise * step.w * viewDirUv;
    #endif

    FragmentInput fragmentInput;
    #if defined(STATISTICS)
        setStatistics(fragmentInput.metadata.statistics);
    #endif

    vec4 colorAccum = vec4(0.0);

    for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
        // Read properties from the megatexture based on the traversal state
        Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);

        // Prepare the custom shader inputs
        copyPropertiesToMetadata(properties, fragmentInput.metadata);
        fragmentInput.voxel.positionUv = positionUv;
        fragmentInput.voxel.positionShapeUv = pointJacobian.point;
        fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
        fragmentInput.voxel.viewDirUv = viewDirUv;
        fragmentInput.voxel.viewDirWorld = viewDirWorld;
        fragmentInput.voxel.surfaceNormal = step.xyz;
        fragmentInput.voxel.travelDistance = step.w;
        fragmentInput.voxel.stepCount = stepCount;
        fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
        fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);

        // Run the custom shader
        czm_modelMaterial materialOutput;
        fragmentMain(fragmentInput, materialOutput);

        // Sanitize the custom shader output
        vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
        color.rgb = max(color.rgb, vec3(0.0));
        color.a = clamp(color.a, 0.0, 1.0);

        // Pre-multiplied alpha blend
        colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);

        // Stop traversing if the alpha has been fully saturated
        if (colorAccum.a > ALPHA_ACCUM_MAX) {
            colorAccum.a = ALPHA_ACCUM_MAX;
            break;
        }

        if (step.w == 0.0) {
            // Shape is infinitely thin. The ray may have hit the edge of a
            // foreground voxel. Step ahead slightly to check for more voxels
            step.w == 0.00001;
        }

        // Keep raymarching
        currentT += step.w;
        positionUv = viewPosUv + currentT * viewDirUv;

        // Check if there's more intersections.
        if (currentT > endT) {
            #if (INTERSECTION_COUNT == 1)
                break;
            #else
                shapeIntersection = nextIntersection(ix);
                if (shapeIntersection.entry.w == NO_HIT) {
                    break;
                } else {
                    // Found another intersection. Resume raymarching there
                    currentT = shapeIntersection.entry.w;
                    endT = shapeIntersection.exit.w;
                    positionUv = viewPosUv + currentT * viewDirUv;
                }
            #endif
        }

        // Traverse the tree from the current ray position.
        // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
        pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
        traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);
        step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
    }

    // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
    colorAccum.a /= ALPHA_ACCUM_MAX;

    #if defined(PICKING)
        // If alpha is 0.0 there is nothing to pick
        if (colorAccum.a == 0.0) {
            discard;
        }
        out_FragColor = u_pickColor;
    #elif defined(PICKING_VOXEL)
        // If alpha is 0.0 there is nothing to pick
        if (colorAccum.a == 0.0) {
            discard;
        }
        vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
        vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0]));
        out_FragColor = vec4(megatextureId, sampleIndex);
    #else
        out_FragColor = colorAccum;
    #endif
}
`;var ozi=T(S(),1),MA=`in vec2 position;

uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;

void main() {
    vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
    vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
    vec2 translation = 0.5 * (aabbMax + aabbMin);
    vec2 scale = 0.5 * (aabbMax - aabbMin);
    gl_Position = vec4(position * scale + translation, 0.0, 1.0);
}
`;var szi=T(S(),1),NA=`/* Intersection defines
#define INTERSECTION_COUNT ###
*/

#define NO_HIT (-czm_infinity)
#define INF_HIT (czm_infinity * 0.5)

struct RayShapeIntersection {
    vec4 entry;
    vec4 exit;
};

vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
{
    if (intersect0.w == NO_HIT) {
        return intersect1;
    } else if (intersect1.w == NO_HIT) {
        return intersect0;
    }
    return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
}

vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
{
    return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
}

RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
{
    bool missed = (intersect0.entry.w == NO_HIT) ||
        (intersect1.entry.w == NO_HIT) ||
        (intersect0.exit.w < intersect1.entry.w) ||
        (intersect0.entry.w > intersect1.exit.w);
    if (missed) {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
    vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);

    return RayShapeIntersection(entry, exit);
}

struct Intersections {
    // Don't access these member variables directly - call the functions instead.

    // Store an array of ray-surface intersections. Each intersection is composed of:
    //  .xyz for the surface normal at the intersection point
    //  .w for the T value
    // The scale of the normal encodes the shape intersection type:
    //  length(intersection.xyz) = 1: positive shape entry
    //  length(intersection.xyz) = 2: positive shape exit
    //  length(intersection.xyz) = 3: negative shape entry
    //  length(intersection.xyz) = 4: negative shape exit
    // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
    // so we need twice as many to track ray-*surface* intersections
    vec4 intersections[INTERSECTION_COUNT * 2];

    #if (INTERSECTION_COUNT > 1)
        // Maintain state for future nextIntersection calls
        int index;
        int surroundCount;
        bool surroundIsPositive;
    #endif
};

RayShapeIntersection getFirstIntersection(in Intersections ix) 
{
    return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
}

vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
{
    float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
    return vec4(intersection.xyz * scale, intersection.w);
}

// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)

#if (INTERSECTION_COUNT > 1)
void initializeIntersections(inout Intersections ix) {
    // Sort the intersections from min T to max T with bubble sort.
    // Note: If this sorting function changes, some of the intersection test may
    // need to be updated. Search for "bubble sort" to find those areas.
    const int sortPasses = INTERSECTION_COUNT * 2 - 1;
    for (int n = sortPasses; n > 0; --n) {
        for (int i = 0; i < sortPasses; ++i) {
            // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (i >= n) { break; }

            vec4 intersect0 = ix.intersections[i + 0];
            vec4 intersect1 = ix.intersections[i + 1];

            bool inOrder = intersect0.w <= intersect1.w;

            ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
            ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
        }
    }

    // Prepare initial state for nextIntersection
    ix.index = 0;
    ix.surroundCount = 0;
    ix.surroundIsPositive = false;
}
#endif

#if (INTERSECTION_COUNT > 1)
RayShapeIntersection nextIntersection(inout Intersections ix) {
    vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
    RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);

    const int passCount = INTERSECTION_COUNT * 2;

    if (ix.index == passCount) {
        return shapeIntersection;
    }

    for (int i = 0; i < passCount; ++i) {
        // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to continue instead.
        if (i < ix.index) {
            continue;
        }

        ix.index = i + 1;

        surfaceIntersection = ix.intersections[i];
        int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
        bool currShapeIsPositive = intersectionType < 2;
        bool enter = intMod(intersectionType, 2) == 0;

        ix.surroundCount += enter ? +1 : -1;
        ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;

        // entering positive or exiting negative
        if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
            shapeIntersection.entry = surfaceIntersection;
        }

        // exiting positive or entering negative after being inside positive
        bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
        bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
        if (exitPositive || enterNegativeFromPositive) {
            shapeIntersection.exit = surfaceIntersection;

            // entry and exit have been found, so the loop can stop
            if (exitPositive) {
                // After exiting positive shape there is nothing left to intersect, so jump to the end index.
                ix.index = passCount;
            }
            break;
        }
    }

    return shapeIntersection;
}
#endif

// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
`;var czi=T(S(),1),kA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
// setIntersectionPair, INF_HIT, NO_HIT

/* intersectDepth defines (set in Scene/VoxelRenderResources.js)
#define DEPTH_INTERSECTION_INDEX ###
*/

uniform mat4 u_transformPositionViewToUv;

void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
    if (logDepthOrDepth != 0.0) {
        // Calculate how far the ray must travel before it hits the depth buffer.
        vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
        eyeCoordinateDepth /= eyeCoordinateDepth.w;
        vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
        float t = dot(depthPositionUv - ray.pos, ray.dir);
        setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
    } else {
        // There's no depth at this location.
        setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
    }
}
`;var dzi=T(S(),1),UA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
// NO_HIT, setShapeIntersection

/* Clipping plane defines (set in Scene/VoxelRenderResources.js)
#define CLIPPING_PLANES_UNION
#define CLIPPING_PLANES_COUNT
#define CLIPPING_PLANES_INTERSECTION_INDEX
*/

uniform sampler2D u_clippingPlanesTexture;
uniform mat4 u_clippingPlanesMatrix;

// Plane is in Hessian Normal Form
vec4 intersectPlane(in Ray ray, in vec4 plane) {
    vec3 n = plane.xyz; // normal
    float w = plane.w; // -dot(pointOnPlane, normal)

    float a = dot(ray.pos, n);
    float b = dot(ray.dir, n);
    float t = -(w + a) / b;

    return vec4(n, t);
}

void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
    vec4 backSide = vec4(-ray.dir, -INF_HIT);
    vec4 farSide = vec4(ray.dir, +INF_HIT);
    RayShapeIntersection clippingVolume;

    #if (CLIPPING_PLANES_COUNT == 1)
        // Union and intersection are the same when there's one clipping plane, and the code
        // is more simplified.
        vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);
        vec4 intersection = intersectPlane(ray, planeUv);
        bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
        clippingVolume.entry = reflects ? backSide : intersection;
        clippingVolume.exit = reflects ? intersection : farSide;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
    #elif defined(CLIPPING_PLANES_UNION)
        vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
        vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
            vec4 intersection = intersectPlane(ray, planeUv);
            if (dot(ray.dir, planeUv.xyz) > 0.0) {
                firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
            } else {
                lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
            }
        }
        clippingVolume.entry = backSide;
        clippingVolume.exit = lastReflection;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
        clippingVolume.entry = firstTransmission;
        clippingVolume.exit = farSide;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
    #else // intersection
        vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
        vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
            vec4 intersection = intersectPlane(ray, planeUv);
            if (dot(ray.dir, planeUv.xyz) > 0.0) {
                lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
            } else {
                firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
            }
        }
        if (lastTransmission.w < firstReflection.w) {
            clippingVolume.entry = lastTransmission;
            clippingVolume.exit = firstReflection;
        } else {
            clippingVolume.entry = vec4(-ray.dir, NO_HIT);
            clippingVolume.exit = vec4(ray.dir, NO_HIT);
        }
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
    #endif
}
`;var mzi=T(S(),1),SL=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
// RayShapeIntersection

vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
    float normalSign = positiveNormal ? 1.0 : -1.0;
    vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;

    vec2 position = ray.pos.xy;
    vec2 direction = ray.dir.xy;
    float approachRate = dot(direction, planeNormal);
    float distance = -dot(position, planeNormal);

    float t = (approachRate == 0.0)
        ? NO_HIT
        : distance / approachRate;

    return vec4(planeNormal, 0.0, t);
}

RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
{
    vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
    if (!hitFront) {
        return RayShapeIntersection(intersection, farSide);
    } else {
        return RayShapeIntersection(-1.0 * farSide, intersection);
    }
}

void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
{
    intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);
    intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);
}

bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
    float normalSign = positiveNormal ? 1.0 : -1.0;
    vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
    vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
    return dot(hit, planeDirection) > 0.0;
}

void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
    vec4 intersection = intersectLongitude(ray, angle, true);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (hitPositiveHalfPlane(ray, intersection, true)) {
        intersections[0].entry = -1.0 * farSide;
        intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);
        intersections[1].entry = intersection;
        intersections[1].exit = farSide;
    } else {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        intersections[0].entry = -1.0 * farSide;
        intersections[0].exit = farSide;
        intersections[1].entry = miss;
        intersections[1].exit = miss;
    }
}

RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
{
    // Note: works for maxAngle > minAngle + pi, where the "regular wedge"
    // is actually a negative volume.
    // Compute intersections with the two planes.
    // Normals will point toward the "outside" (negative space)
    vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
    vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);

    // Choose intersection with smallest T as the "first", the other as "last"
    // Note: first or last could be in the "shadow" wedge, beyond the tip
    bool inOrder = intersect1.w <= intersect2.w;
    vec4 first = inOrder ? intersect1 : intersect2;
    vec4 last = inOrder ? intersect2 : intersect1;

    bool firstIsAhead = first.w >= 0.0;
    bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
    bool exitFromInside = firstIsAhead == startedInsideFirst;
    bool lastIsAhead = last.w > 0.0;
    bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
    bool enterFromOutside = lastIsAhead == startedOutsideLast;

    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
    vec4 miss = vec4(normalize(ray.dir), NO_HIT);

    if (exitFromInside && enterFromOutside) {
        // Ray crosses both faces of negative wedge, exiting then entering the positive shape
        return RayShapeIntersection(first, last);
    } else if (!exitFromInside && enterFromOutside) {
        // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
        return RayShapeIntersection(-1.0 * farSide, first);
    } else if (exitFromInside && !enterFromOutside) {
        // First intersection was in the shadow wedge, so last is actually the exit
        return RayShapeIntersection(last, farSide);
    } else { // !exitFromInside && !enterFromOutside
        // Both intersections were in the shadow wedge
        return RayShapeIntersection(miss, miss);
    }
}
`;var fzi=T(S(),1),DA=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
// NO_HIT, Intersections

/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_INTERSECTION_INDEX ### // always 0
*/

uniform vec3 u_renderMinBounds;
uniform vec3 u_renderMaxBounds;

RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
{
    // Consider the box as the intersection of the space between 3 pairs of parallel planes
    // Compute the distance along the ray to each plane
    vec3 t0 = (minBound - ray.pos) / ray.dir;
    vec3 t1 = (maxBound - ray.pos) / ray.dir;

    // Identify candidate entries/exits based on distance from ray.pos
    vec3 entries = min(t0, t1);
    vec3 exits = max(t0, t1);

    vec3 directions = sign(ray.dir);

    // The actual intersection points are the furthest entry and the closest exit
    float lastEntry = maxComponent(entries);
    bvec3 isLastEntry = equal(entries, vec3(lastEntry));
    vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
    vec4 entry = vec4(entryNormal, lastEntry);

    float firstExit = minComponent(exits);
    bvec3 isFirstExit = equal(exits, vec3(firstExit));
    vec3 exitNormal = vec3(isLastEntry) * directions;
    vec4 exit = vec4(exitNormal, firstExit);

    if (entry.w > exit.w) {
        entry.w = NO_HIT;
        exit.w = NO_HIT;
    }

    return RayShapeIntersection(entry, exit);
}

void intersectShape(in Ray ray, inout Intersections ix)
{
    RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
    setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var bzi=T(S(),1),BA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
// intersectIntersections
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
// intersectFlippedWedge, intersectRegularWedge

/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO

#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
#define CYLINDER_INTERSECTION_INDEX_ANGLE
*/

// Cylinder uniforms
uniform vec2 u_cylinderRenderRadiusMinMax;
uniform vec2 u_cylinderRenderHeightMinMax;
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
    uniform vec2 u_cylinderRenderAngleMinMax;
#endif

/**
 * Find the intersection of a ray with the volume defined by two planes of constant z
 */
RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
{
    float zPosition = ray.pos.z;
    float zDirection = ray.dir.z;

    float tmin = (minMaxHeight.x - zPosition) / zDirection;
    float tmax = (minMaxHeight.y - zPosition) / zDirection;

    // Normals point outside the volume
    float signFlip = convex ? 1.0 : -1.0;
    vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
    vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);

    bool topEntry = zDirection < 0.0;
    vec4 entry = topEntry ? intersectMax : intersectMin;
    vec4 exit = topEntry ? intersectMin : intersectMax;

    return RayShapeIntersection(entry, exit);
}

/**
 * Find the intersection of a ray with a right cylindrical surface of a given radius
 * about the z-axis.
 */
RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
{
    vec2 position = ray.pos.xy;
    vec2 direction = ray.dir.xy;

    float a = dot(direction, direction);
    float b = dot(position, direction);
    float c = dot(position, position) - radius * radius;
    float determinant = b * b - a * c;

    if (determinant < 0.0) {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    determinant = sqrt(determinant);
    float t1 = (-b - determinant) / a;
    float t2 = (-b + determinant) / a;
    float signFlip = convex ? 1.0 : -1.0;
    vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
    vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);

    return RayShapeIntersection(intersect1, intersect2);
}

/**
 * Find the intersection of a ray with a right cylindrical solid of given
 * radius and height bounds. NOTE: The shape is assumed to be convex.
 */
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)
{
    RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
    RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
    return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
}

void intersectShape(Ray ray, inout Intersections ix)
{
    // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
    // Direction is scaled as well to be in sync with position.
    ray.pos = ray.pos * 2.0 - 1.0;
    ray.dir *= 2.0;

    RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);

    setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);

    if (outerIntersect.entry.w == NO_HIT) {
        return;
    }

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
        // When the cylinder is perfectly thin it's necessary to sandwich the
        // inner cylinder intersection inside the outer cylinder intersection.

        // Without this special case,
        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
        // [outerMin, innerMin, outerMax, innerMax] which will cause the back
        // side of the cylinder to be invisible because it will think the ray
        // is still inside the inner (negative) cylinder after exiting the
        // outer (positive) cylinder.

        // With this special case,
        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.

        // Note: If initializeIntersections() changes its sorting function
        // from bubble sort to something else, this code may need to change.
        RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
        setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);  // positive, enter
        setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
        setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
        setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);  // positive, exit
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
        RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
    #endif

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
        RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
        RayShapeIntersection wedgeIntersects[2];
        intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
        RayShapeIntersection wedgeIntersects[2];
        intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
    #endif
}
`;var yzi=T(S(),1),OA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
// intersectFlippedWedge, intersectRegularWedge

/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
*/

#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
    uniform vec2 u_ellipsoidRenderLongitudeMinMax;
#endif
uniform float u_eccentricitySquared;
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
uniform vec2 u_clipMinMaxHeight;

RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
    float t = -ray.pos.z / ray.dir.z;

    bool startsOutside = sign(ray.pos.z) == sign(z);
    bool entry = (t >= 0.0) != startsOutside;

    vec4 intersect = vec4(0.0, 0.0, z, t);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (entry) {
        return RayShapeIntersection(intersect, farSide);
    } else {
        return RayShapeIntersection(-1.0 * farSide, intersect);
    }
}

RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)
{
    // Scale the ray by the ellipsoid axes to make it a unit sphere
    // Note: approximating ellipsoid + height as an ellipsoid
    vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
    vec3 position = ray.pos * radiiCorrection;
    vec3 direction = ray.dir * radiiCorrection;

    float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
    float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
    float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
    float determinant = b * b - a * c; // ~ b * b when zoomed in

    if (determinant < 0.0) {
        vec4 miss = vec4(normalize(direction), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    determinant = sqrt(determinant);

    // Compute larger root using standard formula
    float signB = b < 0.0 ? -1.0 : 1.0;
    // The other root may suffer from subtractive cancellation in the standard formula.
    // Compute it from the first root instead.
    float t1 = (-b - signB * determinant) / a;
    float t2 = c / (a * t1);
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);

    float directionScale = convex ? 1.0 : -1.0;
    vec3 d1 = directionScale * normalize(position + tmin * direction);
    vec3 d2 = directionScale * normalize(position + tmax * direction);

    return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));
}

/**
 * Given a circular cone around the z-axis, with apex at the origin,
 * find the parametric distance(s) along a ray where that ray intersects
 * the cone.
 * The cone opening angle is described by the squared cosine of
 * its half-angle (the angle between the Z-axis and the surface)
 */
vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;
    float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;

    float aSin = d.z * d.z * sinSqrHalfAngle;
    float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
    float a = aSin + aCos;

    float bSin = d.z * o.z * sinSqrHalfAngle;
    float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
    float b = bSin + bCos;

    float cSin = o.z * o.z * sinSqrHalfAngle;
    float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
    float c = cSin + cCos;
    // determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
    // Avoid subtractive cancellation by expanding to eliminate these terms
    float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;

    if (determinant < 0.0) {
        return vec2(NO_HIT);
    } else if (a == 0.0) {
        // Ray is parallel to cone surface
        return (b == 0.0)
            ? vec2(NO_HIT) // Ray is on cone surface
            : vec2(-0.5 * c / b, NO_HIT);
    }

    determinant = sqrt(determinant);

    // Compute larger root using standard formula
    float signB = b < 0.0 ? -1.0 : 1.0;
    float t1 = (-b - signB * determinant) / a;
    // The other root may suffer from subtractive cancellation in the standard formula.
    // Compute it from the first root instead.
    float t2 = c / (a * t1);
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);
    return vec2(tmin, tmax);
}

/**
 * Given a point on a conical surface, find the surface normal at that point.
 */
vec3 getConeNormal(in vec3 p, in bool convex) {
    // Start with radial component pointing toward z-axis
    vec2 radial = -abs(p.z) * normalize(p.xy);
    // Z component points toward opening of cone
    float zSign = (p.z < 0.0) ? -1.0 : 1.0;
    float z = length(p.xy) * zSign;
    // Flip normal if shape is convex
    float flip = (convex) ? -1.0 : 1.0;
    return normalize(vec3(radial, z) * flip);
}

/**
 * Compute the shift between the ellipsoid origin and the apex of a cone of latitude
 */
float getLatitudeConeShift(in float sinLatitude) {
    // Find prime vertical radius of curvature: 
    // the distance along the ellipsoid normal to the intersection with the z-axis
    float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
    float primeVerticalRadius = inversesqrt(1.0 - x2);

    // Compute a shift from the origin to the intersection of the cone with the z-axis
    return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
}

void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
    // Undo the scaling from ellipsoid to sphere
    ray.pos = ray.pos * u_ellipsoidRadiiUv;
    ray.dir = ray.dir * u_ellipsoidRadiiUv;
    // Shift the ray to account for the latitude cone not being centered at the Earth center
    ray.pos.z += getLatitudeConeShift(cosHalfAngle);

    float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    vec4 miss = vec4(normalize(ray.dir), NO_HIT);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    // Initialize output with no intersections
    intersections[0].entry = -1.0 * farSide;
    intersections[0].exit = farSide;
    intersections[1].entry = miss;
    intersections[1].exit = miss;

    if (intersect.x == NO_HIT) {
        return;
    }

    // Find the points of intersection
    float tmin = intersect.x;
    float tmax = intersect.y;
    vec3 p0 = ray.pos + tmin * ray.dir;
    vec3 p1 = ray.pos + tmax * ray.dir;

    vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
    vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);

    bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
    bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);

    if (p0InShadowCone && p1InShadowCone) {
        // no valid intersections
    } else if (p0InShadowCone) {
        intersections[0].exit = intersect1;
    } else if (p1InShadowCone) {
        intersections[0].entry = intersect0;
    } else {
        intersections[0].exit = intersect0;
        intersections[1].entry = intersect1;
        intersections[1].exit = farSide;
    }
}

RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
    // Undo the scaling from ellipsoid to sphere
    ray.pos = ray.pos * u_ellipsoidRadiiUv;
    ray.dir = ray.dir * u_ellipsoidRadiiUv;
    // Shift the ray to account for the latitude cone not being centered at the Earth center
    ray.pos.z += getLatitudeConeShift(cosHalfAngle);

    float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    vec4 miss = vec4(normalize(ray.dir), NO_HIT);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (intersect.x == NO_HIT) {
        return RayShapeIntersection(miss, miss);
    }

    // Find the points of intersection
    float tmin = intersect.x;
    float tmax = intersect.y;
    vec3 p0 = ray.pos + tmin * ray.dir;
    vec3 p1 = ray.pos + tmax * ray.dir;

    vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
    vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);

    bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
    bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);

    if (p0InShadowCone && p1InShadowCone) {
        return RayShapeIntersection(miss, miss);
    } else if (p0InShadowCone) {
        return RayShapeIntersection(intersect1, farSide);
    } else if (p1InShadowCone) {
        return RayShapeIntersection(-1.0 * farSide, intersect0);
    } else {
        return RayShapeIntersection(intersect0, intersect1);
    }
}

void intersectShape(in Ray ray, inout Intersections ix) {
    // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
    // Direction is scaled as well to be in sync with position.
    ray.pos = ray.pos * 2.0 - 1.0;
    ray.dir *= 2.0;

    // Outer ellipsoid
    RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
    setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);

    // Exit early if the outer ellipsoid was missed.
    if (outerIntersect.entry.w == NO_HIT) {
        return;
    }

    // Inner ellipsoid
    RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);

    if (innerIntersect.entry.w == NO_HIT) {
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
    } else {
        // When the ellipsoid is large and thin it's possible for floating point math
        // to cause the ray to intersect the inner ellipsoid before the outer ellipsoid. 
        // To prevent this from happening, clamp innerIntersect to outerIntersect and
        // sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.

        // Without this special case,
        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
        // [outerMin, innerMin, outerMax, innerMax] which will cause the back
        // side of the ellipsoid to be invisible because it will think the ray
        // is still inside the inner (negative) ellipsoid after exiting the
        // outer (positive) ellipsoid.

        // With this special case,
        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.

        // Note: If initializeIntersections() changes its sorting function
        // from bubble sort to something else, this code may need to change.
        innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
        innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
        setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);  // positive, enter
        setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
        setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
        setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);  // positive, exit
    }

    // Bottom cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
        RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
        RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
        RayShapeIntersection bottomConeIntersections[2];
        intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
    #endif

    // Top cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
        RayShapeIntersection topConeIntersections[2];
        intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
        RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
        RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #endif

    // Wedge
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
        RayShapeIntersection wedgeIntersects[2];
        intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
        RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
        RayShapeIntersection wedgeIntersects[2];
        intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
    #endif
}
`;var _zi=T(S(),1),bS=`// Main intersection function for Voxel scenes.
// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
// for the definition of intersectShape. The appropriate function is selected
// based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
// getFirstIntersection, initializeIntersections, nextIntersection.

/* Intersection defines (set in Scene/VoxelRenderResources.js)
#define INTERSECTION_COUNT ###
*/

RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {
    // Do a ray-shape intersection to find the exact starting and ending points.
    intersectShape(ray, ix);

    // Exit early if the positive shape was completely missed or behind the ray.
    RayShapeIntersection intersection = getFirstIntersection(ix);
    if (intersection.entry.w == NO_HIT) {
        // Positive shape was completely missed - so exit early.
        return intersection;
    }

    // Clipping planes
    #if defined(CLIPPING_PLANES)
        intersectClippingPlanes(ray, ix);
    #endif

    // Depth
    #if defined(DEPTH_TEST)
        intersectDepth(screenCoord, ray, ix);
    #endif

    // Find the first intersection that's in front of the ray
    #if (INTERSECTION_COUNT > 1)
        initializeIntersections(ix);
        for (int i = 0; i < INTERSECTION_COUNT; ++i) {
            intersection = nextIntersection(ix);
            if (intersection.exit.w > 0.0) {
                // Set start to 0.0 when ray is inside the shape.
                intersection.entry.w = max(intersection.entry.w, 0.0);
                break;
            }
        }
    #else
        // Set start to 0.0 when ray is inside the shape.
        intersection.entry.w = max(intersection.entry.w, 0.0);
    #endif

    return intersection;
}
`;var Szi=T(S(),1),YA=`/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_HAS_SHAPE_BOUNDS
*/

#if defined(BOX_HAS_SHAPE_BOUNDS)
    uniform vec3 u_boxUvToShapeUvScale;
    uniform vec3 u_boxUvToShapeUvTranslate;
#endif

PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
    // For BOX, UV space = shape space, so we can use positionUv as-is,
    // and the Jacobian is the identity matrix, except that a step of 1
    // only spans half the shape space [-1, 1], so the identity is scaled.
    return PointJacobianT(positionUv, mat3(0.5));
}

vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
#else
    return positionShape;
#endif
}

PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
    PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
    pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
    return pointJacobian;
}

vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
#else
    return shapeUv;
#endif
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return shapeUv / u_boxUvToShapeUvScale;
#else
    return shapeUv;
#endif
}`;var Vzi=T(S(),1),HA=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED
*/

#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
    uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
    uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
    uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
    uniform vec2 u_cylinderShapeUvAngleMinMax;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
    uniform float u_cylinderShapeUvAngleRangeZeroMid;
#endif

PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
    // Convert from Cartesian UV space [0, 1] to Cartesian local space [-1, 1]
    vec3 position = positionUv * 2.0 - 1.0;

    float radius = length(position.xy); // [0, 1]
    vec3 radial = normalize(vec3(position.xy, 0.0));

    // Shape space height is defined within [0, 1]
    float height = positionUv.z; // [0, 1]
    vec3 z = vec3(0.0, 0.0, 1.0);

    float angle = atan(position.y, position.x);
    vec3 east = normalize(vec3(-position.y, position.x, 0.0));

    vec3 point = vec3(radius, angle, height);
    mat3 jacobianT = mat3(radial, z, east / length(position.xy));
    return PointJacobianT(point, jacobianT);
}

vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
    float radius = positionShape.x;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
        radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;
    #endif

    float angle = (positionShape.y + czm_pi) / czm_twoPi;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
            // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.
            angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
        #endif

        // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
            angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
        #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
            angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
        #endif

        angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y;
    #endif

    float height = positionShape.z;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
        height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;
    #endif

    return vec3(radius, angle, height);
}

PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
    PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
    pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
    return pointJacobian;
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    float radius = shapeUv.x;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
        radius /= u_cylinderUvToShapeUvRadius.x;
    #endif

    float angle = shapeUv.y * czm_twoPi;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
        angle /= u_cylinderUvToShapeUvAngle.x;
    #endif

    float height = shapeUv.z;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
        height /= u_cylinderUvToShapeUvHeight.x;
    #endif

    return vec3(radius, angle, height);
}
`;var Rzi=T(S(),1),zA=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
*/

uniform vec3 u_ellipsoidRadiiUv; // [0,1]
uniform vec2 u_evoluteScale; // (radiiUv.x ^ 2 - radiiUv.z ^ 2) * vec2(1.0, -1.0) / radiiUv;
uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
    uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
    uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
    uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset
#endif
uniform float u_ellipsoidInverseHeightDifferenceUv;

// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
// Extended to return radius of curvature along with the point
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
    vec2 p = abs(pos);
    vec2 inverseRadii = 1.0 / radii;

    // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
    // but store the cos and sin of t in a vec2 for efficiency.
    // Initial guess: t = pi/4
    vec2 tTrigs = vec2(0.7071067811865476);
    // Initial guess of point on ellipsoid
    vec2 v = radii * tTrigs;
    // Center of curvature of the ellipse at v
    vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;

    const int iterations = 3;
    for (int i = 0; i < iterations; ++i) {
        // Find the (approximate) intersection of p - evolute with the ellipsoid.
        vec2 q = normalize(p - evolute) * length(v - evolute);
        // Update the estimate of t.
        tTrigs = (q + evolute) * inverseRadii;
        tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
        v = radii * tTrigs;
        evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
    }

    return vec3(v * sign(pos), length(v - evolute));
}

PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
    // Convert from UV space [0, 1] to local space [-1, 1]
    vec3 position = positionUv * 2.0 - 1.0;
    // Undo the scaling from ellipsoid to sphere
    position = position * u_ellipsoidRadiiUv;

    float longitude = atan(position.y, position.x);
    vec3 east = normalize(vec3(-position.y, position.x, 0.0));

    // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
    // (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
    float distanceFromZAxis = length(position.xy);
    vec2 posEllipse = vec2(distanceFromZAxis, position.z);
    vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz);
    vec2 surfacePoint = surfacePointAndRadius.xy;

    vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);
    float latitude = atan(normal2d.y, normal2d.x);
    vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));

    float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
    float height = heightSign * length(posEllipse - surfacePoint);
    vec3 up = normalize(cross(east, north));

    vec3 point = vec3(longitude, latitude, height);
    mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
    return PointJacobianT(point, jacobianT);
}

vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
    // Longitude: shift & scale to [0, 1]
    float longitude = (positionShape.x + czm_pi) / czm_twoPi;

    // Correct the angle when max < min
    // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
        longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
    #endif

    // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
        longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
    #endif
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
        longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
    #endif

    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
        longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
    #endif

    // Latitude: shift and scale to [0, 1]
    float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
        latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
    #endif

    // Height: scale to the range [0, 1]
    float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;

    return vec3(longitude, latitude, height);
}

PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
    PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
    pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
    return pointJacobian;
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    // Convert from [0, 1] to radians [-pi, pi]
    float longitude = shapeUv.x * czm_twoPi;
    #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
        longitude /= u_ellipsoidUvToShapeUvLongitude.x;
    #endif

    // Convert from [0, 1] to radians [-pi/2, pi/2]
    float latitude = shapeUv.y * czm_pi;
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
        latitude /= u_ellipsoidUvToShapeUvLatitude.x;
    #endif
    
    float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;

    return vec3(longitude, latitude, height);
}
`;var Gzi=T(S(),1),KA=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
#define OCTREE_FLAG_INTERNAL 0
#define OCTREE_FLAG_LEAF 1
#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2

#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops

uniform sampler2D u_octreeInternalNodeTexture;
uniform vec2 u_octreeInternalNodeTexelSizeUv;
uniform int u_octreeInternalNodeTilesPerRow;
#if (SAMPLE_COUNT > 1)
uniform sampler2D u_octreeLeafNodeTexture;
uniform vec2 u_octreeLeafNodeTexelSizeUv;
uniform int u_octreeLeafNodeTilesPerRow;
#endif
uniform ivec3 u_dimensions; // does not include padding, and is in the z-up orientation
uniform ivec3 u_inputDimensions; // includes padding, and is in the orientation of the input data
#if defined(PADDING)
    uniform ivec3 u_paddingBefore;
#endif

struct OctreeNodeData {
    int data;
    int flag;
};

struct TraversalData {
    ivec4 octreeCoords;
    int parentOctreeIndex;
};

struct SampleData {
    int megatextureIndex;
    ivec4 tileCoords;
    vec3 tileUv;
    vec3 inputCoordinate;
    #if (SAMPLE_COUNT > 1)
        float weight;
    #endif
};

// Integer mod: For WebGL1 only
int intMod(in int a, in int b) {
    return a - (b * (a / b));
}
int normU8_toInt(in float value) {
    return int(value * 255.0);
}
int normU8x2_toInt(in vec2 value) {
    return int(value.x * 255.0) + 256 * int(value.y * 255.0);
}
float normU8x2_toFloat(in vec2 value) {
    return float(normU8x2_toInt(value)) / 65535.0;
}

OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
    vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);

    OctreeNodeData data;
    data.data = normU8x2_toInt(texData.xy);
    data.flag = normU8x2_toInt(texData.zw);
    return data;
}

OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
    int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
    int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
    int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
    return getOctreeNodeData(octreeUv);
}

int getOctreeParentIndex(in int octreeIndex) {
    int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;
    int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
    vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
    int parentOctreeIndex = normU8x2_toInt(parentData.xy);
    return parentOctreeIndex;
}

/**
* Convert a position in the uv-space of the tileset bounding shape
* into the uv-space of a tile within the tileset
*/
vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
	// PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)
    float dimAtLevel = exp2(float(octreeCoords.w));
    return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
}

vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
    vec3 tileUv = getTileUv(shapePosition, octreeCoords);
    return clamp(tileUv, vec3(0.0), vec3(1.0));
}

void addSampleCoordinates(in vec3 shapePosition, inout SampleData sampleData) {
    vec3 tileUv = getClampedTileUv(shapePosition, sampleData.tileCoords);

    vec3 inputCoordinate = tileUv * vec3(u_dimensions);
#if defined(PADDING)
    inputCoordinate += vec3(u_paddingBefore);
#endif
#if defined(GLTF_METADATA_ORDER)
#if defined(SHAPE_BOX)
    float inputY = inputCoordinate.y;
    inputCoordinate.y = float(u_inputDimensions.y) - inputCoordinate.z;
    inputCoordinate.z = inputY;
#elif defined(SHAPE_CYLINDER)
    float angle = inputCoordinate.y;
    float height = inputCoordinate.z;
    #if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
    // Account for the different 0-angle convention in glTF vs 3DTiles
    if (sampleData.tileCoords.w == 0) {
        float angleCount = float(u_inputDimensions.z);
        angle = mod(angle + angleCount / 2.0, angleCount);
    }
    #endif
    inputCoordinate.y = height;
    inputCoordinate.z = angle;
#endif
#endif

    sampleData.tileUv = tileUv;
    sampleData.inputCoordinate = inputCoordinate;
}

void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
    sampleData.megatextureIndex = data.data;
    sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;
}

#if (SAMPLE_COUNT > 1)
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
    int leafIndex = data.data;
    int leafNodeTexelCount = 2;
    // Adding 0.5 moves to the center of the texel
    float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
    float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;

    // Get an interpolation weight and a flag to determine whether to read the parent texture
    vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
    vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
    float lerp = normU8x2_toFloat(leafData0.xy);
    sampleDatas[0].weight = 1.0 - lerp;
    sampleDatas[1].weight = lerp;
    // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
    sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;
    sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;

    // Get megatexture indices for both samples
    vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
    vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
    sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
    sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
}
#endif

OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {
    float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w));
    vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
    vec3 end = start + vec3(sizeAtLevel);
    OctreeNodeData childData;

    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
        // Find out which octree child contains the position
        // 0 if before center, 1 if after
        vec3 center = 0.5 * (start + end);
        vec3 childCoord = step(center, shapePosition);

        // Get octree coords for the next level down
        ivec4 octreeCoords = traversalData.octreeCoords;
        traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);

        childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));

        if (childData.flag != OCTREE_FLAG_INTERNAL) {
            // leaf tile - stop traversing
            break;
        }

        // interior tile - keep going deeper
        start = mix(start, center, childCoord);
        end = mix(center, end, childCoord);
        traversalData.parentOctreeIndex = childData.data;
    }

    return childData;
}

/**
* Transform a given position to an octree tile coordinate and a position within that tile,
* and find the corresponding megatexture index and texture coordinates
*/
void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
    traversalData.octreeCoords = ivec4(0);
    traversalData.parentOctreeIndex = 0;

    OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
    if (nodeData.flag != OCTREE_FLAG_LEAF) {
        nodeData = traverseOctreeDownwards(shapePosition, traversalData);
    }

    #if (SAMPLE_COUNT == 1)
        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
        addSampleCoordinates(shapePosition, sampleDatas[0]);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        addSampleCoordinates(shapePosition, sampleDatas[0]);
        addSampleCoordinates(shapePosition, sampleDatas[1]);
    #endif
}

bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
    return clamp(v, minVal, maxVal) == v;
}

bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
    vec3 tileUv = getTileUv(shapePosition, octreeCoords);
	bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
	// Assume (!) the position is always inside the root tile.
	return inside || octreeCoords.w == 0;
}

void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
    if (insideTile(shapePosition, traversalData.octreeCoords)) {
        for (int i = 0; i < SAMPLE_COUNT; i++) {
            addSampleCoordinates(shapePosition, sampleDatas[i]);
        }
        return;
    }

    // Go up tree until we find a parent tile containing shapePosition
    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
        traversalData.octreeCoords.xyz /= 2;
        traversalData.octreeCoords.w -= 1;

        if (insideTile(shapePosition, traversalData.octreeCoords)) {
            break;
        }

        traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
    }

    // Go down tree
    OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);

    #if (SAMPLE_COUNT == 1)
        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
        addSampleCoordinates(shapePosition, sampleDatas[0]);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        addSampleCoordinates(shapePosition, sampleDatas[0]);
        addSampleCoordinates(shapePosition, sampleDatas[1]);
    #endif
}
`;var Izi=T(S(),1),JA=`// See Octree.glsl for the definitions of SampleData and intMod

/* Megatexture defines (set in Scene/VoxelRenderResources.js)
#define SAMPLE_COUNT ###
#define NEAREST_SAMPLING
#define PADDING
*/

uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions
uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions
uniform vec2 u_megatextureVoxelSizeUv;
uniform vec2 u_megatextureSliceSizeUv;
uniform vec2 u_megatextureTileSizeUv;

// Integer min, max, clamp: For WebGL1 only
int intMin(int a, int b) {
    return a <= b ? a : b;
}
int intMax(int a, int b) {
    return a >= b ? a : b;
}
int intClamp(int v, int minVal, int maxVal) {
    return intMin(intMax(v, minVal), maxVal);
}

vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
{
    int indexX = intMod(index, dimensions.x);
    int indexY = index / dimensions.x;
    return vec2(indexX, indexY) * uvScale;
}

/*
    How is 3D data stored in a 2D megatexture?

    In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).
    The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and
    the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).
    Note that there could be empty space in the megatexture because it's a power of two.

      0   1   2   3
    +---+---+---+---+
    |   |   |   |   | 3
    +---+---+---+---+
    |   |   |   |   | 2
    +-------+-------+
    |010|110|011|111| 1
    |--- ---|--- ---|
    |000|100|001|101| 0
    +-------+-------+

    When doing linear interpolation the megatexture needs to be sampled twice: once for
    the Z slice above the voxel coordinate and once for the slice below. The two slices
    are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is
    halfway between two Z slices so the interpolation factor is 0.5. Below is a side view
    of the 3D voxel grid with voxel coordinates on the left side.

    2 +---+
      |001|
    1 +-z-+
      |000|
    0 +---+

    When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.
*/

Properties getPropertiesFromMegatexture(in SampleData sampleData) {
    int tileIndex = sampleData.megatextureIndex;

    vec3 voxelCoord = sampleData.inputCoordinate;
    #if defined(NEAREST_SAMPLING)
        // Round to the center of the nearest voxel
        voxelCoord = floor(voxelCoord) + vec3(0.5);
    #endif

    // Tile location
    vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);

    // Slice location
    float slice = voxelCoord.z - 0.5;
    int sliceIndex = int(floor(slice));
    int sliceIndex0 = intClamp(sliceIndex, 0, u_inputDimensions.z - 1);
    vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);

    // Voxel location
    vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;

    // Final location in the megatexture
    vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;

    #if defined(NEAREST_SAMPLING)
        return getPropertiesFromMegatextureAtUv(uv0);
    #else
        float sliceLerp = fract(slice);
        int sliceIndex1 = intMin(sliceIndex + 1, u_inputDimensions.z - 1);
        vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
        vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
        Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
        Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
        return mixProperties(properties0, properties1, sliceLerp);
    #endif
}

// Convert an array of sample datas to a final weighted properties.
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
    #if (SAMPLE_COUNT == 1)
        return getPropertiesFromMegatexture(sampleDatas[0]);
    #else
        // When more than one sample is taken the accumulator needs to start at 0
        Properties properties = clearProperties();
        for (int i = 0; i < SAMPLE_COUNT; ++i) {
            float weight = sampleDatas[i].weight;

            // Avoid reading the megatexture when the weight is 0 as it can be costly.
            if (weight > 0.0) {
                Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
                tempProperties = scaleProperties(tempProperties, weight);
                properties = sumProperties(properties, tempProperties);
            }
        }
        return properties;
    #endif
}
`;var Wzi=T(S(),1),lyt={XYZ:0,GLTF:1},Hh=Object.freeze(lyt);function dyt(e){let t=new Vx;this.shaderBuilder=t;let n=e._customShader,i=St(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ye.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ye.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([MA]);let a=e._provider.shape;e.provider.metadataOrder===Hh.GLTF&&(t.addDefine("GLTF_METADATA_ORDER",void 0,ye.FRAGMENT),a==="BOX"?t.addDefine("SHAPE_BOX",void 0,ye.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,ye.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,ye.FRAGMENT)),t.addFragmentLines([n.fragmentShaderText,"#line 0",KA,FA,NA,JA]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ye.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ye.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ye.FRAGMENT),t.addFragmentLines([UA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ye.FRAGMENT),t.addFragmentLines([kA])),a==="BOX"?t.addFragmentLines([YA,DA,bS]):a==="CYLINDER"?t.addFragmentLines([HA,SL,BA,bS]):a==="ELLIPSOID"&&t.addFragmentLines([zA,SL,OA,bS]),t.addFragmentLines([AA]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ye.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,ye.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,ye.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,ye.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,ye.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ye.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ye.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ye.FRAGMENT)}var QA=dyt;var aKi=T(S(),1);function uyt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,ye.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],M=o[P],b=`PropertyStatistics_${w}`,Z=`PropertyStatistics_${w}`;n.addStruct(b,Z,ye.FRAGMENT);let E=QB(M);n.addStructField(b,E,"min"),n.addStructField(b,E,"max")}let u="Statistics",h="Statistics",p="statistics";n.addStruct(u,h,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],M=`PropertyStatistics_${w}`,b=w;n.addStructField(u,M,b)}let g="Metadata",f="Metadata",x="metadata";n.addStruct(g,f,ye.FRAGMENT),n.addStructField(g,h,p);for(let P=0;P<c;P++){let w=i[P],M=o[P],b=QB(M);n.addStructField(g,b,w)}for(let P=0;P<c;P++){let w=i[P],M=o[P],b=hyt(M),Z=`VoxelProperty_${w}`,E=`VoxelProperty_${w}`;n.addStruct(Z,E,ye.FRAGMENT),n.addStructField(Z,b,"partialDerivativeLocal"),n.addStructField(Z,b,"partialDerivativeWorld"),n.addStructField(Z,b,"partialDerivativeView"),n.addStructField(Z,b,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],M=`VoxelProperty_${w}`;n.addStructField(_,M,w)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance"),n.addStructField(_,"int","stepCount"),n.addStructField(_,"int","tileIndex"),n.addStructField(_,"int","sampleIndex");let L="FragmentInput";n.addStruct(L,"FragmentInput",ye.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let G="Properties",I="Properties",v="properties";n.addStruct(G,I,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],M=o[P],b=QB(M);n.addStructField(G,b,w)}{let P="clearProperties";n.addFunction(P,`${I} clearProperties()`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let M=i[w],b=o[w],Z=r[w],E=QB(b,Z);n.addFunctionLines(P,[`${v}.${M} = ${E}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let M=i[w];n.addFunctionLines(P,[`${v}.${M} = propertiesA.${M} + propertiesB.${M};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${I} scaleProperties(${I} ${v}, float scale)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} scaledProperties = ${v};`]);for(let w=0;w<c;w++){let M=i[w];n.addFunctionLines(P,[`scaledProperties.${M} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let M=i[w];n.addFunctionLines(P,[`${v}.${M} = mix(propertiesA.${M}, propertiesB.${M}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${I} ${v}, inout ${f} ${x})`,ye.FRAGMENT);for(let w=0;w<c;w++){let M=i[w];n.addFunctionLines(P,[`${x}.${M} = ${v}.${M};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${h} ${p})`,ye.FRAGMENT);for(let w=0;w<c;w++){let M=i[w],b=o[w],Z=ct.getComponentCount(b);for(let E=0;E<Z;E++){let X=fyt(b,E),F=s[w][E],N=a[w][E];!l(F)||!l(N)||n.addFunctionLines(P,[`${p}.${M}.min${X} = ${OTe(F)};`,`${p}.${M}.max${X} = ${OTe(N)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let M=i[w],b=o[w],Z=r[w],E=myt(b,Z);n.addFunctionLines(P,[`properties.${M} = texture(u_megatextureTextures[${w}], texcoord)${E};`])}n.addFunctionLines(P,[`return ${v};`])}}function QB(e){if(e===ct.SCALAR)return"float";if(e===ct.VEC2)return"vec2";if(e===ct.VEC3)return"vec3";if(e===ct.VEC4)return"vec4"}function myt(e){if(e===ct.SCALAR)return".r";if(e===ct.VEC2)return".ra";if(e===ct.VEC3)return".rgb";if(e===ct.VEC4)return""}function hyt(e){if(e===ct.SCALAR)return"vec3";if(e===ct.VEC2)return"mat2";if(e===ct.VEC3)return"mat3";if(e===ct.VEC4)return"mat4"}function OTe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function fyt(e,t){return e===ct.SCALAR?"":`[${t}]`}var jA=uyt;function pyt(e,t){let n=new QA(e);jA(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let C="getClippingPlane",V=f0(o,t),L=0,R=V.indexOf(")")+1,G=V.indexOf("{",R)+1,I=V.indexOf("}",G),v=V.slice(L,R),P=V.slice(G,I);i.addFunction(C,v,ye.FRAGMENT),i.addFunctionLines(C,[P])}let s=i.clone();s.addDefine("PICKING",void 0,ye.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ye.FRAGMENT);let c=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),h=Ue.fromCache({cull:{enabled:!0,face:Ti.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,f=new $e({vertexArray:p,primitiveType:we.TRIANGLES,renderState:h,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ee.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=$e.shallowClone(f,new $e);x.shaderProgram=d,x.pickOnly=!0;let _=$e.shallowClone(f,new $e);if(_.shaderProgram=u,_.pickOnly=!0,l(e._drawCommand)){let C=e._drawCommand;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPick)){let C=e._drawCommandPick;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let C=e._drawCommandPickVoxel;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}e._drawCommand=f,e._drawCommandPick=x,e._drawCommandPickVoxel=_}var qA=pyt;var BKi=T(S(),1);var SKi=T(S(),1),byt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},CL=Object.freeze(byt);var PKi=T(S(),1);function VL(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}VL.prototype.getTexture=function(e){return this._textures[e]};function gyt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}VL.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):gyt(this,e,t)};function yyt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?jB(o,r,n):xyt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function jB(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?HTe(e,n):new vt({context:n,source:t,sampler:o});return YTe(o)&&r.generateMipmap(),r}function xyt(e,t,n){let{typedArray:i,sampler:o}=e,r=YTe(o),s=o.wrapS===Vn.REPEAT||o.wrapS===Vn.MIRRORED_REPEAT||o.wrapT===Vn.REPEAT||o.wrapT===Vn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===je.UNSIGNED_BYTE){let h=WI(i,a,c),p=Rg(h);return jB({sampler:o},p,n)}}else{let h=Rg(t);return jB(e,h,n)}else return jB(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),HTe(e,n)}function YTe(e){return[jt.NEAREST_MIPMAP_NEAREST,jt.NEAREST_MIPMAP_LINEAR,jt.LINEAR_MIPMAP_NEAREST,jt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function HTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new vt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}VL.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];yyt(this,o,t)}n.length=0};VL.prototype.isDestroyed=function(){return!1};VL.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return me(this)};var $A=VL;function e9(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,Fb.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Qg.INHERIT),this._textureManager=new $A,this._defaultTexture=void 0,this.uniformMap=_yt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Cyt(this),Vyt(this)}function _yt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===CL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Tyt(e,i)):n[i]=Syt(e,i)}return n}function Tyt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function Syt(e,t){return function(){return e.uniforms[t].value}}function gS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Cyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,gS(r,t,o),o=e.usedVariablesVertex.featureIdSet,gS(r,n,o),o=e.usedVariablesVertex.metadataSet,gS(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,gS(s,t,o),o=e.usedVariablesFragment.featureIdSet,gS(s,n,o),o=e.usedVariablesFragment.metadataSet,gS(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;gS(s,a,c)}}function zTe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Ic(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${zTe(t)} is not available in the ${i} shader. Did you mean ${zTe(n)} instead?`;throw new pe(o)}}function Vyt(e){let t=e.usedVariablesVertex.attributeSet;Ic(t,"position","positionMC","vertex"),Ic(t,"normal","normalMC","vertex"),Ic(t,"tangent","tangentMC","vertex"),Ic(t,"bitangent","bitangentMC","vertex"),Ic(t,"positionWC","positionMC","vertex"),Ic(t,"positionEC","positionMC","vertex"),Ic(t,"normalEC","normalMC","vertex"),Ic(t,"tangentEC","tangentMC","vertex"),Ic(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Ic(n,"position","positionEC","fragment"),Ic(n,"normal","normalEC","fragment"),Ic(n,"tangent","tangentEC","fragment"),Ic(n,"bitangent","bitangentEC","fragment"),Ic(n,"normalMC","normalEC","fragment"),Ic(n,"tangentMC","tangentEC","fragment"),Ic(n,"bitangentMC","bitangentEC","fragment")}e9.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===CL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};e9.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};e9.prototype.isDestroyed=function(){return!1};e9.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var yS=e9;var jKi=T(S(),1);function G0(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(G0.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});G0.fromMetadataArray=function(e){return new G0({metadata:e})};G0.fromGltf=async function(e){let t=new dh({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new G0({loader:t})};G0.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=Lyt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function Lyt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:c}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let h=c[o[u]].attribute,p=e.find(_=>_.name===h);if(!l(p))continue;let g=Ft.toComponentDatatype(s[u]),f=ct.getComponentCount(r[u]),x=p.count*f;d[u]=Q.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,x)}return d}G0.prototype.isDestroyed=function(){return!1};G0.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),me(this)};var xS=G0;var vJi=T(S(),1);var sJi=T(S(),1);function rd(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new A,this.shapeTransform=new A,this._minBounds=m.clone(rd.DefaultMinBounds,new m),this._maxBounds=m.clone(rd.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Ryt=new m,y7=new m,Zyt=new $,Gyt=new m,Eyt=new m,Iyt=new m,Xyt=new m,KTe=A.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new A);rd.prototype.update=function(e,t,n,i,o){i=y(i,rd.DefaultMinBounds),o=y(o,rd.DefaultMaxBounds);let r=rd.DefaultMinBounds,s=rd.DefaultMaxBounds;t=this._minBounds=m.clamp(t,r,s,this._minBounds),n=this._maxBounds=m.clamp(n,r,s,this._maxBounds),i=m.clamp(i,r,s,Gyt),o=m.clamp(o,r,s,Eyt);let a=m.clamp(t,i,o,Iyt),c=m.clamp(n,i,o,Xyt),d=A.getScale(e,y7);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||d.x===0||d.y===0||d.z===0)return!1;this.shapeTransform=A.clone(e,this.shapeTransform),this.orientedBoundingBox=_7(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=A.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:h}=this;for(let f in h)h.hasOwnProperty(f)&&(h[f]=void 0);let p=!m.equals(t,r)||!m.equals(n,s),g=0;if(h.BOX_INTERSECTION_INDEX=g,g+=1,u.renderMinBounds=A.multiplyByPoint(KTe,a,u.renderMinBounds),u.renderMaxBounds=A.multiplyByPoint(KTe,c,u.renderMaxBounds),p){h.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,x=n;u.boxUvToShapeUvScale=m.fromElements(2/(f.x===x.x?1:x.x-f.x),2/(f.y===x.y?1:x.y-f.y),2/(f.z===x.z?1:x.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=m.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var qB=new m,x7=new m;rd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),qB),d=m.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),x7);return _7(c,d,this.shapeTransform,o)};var JTe=new m;rd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,JTe),s=m.multiplyByScalar(r,o,JTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,qB),o,qB),c=m.add(a,s,x7),d=this._minBounds,u=this._maxBounds,h=m.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),qB),p=m.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),x7);return _7(h,p,this.shapeTransform,i)};rd.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));rd.DefaultMaxBounds=Object.freeze(new m(1,1,1));function _7(e,t,n,i){let o=rd.DefaultMinBounds,r=rd.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=A.getTranslation(n,i.center),i.halfAxes=A.getMatrix3(n,i.halfAxes);else{let a=A.getScale(n,y7),c=m.midpoint(e,t,Ryt);i.center=A.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),y7);let d=A.getRotation(n,Zyt);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var mp=rd;var gJi=T(S(),1);function ss(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new A,this.shapeTransform=new A,this._minimumRadius=ss.DefaultMinBounds.x,this._maximumRadius=ss.DefaultMaxBounds.x,this._minimumAngle=ss.DefaultMinBounds.y,this._maximumAngle=ss.DefaultMaxBounds.y,this._minimumHeight=ss.DefaultMinBounds.z,this._maximumHeight=ss.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderRadiusMinMax:new D,cylinderRenderAngleMinMax:new D,cylinderRenderHeightMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvAngle:new D,cylinderUvToShapeUvHeight:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var $Te=new m;ss.prototype.update=function(e,t,n,i,o){i=y(i,ss.DefaultMinBounds),o=y(o,ss.DefaultMaxBounds);let r=ss.DefaultMinBounds.x,s=ss.DefaultMaxBounds.x,a=ss.DefaultMinBounds.y,c=ss.DefaultMaxBounds.y,d=ss.DefaultMinBounds.z,u=ss.DefaultMaxBounds.z,h=c-a,p=.5*h,g=W.EPSILON10,f=W.EPSILON3,x=W.EPSILON10,_=W.clamp(t.x,r,s),C=W.clamp(n.x,r,s),V=W.clamp(i.x,r,s),L=W.clamp(o.x,r,s),R=Math.max(_,V),G=Math.min(C,L),I=W.negativePiToPi(t.y),v=W.negativePiToPi(n.y),P=W.negativePiToPi(i.y),w=W.negativePiToPi(o.y),M=Math.max(I,P),b=Math.min(v,w),Z=W.clamp(t.z,d,u),E=W.clamp(n.z,d,u),X=W.clamp(i.z,d,u),F=W.clamp(o.z,d,u),N=Math.max(Z,X),O=Math.min(E,F),U=A.getScale(e,$Te);if(G===0||R>G||N>O||W.equalsEpsilon(U.x,0,void 0,g)||W.equalsEpsilon(U.y,0,void 0,g)||W.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumAngle=I,this._maximumAngle=v,this._minimumHeight=Z,this._maximumHeight=E,this.shapeTransform=A.clone(e,this.shapeTransform),this.orientedBoundingBox=S7(R,G,M,b,N,O,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=A.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let H=_===r&&C===s,K=v<I,te=v-I+K*h,z=te>p+x&&te<h-x,j=te<p-x,ee=te>=p-x&&te<=p+x,fe=z||j||ee,Te=W.equalsEpsilon(I,a,void 0,f),de=W.equalsEpsilon(v,c,void 0,f),xe=Z===d&&E===u,Ce=R===r,Ie=b<M,Le=b-M+Ie*h,Ne=Le>=p-x&&Le<h-x,Oe=Le>x&&Le<p-x,qe=Le<=x,Rt=Ne||Oe||qe,{shaderUniforms:Lt,shaderDefines:ke}=this;for(let ut in ke)ke.hasOwnProperty(ut)&&(ke[ut]=void 0);let zt=0;if(ke.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=zt,zt+=1,Ce||(ke.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,ke.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=zt,zt+=1),Lt.cylinderRenderRadiusMinMax=D.fromElements(R,G,Lt.cylinderRenderRadiusMinMax),R===G&&(ke.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!H){ke.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let ut=C-_,mt=0,Pn=1;ut!==0&&(mt=1/ut,Pn=-_/ut),Lt.cylinderUvToShapeUvRadius=D.fromElements(mt,Pn,Lt.cylinderUvToShapeUvRadius)}if(!xe){ke.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let ut=E-Z,mt=0,Pn=1;ut!==0&&(mt=2/ut,Pn=-(Z+1)/ut),Lt.cylinderUvToShapeUvHeight=D.fromElements(mt,Pn,Lt.cylinderUvToShapeUvHeight)}if(Lt.cylinderRenderHeightMinMax=D.fromElements(N,O,Lt.cylinderRenderHeightMinMax),K&&(ke.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Rt&&(ke.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,ke.CYLINDER_INTERSECTION_INDEX_ANGLE=zt,Ne?(ke.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,zt+=1):Oe?(ke.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,zt+=2):qe&&(ke.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,zt+=2),Lt.cylinderRenderAngleMinMax=D.fromElements(M,b,Lt.cylinderRenderAngleMinMax)),fe){ke.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,Te&&(ke.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),de&&(ke.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let ut=(I-a)/h,mt=(v-a)/h,Pn=1-te/h;if(Lt.cylinderShapeUvAngleMinMax=D.fromElements(ut,mt,Lt.cylinderShapeUvAngleMinMax),Lt.cylinderShapeUvAngleRangeZeroMid=(mt+.5*Pn)%1,te<=x)Lt.cylinderUvToShapeUvAngle=D.fromElements(0,1,Lt.cylinderUvToShapeUvAngle);else{let cn=h/te,ge=-(I-a)/te;Lt.cylinderUvToShapeUvAngle=D.fromElements(cn,ge,Lt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=zt,!0};ss.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumAngle,c=this._maximumAngle,d=this._minimumHeight,u=this._maximumHeight,h=1/Math.pow(2,e),p=W.lerp(r,s,t*h),g=W.lerp(r,s,(t+1)*h),f=W.lerp(a,c,n*h),x=W.lerp(a,c,(n+1)*h),_=W.lerp(d,u,i*h),C=W.lerp(d,u,(i+1)*h);return S7(p,g,f,x,_,C,this.shapeTransform,o)};var QTe=new m,jTe=new m,Wyt=new m;ss.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,QTe),s=m.multiplyByScalar(r,o,QTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,jTe),o,jTe),c=m.add(a,s,Wyt),d=this._minimumRadius,u=this._maximumRadius,h=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,f=this._maximumAngle,x=W.lerp(d,u,a.x),_=W.lerp(d,u,c.x),C=W.lerp(h,p,a.y),V=W.lerp(h,p,c.y),L=W.lerp(g,f,a.z),R=W.lerp(g,f,c.z);return S7(x,_,L,R,C,V,this.shapeTransform,i)};ss.DefaultMinBounds=Object.freeze(new m(0,-W.PI,-1));ss.DefaultMaxBounds=Object.freeze(new m(1,+W.PI,1));var Pyt=5,vyt=new Array(Pyt),wyt=new m,Fyt=new $,Ayt=new A,Myt=new A,Nyt=new A,T7=new A,kyt=new m,Uyt=new m,Dyt=new m,eSe=new Array(8);for(let e=0;e<8;e++)eSe[e]=new m;function qTe(e,t,n){return Math.abs(se.dot(e,t))<n}function Byt(e){let t=A.getColumn(e,0,kyt),n=A.getColumn(e,1,Uyt),i=A.getColumn(e,2,Dyt),o=W.EPSILON4;return qTe(t,n,o)&&qTe(n,i,o)}function Oyt(e,t){let n=eSe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)A.multiplyByPoint(e,n[i],n[i]);return Gn.fromPoints(n,t)}function S7(e,t,n,i,o,r,s,a){let c=ss.DefaultMinBounds,d=ss.DefaultMaxBounds,u=c.x,h=d.x,p=c.y,g=d.y,f=c.z,x=d.z;if(e===u&&t===h&&o===f&&r===x&&n===p&&i===g)return a.center=A.getTranslation(s,a.center),a.halfAxes=A.getMatrix3(s,a.halfAxes),a;i<n&&(i+=W.TWO_PI);let C=i-n,V=n+C*.5,L=vyt,R=0;L[R++]=n,L[R++]=i,L[R++]=V,C>W.PI&&(L[R++]=V-W.PI_OVER_TWO,L[R++]=V+W.PI_OVER_TWO);let G=1,I=1,v=-1,P=-1;for(let te=0;te<R;++te){let z=L[te]-V,j=Math.cos(z),ee=Math.sin(z),fe=j*e,Te=ee*e,de=j*t,xe=ee*t;G=Math.min(G,fe),I=Math.min(I,Te),G=Math.min(G,de),I=Math.min(I,xe),v=Math.max(v,fe),P=Math.max(P,Te),v=Math.max(v,de),P=Math.max(P,xe)}let w=v-G,M=P-I,b=r-o,Z=(G+v)*.5,E=(I+P)*.5,X=(o+r)*.5,F=m.fromElements(Z,E,X,wyt),N=$.fromRotationZ(V,Fyt),O=m.fromElements(w,M,b,$Te),U=A.fromScale(O,Nyt),Y=A.fromRotation(N,Myt),k=A.fromTranslation(F,Ayt),H=A.multiplyTransformation(Y,A.multiplyTransformation(k,U,T7),T7),K=A.multiplyTransformation(s,H,T7);return Byt(K)?Gn.fromTransformation(K,a):Oyt(K,a)}var hp=ss;var EJi=T(S(),1);function E0(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new A,this.shapeTransform=new A,this._rectangle=new ce,this._minimumHeight=E0.DefaultMinBounds.z,this._maximumHeight=E0.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new m,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new m,eccentricitySquared:0,evoluteScale:new D,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeSinMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new D},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var Yyt=new m,Hyt=new m,zyt=new m,Kyt=new m,Jyt=new m,Qyt=new m,jyt=new m,qyt=new m,$yt=new $,tSe=new m,nSe=new m,ext=new ce;E0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=E0;i=y(i,r),o=y(o,s);let a=W.EPSILON10,c=W.EPSILON3,d=W.EPSILON10,u=W.EPSILON10,h=W.EPSILON3,p=A.getScale(e,qyt),g=m.clone(r,Yyt);g.z=-m.minimumComponent(p);let f=m.clamp(t,g,s,Hyt),x=m.clamp(n,g,s,zyt),_=m.clamp(i,g,s,Kyt),C=m.clamp(o,g,s,Jyt),V=m.maximumByComponent(f,_,Qyt),L=m.minimumByComponent(x,C,jyt),R=m.add(p,m.fromElements(x.z,x.z,x.z,tSe),tSe),G=m.maximumComponent(R),I=m.add(p,m.fromElements(L.z,L.z,L.z,nSe),nSe);if(V.y>L.y||V.y===s.y||L.y===r.y||V.z>L.z||W.equalsEpsilon(I,m.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(f.x,f.y,x.x,x.y),this._translation=A.getTranslation(e,this._translation),this._rotation=A.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=x.z;let v=ce.fromRadians(V.x,V.y,L.x,L.y,ext);this.orientedBoundingBox=C7(v,V.z,L.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=A.fromRotationTranslation($.setScale(this._rotation,R,$yt),this._translation,this.shapeTransform),this.boundTransform=A.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,w=.5*P,M=L.x<V.x,b=L.x-V.x+M*P,Z=b<=d,E=b>=w-d&&b<P-d,X=b>d&&b<w-d,F=Z||E||X,N=x.x<f.x,O=x.x-f.x+N*P,U=O>w+d&&O<P-d,Y=O>=w-d&&O<=w+d,k=O<w-d,H=U||Y||k,K=L.y<-h,te=L.y>=-h&&L.y<=+h,z=L.y>+h&&L.y<s.y-u,j=K||te||z,ee=V.y>r.y+u&&V.y<-h,fe=V.y>=-h&&V.y<=+h,Te=V.y>+h,de=ee||fe||Te,xe=j||de,Ce=x.y-f.y,Ie=x.y<-h,Le=x.y>=-h&&x.y<=+h,Ne=x.y>+h&&x.y<s.y-u,Oe=Ie||Le||Ne,qe=f.y>r.y+u&&f.y<-h,Rt=f.y>=-h&&f.y<=+h,Lt=f.y>+h,zt=Oe||(qe||Rt||Lt),{shaderUniforms:ut,shaderDefines:mt}=this;for(let pt in mt)mt.hasOwnProperty(pt)&&(mt[pt]=void 0);ut.ellipsoidRadiiUv=m.divideByScalar(R,G,ut.ellipsoidRadiiUv);let{x:Pn,z:cn}=ut.ellipsoidRadiiUv,ge=cn/Pn;ut.eccentricitySquared=1-ge*ge,ut.evoluteScale=D.fromElements((Pn*Pn-cn*cn)/Pn,(cn*cn-Pn*Pn)/cn,ut.evoluteScale),ut.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(ut.ellipsoidRadiiUv,ut.ellipsoidRadiiUv,ut.ellipsoidInverseRadiiSquaredUv),ut.ellipsoidInverseRadiiSquaredUv);let Ve=0;mt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ve,Ve+=1,mt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ve,Ve+=1,ut.clipMinMaxHeight=D.fromElements((V.z-x.z)/G,(L.z-x.z)/G,ut.clipMinMaxHeight);let bn=(x.z-f.z)/G;if(ut.ellipsoidInverseHeightDifferenceUv=1/bn,f.z===x.z&&(ut.ellipsoidInverseHeightDifferenceUv=0),F&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,mt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ve,E?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ve+=1):X?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ve+=2):Z&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ve+=2),ut.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,L.x,ut.ellipsoidRenderLongitudeMinMax)),H)if(mt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<f.x&&(mt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=d)ut.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,ut.ellipsoidUvToShapeUvLongitude);else{let so=P/O,Eo=-(f.x-r.x)/O;ut.ellipsoidUvToShapeUvLongitude=D.fromElements(so,Eo,ut.ellipsoidUvToShapeUvLongitude)}if(F){let pt=W.equalsEpsilon(V.x,r.x,void 0,c),so=W.equalsEpsilon(L.x,s.x,void 0,c);pt&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),so&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Eo=(f.x-r.x)/P,oa=(x.x-r.x)/P,Gr=(L.x-r.x)/P,_s=1-b/P,Fe=(Gr+.5*_s)%1;ut.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(Eo,oa,Fe,ut.ellipsoidShapeUvLongitudeMinMaxMid)}if(xe&&(de&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,mt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ve,ee?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ve+=1):fe?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ve+=1):Te&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ve+=2)),j&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,mt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ve,K?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ve+=2):te?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ve+=1):z&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ve+=1)),ut.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(L.y),ut.ellipsoidRenderLatitudeSinMinMax)),zt)if(mt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ce<u)ut.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,ut.ellipsoidUvToShapeUvLatitude);else{let so=(s.y-r.y)/Ce,Eo=(r.y-f.y)/Ce;ut.ellipsoidUvToShapeUvLatitude=D.fromElements(so,Eo,ut.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ve,!0};var rSe=new ce;E0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,c,a,d,rSe),g=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,h);return C7(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var iSe=new m,oSe=new m,txt=new m;E0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,iSe),s=m.multiplyByScalar(r,o,iSe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,oSe),o,oSe),c=m.add(a,s,txt),d=ce.subsection(this._rectangle,a.x,a.y,c.x,c.y,rSe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),h=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return C7(d,u,h,this._ellipsoid,this._translation,this._rotation,i)};function C7(e,t,n,i,o,r,s){return s=Gn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}E0.DefaultMinBounds=Object.freeze(new m(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));E0.DefaultMaxBounds=Object.freeze(new m(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var _S=E0;var cu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};cu.getMinBounds=function(e){switch(e){case cu.BOX:return mp.DefaultMinBounds;case cu.ELLIPSOID:return _S.DefaultMinBounds;case cu.CYLINDER:return hp.DefaultMinBounds}};cu.getMaxBounds=function(e){switch(e){case cu.BOX:return mp.DefaultMaxBounds;case cu.ELLIPSOID:return _S.DefaultMaxBounds;case cu.CYLINDER:return hp.DefaultMaxBounds}};cu.getShapeConstructor=function(e){switch(e){case cu.BOX:return mp;case cu.ELLIPSOID:return _S;case cu.CYLINDER:return hp}};var Mi=Object.freeze(cu);var vQi=T(S(),1);var FJi=T(S(),1),V7=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function t9(e,t){this.spatialNode=e,this.keyframe=t,this.state=V7.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}t9.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=V7.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};t9.priorityComparator=function(e,t){return e.priority-t.priority};t9.searchComparator=function(e,t){return e.keyframe-t.keyframe};t9.LoadState=V7;var go=t9;var nQi=T(S(),1);function Oy(e,t,n,i,o){if(o=Math.min(y(o,128*1024*1024),536870912),i===Ft.UNSIGNED_SHORT&&(i=Ft.FLOAT32),i===Ft.FLOAT32&&!e.floatingPointTexture)throw new ae("Floating point texture not supported");let s=nxt(i),a=ixt(n,e.webgl2),c=Ft.getSizeInBytes(i),d=oxt(o,n,c),u=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/u),p=u*t.x,g=h*t.y,f=Math.floor(d/p),x=Math.floor(d/g);if(f===0||x===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*n*d**2,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=f*x,this.regionCountPerMegatexture=new D(f,x),this.voxelCountPerRegion=new D(p,g),this.sliceCountPerRegion=new D(u,h),this.voxelSizeUv=new D(1/d,1/d),this.sliceSizeUv=new D(t.x/d,t.y/d),this.regionSizeUv=new D(p/d,g/d),this.texture=new vt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d,height:d,sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR})});let _=Ft.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(_,p*g*n),this.nodes=new Array(this.maximumTileCount);for(let C=0;C<this.maximumTileCount;C++)this.nodes[C]=new rxt(C);for(let C=0;C<this.maximumTileCount;C++){let V=this.nodes[C];V.previousNode=C>0?this.nodes[C-1]:void 0,V.nextNode=C<this.maximumTileCount-1?this.nodes[C+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function nxt(e){if(e===Ft.FLOAT32||e===Ft.FLOAT64)return je.FLOAT;if(e===Ft.UINT8)return je.UNSIGNED_BYTE}function ixt(e,t){if(e===1)return t?it.RED:it.LUMINANCE;if(e===2)return t?it.RG:it.LUMINANCE_ALPHA;if(e===3)return it.RGB;if(e===4)return it.RGBA}function oxt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(At.maximumTextureSize,W.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function rxt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Oy.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Oy.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Oy.prototype.isFull=function(){return this.emptyList===void 0};Oy.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Ft.UNSIGNED_SHORT&&(i=Ft.FLOAT32);let o=Ft.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,d=a*t.y,u=W.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),g=Math.floor(u/d);if(p*g>=e)break;u*=2}return u*u*n*o};Oy.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,{tileVoxelDataTemp:i,voxelCountPerTile:o,sliceCountPerRegion:r,voxelCountPerRegion:s,channelCount:a,regionCountPerMegatexture:c}=this;for(let g=0;g<o.z;g++){let f=g%r.x*o.x,x=Math.floor(g/r.x)*o.y;for(let _=0;_<o.y;_++){let C=sxt(o,_,g),V=(x+_)*s.x+f;for(let L=0;L<o.x;L++){let R=C+L,G=V+L;for(let I=0;I<a;I++)i[G*a+I]=n[R*a+I]}}}let d=e%c.x*s.x,u=Math.floor(e/c.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:d,yOffset:u};this.texture.copyFrom(p)};function sxt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}Oy.prototype.isDestroyed=function(){return!1};Oy.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var LL=Oy;var mQi=T(S(),1);function _m(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=m.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Gn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var axt=new m;_m.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,axt),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};_m.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,h=t+1,p=[[h,r,s,a],[h,d,s,a],[h,r,c,a],[h,d,c,a],[h,r,s,u],[h,d,s,u],[h,r,c,u],[h,d,c,u]];this.children=p.map(([g,f,x,_])=>new _m(g,f,x,_,this,e,this.dimensions))};_m.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};_m.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var sSe={keyframe:0};function n9(e,t){return sSe.keyframe=e,Xo(t,sSe,go.searchComparator)}_m.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=cxt(i,h),g=h[p],f=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),x=h[f],_=i-g.keyframe,C=aSe(n-t.level,_);C<a&&(a=C,r=g);let V=x.keyframe-o,L=aSe(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function cxt(e,t){let n=n9(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function aSe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}_m.prototype.isVisited=function(e){return this.visitedFrameNumber===e};_m.prototype.createKeyframeNode=function(e){let t=n9(e,this.keyframeNodes);if(t<0){t=~t;let n=new go(this,e);this.keyframeNodes.splice(t,0,n)}};_m.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=n9(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=n9(n,this.renderableKeyframeNodes);if(o<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};_m.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=n9(e.keyframe,i);if(o>=0)throw new pe("Keyframe already renderable");o=~o,i.splice(o,0,e)};_m.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var i9=_m;function Yy(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:c,componentTypes:d,metadataOrder:u}=o,h=m.add(r,s,new m);if(m.add(h,a,h),u===Hh.GLTF){let L=h.y;h.y=h.z,h.z=L}!l(i)&&l(o.maximumTileCount)&&(i=Txt(o.maximumTileCount,h,c,d)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(c.length);for(let L=0;L<c.length;L++){let R=c[L],G=ct.getComponentCount(R),I=d[L];this.megatextures[L]=new LL(t,h,G,I,i),this.textureMemoryByteLength+=this.megatextures[L].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=y(this._primitive._calculateStatistics,!1),this._frameNumber=0;let g=e._shape;this.rootNode=new i9(0,0,0,0,void 0,g,r),this._priorityQueue=new Dx({maximumLength:p,comparator:go.priorityComparator}),this._highPriorityKeyframeNodes=new Array(p),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(p),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[n-1]=0,L7(f,1,n-2,0);let x=9,_=2048,C=Math.floor(_/x),V=Math.ceil(p/C);this.internalNodeTexture=new vt({context:t,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:_,height:V,sampler:new qt({minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})}),this.internalNodeTilesPerRow=C,this.internalNodeTexelSizeUv=new D(1/_,1/V),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}Yy.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function L7(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,L7(e,t,o-1,i+1),L7(e,o+1,n,i+1)}Yy.simultaneousRequestCountMaximum=50;Yy.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,h=(d?2:1)*(u?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let L=Math.floor(512),R=Math.ceil(s/L);this.leafNodeTexture=new vt({context:r,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:1024,height:R,sampler:new qt({minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/R,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=L}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&cSe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xi();uxt(this,e),mxt(this,e);let f=xi();gxt(this,h,c);let x=xi(),_=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||_){let C=f-g,V=x-f,L=x-g;bxt(this,e,C,V,L)}};Yy.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Yy.prototype.isDestroyed=function(){return!1};Yy.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),me(this)};function cSe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];cSe(e,i)}}function lxt(e,t){if(e._simultaneousRequestCount>=Yy.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=l(u)?go.LoadState.PROCESSING:go.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(c);l(d)&&(e._simultaneousRequestCount++,t.state=go.LoadState.RECEIVING,d.then(s).catch(a))}function dxt(e){return e/(1+e)}function uxt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),lSe(e.rootNode,hs.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function mxt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(hxt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===go.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===go.LoadState.UNLOADED&&lxt(e,u),u.state===go.LoadState.PROCESSING)){let{content:h}=u;if(h.update(e._primitive,t),!h.ready)continue;if(!fxt(h.metadata,e)){u.content=void 0,u.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let g=o[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=go.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function hxt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function fxt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:d}=r,u=a*c*d,h=e[o],p=u*s;if(h.length!==p)return!1}return!0}function lSe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:d}=o,h=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(c,h),t=e.visibility(i,t),t===hs.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,f=p.screenSpaceError,x=n._priorityQueue,_=n._keyframeCount,C=W.clamp(Math.floor(n._keyframeLocation),0,_-2),V=C+1;if(_===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==_)for(let v=0;v<_;v++)e.createKeyframeNode(v);let{screenSpaceError:L,keyframeNodes:R}=e,G=dxt(L),I=!1;for(let v=0;v<R.length;v++){let P=R[v];P.priority=10*G+pxt(C,P.keyframe,V,n),P.state!==go.LoadState.UNAVAILABLE&&P.state!==go.LoadState.FAILED&&P.priority!==-Number.MAX_VALUE&&x.insert(P),P.state===go.LoadState.LOADED&&(I=!0)}if(L<f||!I){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let v=0;v<8;v++){let P=e.children[v];lSe(P,t,n,i)}}function pxt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function bxt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(go.LoadState).length,c=new Array(a),d=new Array(a),u=0;for(let I=0;I<a;I++){let v=new Array(r).fill(0);c[I]=v,d[I]=0}function h(I){let v=I.keyframeNodes;for(let P=0;P<v.length;P++){let w=v[P],M=w.keyframe,b=w.state;c[b][M]+=1,d[b]+=1,u++}if(l(I.children))for(let P=0;P<8;P++){let w=I.children[P];h(w)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=d[go.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[go.LoadState.RECEIVING],g=d[go.LoadState.PROCESSING],f=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(f&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,f&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let _=`KEYFRAMES: ${c[go.LoadState.LOADED]}`,C=`UNLOADED: ${d[go.LoadState.UNLOADED]} | RECEIVING: ${d[go.LoadState.RECEIVING]} | PROCESSING: ${d[go.LoadState.PROCESSING]} | LOADED: ${d[go.LoadState.LOADED]} | FAILED: ${d[go.LoadState.FAILED]} | UNAVAILABLE: ${d[go.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,V=Math.round(n*100)/100,L=Math.round(i*100)/100,R=Math.round(o*100)/100,G=`LOAD: ${V} | OCT: ${L} | ALL: ${R}`;console.log(`${_} || ${C} || ${G}`)}var $B={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function gxt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function h(g,f,x,_,C){let V=!1;if(l(g.children))for(let L=0;L<8;L++){let R=g.children[L];R.computeSurroundingRenderableKeyframeNodes(o),R.isRenderable(r)&&(V=!0)}if(V){d[C]=$B.INTERNAL<<16|f,d[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let R=g.children[L];f=a,x=f*9+0,h(R,f,x,_,C+L)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let L=c*5,R=g.renderableKeyframeNodePrevious,G=g.level-R.spatialNode.level,I=R.spatialNode.parent,v=l(I)?I.renderableKeyframeNodePrevious:R,P=yxt(g,i,n),w=G,M=1,b=R.megatextureIndex,Z=v.megatextureIndex;u[L+0]=P,u[L+1]=w,u[L+2]=M,u[L+3]=b,u[L+4]=Z,d[C]=$B.LEAF<<16|c}else{let L=g.renderableKeyframeNodePrevious,G=g.level-L.spatialNode.level===0?$B.LEAF:$B.PACKED_LEAF_FROM_PARENT;d[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),xxt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&_xt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function yxt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function xxt(e,t,n,i){let o=it.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function _xt(e,t,n,i){let o=it.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],f=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=W.clamp(Math.floor(65536*g),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=f&255,d[p*8+3]=x&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=C>>>0&255,d[p*8+7]=C>>>8&255}let h={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}function Txt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],d=ct.getComponentCount(a);o+=LL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o}var o9=Yy;function fp(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,fp.DefaultProvider),this._traversal=void 0,this._statistics=new Sh,this._calculateStatistics=y(e.calculateStatistics,!1),this._shape=void 0,this._shapeVisible=!1,this._dimensions=new m,this._inputDimensions=new m,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._exaggeratedMinBounds=new m,this._exaggeratedMinBoundsOld=new m,this._exaggeratedMaxBounds=new m,this._exaggeratedMaxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._exaggeratedModelMatrix=A.clone(this._modelMatrix),this._compoundModelMatrix=new A,this._compoundModelMatrixOld=new A,this._customShader=y(e.customShader,fp.DefaultCustomShader),this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new A,this._transformPositionUvToWorld=new A,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new gh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new m,inputDimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new A,transformPositionUvToView:new A,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new A,stepSize:0,pickColor:new B},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be;let i=this._provider;Sxt(this,i)}function Sxt(e,t){let{shape:n,minBounds:i=Mi.getMinBounds(n),maxBounds:o=Mi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Mi.getMinBounds(n),e.maxClippingBounds=Mi.getMaxBounds(n),e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=A.clone(e._modelMatrix,e._exaggeratedModelMatrix),uSe(e,t);let r=Mi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=mSe(e,e._shape,t)}Object.defineProperties(fp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=fp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var Cxt=new se,Vxt=new se,Lxt=new m,Rxt=new m,Zxt=new $,Gxt=new $,Ext=new A,Ixt=new A,Xxt=new A,Wxt=A.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new A),Pxt=A.fromRotationTranslation($.fromUniformScale(2,new $),new m(-1,-1,-1),new A);fp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Nxt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Axt(this,e);let i=uSe(this,t),o=this._shape;if(i&&(this._shapeVisible=mSe(this,o,t),Uxt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Dxt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Qxt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Bxt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(qA(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=Hxt(p,h,Vxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(g,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=A.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=A.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=A.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};var vxt=new m,R7=new m,wxt=new he,Fxt=new m;function Axt(e,t){if(e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Mi.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===Mi.BOX){let n=m.fromElements(1,1,t.verticalExaggeration,vxt);e._exaggeratedModelMatrix=A.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=A.multiplyByTranslation(e._exaggeratedModelMatrix,Mxt(e,t),e._exaggeratedModelMatrix)}}function Mxt(e,t){let{shapeTransform:n=A.IDENTITY,globalTransform:i=A.IDENTITY}=e._provider,o=A.getTranslation(n,R7),r=A.multiplyByPoint(e._modelMatrix,o,R7),s=A.multiplyByPoint(i,r,R7),c=ne.WGS84.cartesianToCartographic(s,wxt),d=0;l(c)&&(d=c.height);let u=Tr.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return m.fromElements(0,0,(u-d)/t.verticalExaggeration,Fxt)}function Nxt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=B.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let s=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let d=`u_${c}`;s[d]=function(){return r[c]}}if(e._dimensions=m.clone(t.dimensions,e._dimensions),i.dimensions=m.clone(e._dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingAfter),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=m.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=m.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===Hh.GLTF){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=m.clone(e._inputDimensions,i.inputDimensions);let a=y(t.keyframeCount,1);e._traversal=new o9(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,kxt(e._traversal,i)}function uSe(e,t){let n=y(t.shapeTransform,A.IDENTITY),i=y(t.globalTransform,A.IDENTITY);return A.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),A.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),TS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+TS(e,"_minBounds","_minBoundsOld")+TS(e,"_maxBounds","_maxBoundsOld")+TS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+TS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+TS(e,"_minClippingBounds","_minClippingBoundsOld")+TS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function TS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function mSe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=A.inverse(o,Ext),s=A.getRotation(o,Zxt),a=A.getScale(o,Lxt),c=m.maximumComponent(a),d=m.divideByScalar(a,c,Rxt),u=$.multiplyByScale(s,d,Gxt);return e._transformPositionWorldToUv=A.multiplyTransformation(Wxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=A.multiplyTransformation(o,Pxt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=A.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function kxt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Uxt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function Dxt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=q.secondsDifference(i.stop,i.start),a=q.secondsDifference(n,i.start)/r;return o+a}function Bxt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=A.transpose(A.multiplyTransformation(A.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),me(this)};var dSe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),Oxt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Yxt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function Hxt(e,t,n){let i=A.fromRotationTranslation(e.halfAxes,e.center,Ixt),o=A.multiply(t,i,Xxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=Yxt,h=dSe.length;for(d=0;d<h;d++)A.multiplyByVector(o,dSe[d],u[d]);for(d=0;d<h;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=Oxt[d*3+g],x=u[f];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=se.lerp(p,x,V,Cxt),R=L.x/L.w,G=L.y/L.w;r=Math.min(r,R),s=Math.max(s,R),a=Math.min(a,G),c=Math.max(c,G)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var Z7=3e7,zxt=new m(Z7,0,0),Kxt=new m(0,Z7,0),Jxt=new m(0,0,Z7);function Qxt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,h){i.add({positions:[c,d],width:h,material:zi.fromType("Color",{color:u})})}function r(c,d,u){let h=c.computeCorners();o(h[0],h[1],d,u),o(h[2],h[3],d,u),o(h[4],h[5],d,u),o(h[6],h[7],d,u),o(h[0],h[2],d,u),o(h[4],h[6],d,u),o(h[1],h[3],d,u),o(h[5],h[7],d,u),o(h[0],h[4],d,u),o(h[2],h[6],d,u),o(h[1],h[5],d,u),o(h[3],h[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,h=Math.max(1,5/Math.pow(2,d)),g=[B.RED,B.LIME,B.BLUE][d%3];if(r(c.orientedBoundingBox,g,h),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,B.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,zxt,B.RED,a),o(m.ZERO,Kxt,B.LIME,a),o(m.ZERO,Jxt,B.BLUE,a),i.update(t)}fp.DefaultCustomShader=new yS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
    material.diffuse = vec3(1.0);
    material.alpha = 1.0;
}`});function hSe(){this.ready=!0,this.shape=Mi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[ct.SCALAR],this.componentTypes=[Ft.FLOAT32],this.maximumTileCount=1}hSe.prototype.requestData=function(e){if((l(e)?y(e.tileLevel,0):0)>=1)return;let n=new xS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};fp.DefaultProvider=new hSe;var Hy=fp;var h4i=T(S(),1);function jxt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var r9=jxt;var p4i=T(S(),1);function qxt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var s9=qxt;var y4i=T(S(),1);function $xt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var a9=$xt;var tO=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function li(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new oE(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Hn(),this._jobScheduler=new MF,this._frameState=new FF(s,new GF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new uR(s),this._ellipsoid=y(e.ellipsoid,ne.default),this._globe=void 0,this._globeTranslucencyState=new AF,this._primitives=new ul,this._groundPrimitives=new ul,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=li.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new hS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new PF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new B,stencil:0,owner:this}),this._depthClearCommand=new ti({depth:1,owner:this}),this._stencilClearCommand=new ti({stencil:0}),this._classificationStencilClearCommand=new ti({stencil:0,renderState:Ue.fromCache({stencilMask:Ut.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new LA(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._minimumDisableDepthTestDistance=0,this._debugInspector=new vA,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=B.clone(B.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ei(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new rT,this.fog=new wF,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new C0({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=B.clone(B.WHITE),this._actualInvertClassificationColor=B.clone(this._invertClassificationColor),this._invertClassification=new bL,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new CA,this._brdfLutGenerator=new SF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new EA(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,nd.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=tc.requestCompletedEvent.addEventListener(tO(this)),this._removeTaskProcessorListenerCallback=yi.taskCompletedEvent.addEventListener(tO(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new ro(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new eA(this),this._defaultView=new sS(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Xp,ySe(this,0,q.now()),this.updateFrameState(),this.initializeFrame()}li.defaultLogDepthBuffer=!0;function e_t(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(tO(e))),n.push(t.terrainProviderChanged.addEventListener(tO(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(li.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return At.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return At.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return th.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,e_t(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new vF(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,At.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});li.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function t_t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function fSe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=rp.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=rp.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=rp.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=rp.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=C0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ee.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}li.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),h=l(t.originalCommand),p=o&&!d,g=c&&!u,f=(!o||!c)&&!h,x=n.pickingMetadata&&t_t(e,n);if(e.dirty=e.dirty||p||g||f||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:_,shadowMaps:C}=i;_&&e.castShadows&&(t.shadows=C0.createCastDerivedCommand(C,e,s,r,t.shadows)),(d||p)&&(t.logDepth=rp.createLogDepthCommand(e,r,t.logDepth),fSe(this,t.logDepth.command,s)),(h||f)&&fSe(this,e,s)};var n_t=new bm({pass:wo.RENDER}),G7=new bm({pass:wo.PRELOAD}),E7=new bm({pass:wo.PRELOAD_FLIGHT}),i_t=new bm({pass:wo.REQUEST_RENDER_MODE_DEFER_CHECK}),pSe=new le,I7;function o_t(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return pSe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,I7=iI.fromBoundingSphere(pSe,e.camera.positionWC,I7),I7}li.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function ySe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=q.clone(n,i.time)}li.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=o_t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof an||this.camera.frustum instanceof Pr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=B.clone(this.invertClassificationColor,this._actualInvertClassificationColor),bL.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};li.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Ht.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var eO=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);eO=A.inverseTransformation(eO,eO);function r_t(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==oe.SCENE3D){a=A.multiplyByPoint(eO,a,a);let f=o.mapProjection,x=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(x)}let c,d,{radius:u}=s;l(u)?(c=Us.createGeometry(new Us({radii:new m(u,u,u),vertexFormat:dn.FLAT_VERTEX_FORMAT})),d=A.fromTranslation(a)):(c=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:dn.FLAT_VERTEX_FORMAT})),d=A.fromRotationTranslation(s.halfAxes,a,new A)),t._debugVolume=new In({geometryInstances:new Et({geometry:Fn.toWireframe(c),modelMatrix:d,attributes:{color:new Yt(1,0,0,1)}}),appearance:new dn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=rp.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=h}function pp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&r_t(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function bSe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function xSe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function s_t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function a_t(e,t,n,i,o){ob(i,xSe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function c_t(e,t,n,i,o){ob(i,s_t,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function l_t(e,t,n){e.context.uniformState.updatePass(Ee.VOXELS);let i=n.commands[Ee.VOXELS];i.length=n.indices[Ee.VOXELS],ob(i,xSe,e.camera.positionWC);for(let o=0;o<i.length;++o)pp(i[o],e,t)}var d_t=new Vi,u_t=new Jc,m_t=new an,h_t=new Pr;function f_t(e){let{frustum:t}=e;return l(t.fov)?t.clone(d_t):l(t.infiniteProjectionMatrix)?t.clone(u_t):l(t.width)?t.clone(m_t):t.clone(h_t)}function p_t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?a_t:c_t}function b_t(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=p_t(e);o.uniformState.updatePass(Ee.TRANSLUCENT);let u=n.commands[Ee.TRANSLUCENT];u.length=n.indices[Ee.TRANSLUCENT],d(e,pp,t,u,c)}function g_t(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ee.TRANSLUCENT];i.executeTranslucentCommands(e,pp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,pp,t,n)}function W7(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=f_t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||y_t(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:f}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:_,sceneFramebuffer:C,frustumCommandsList:V}=e._view,L=V.length,R=e._globeTranslucencyState,G=e._depthClearCommand,I=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,w=n.position.z;function M(Z,E){r.updatePass(E);let X=Z.commands[E],F=Z.indices[E];for(let N=0;N<F;++N)pp(X[N],e,t);return F}function b(Z,E){r.updatePass(E);let X=Z.commands[E],F=Z.indices[E];for(let N=0;N<F;++N)bSe(X[N],e,t)}for(let Z=0;Z<L;++Z){let E=L-Z-1,X=V[E];e.mode===oe.SCENE2D?(n.position.z=w-X.near+1,s.far=Math.max(1,X.far-X.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&I.execute(i,t),R.translucent?(r.updatePass(Ee.GLOBE),R.executeGlobeCommands(X,pp,_,e,t)):M(X,Ee.GLOBE),p&&x.executeCopyDepth(i,t),u||(R.translucent?(r.updatePass(Ee.TERRAIN_CLASSIFICATION),R.executeGlobeClassificationCommands(X,pp,_,e,t)):M(X,Ee.TERRAIN_CLASSIFICATION)),d&&(G.execute(i,t),h&&P.execute(i,t));let F;if(!g||c||u)F=M(X,Ee.CESIUM_3D_TILE),F>0&&(p&&(x.prepareColorTextures(i,d),x.executeUpdateDepth(i,t,x.depthStencilTexture)),u||(F=M(X,Ee.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let O=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,F=M(X,Ee.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),F=M(X,Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=O,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),F>0&&i.stencilBuffer&&v.execute(i,t),F=M(X,Ee.CESIUM_3D_TILE_CLASSIFICATION)}if(F>0&&i.stencilBuffer&&I.execute(i,t),l_t(e,t,X),M(X,Ee.OPAQUE),E!==0&&e.mode!==oe.SCENE2D&&(s.near=X.near,r.updateFrustum(s)),b_t(e,t,X),g_t(e,t,X),i.depthTexture&&e.useDepthPicking&&(p||u)){let O=e._picking.getPickDepth(e,E);O.update(i,x.depthStencilTexture),O.executeCopyDepth(i,t)}if(c||!f)continue;let N=t.framebuffer;t.framebuffer=C.getIdFramebuffer(),s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s),R.translucent?(r.updatePass(Ee.GLOBE),R.executeGlobeCommands(X,bSe,_,e,t)):b(X,Ee.GLOBE),d&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),d&&h&&P.execute(i,t),b(X,Ee.CESIUM_3D_TILE),b(X,Ee.OPAQUE),b(X,Ee.TRANSLUCENT),t.framebuffer=N}}function y_t(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ee.ENVIRONMENT),l(i.skyBoxCommand)&&pp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&pp(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function _Se(e){e.context.uniformState.updatePass(Ee.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function x_t(e,t){e.context.uniformState.updatePass(Ee.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function __t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Ee.GLOBE,Ee.CESIUM_3D_TILE,Ee.OPAQUE,Ee.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,d))r[h].commandList.push(d),u=!0;else if(u)break}}}}function TSe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;__t(e,n,c);for(let u=0;u<d.length;++u){let h=c.passes[u],{camera:p,commandList:g}=h;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<g.length;++f){let x=g[f];s.updatePass(x.pass);let _=x.derivedCommands.shadows.castCommands[a];pp(_,e,h.passState)}}}}var T_t=new m;li.prototype.updateAndExecuteCommands=function(e,t){v_t(this,e,t),this._environmentState.useWebVR?S_t(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===nd.ROTATE?zy(!0,this,e):X_t(this,e)};function S_t(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;SSe(e),n.createPotentiallyVisibleSet(e),_Se(e),r||TSe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ro.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*y(e.focalLength,5),u=y(e.eyeSeparation,d/30),h=m.multiplyByScalar(a.right,u*.5,T_t);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;m.add(a.position,h,i.position),i.frustum.xOffset=p,W7(e,t),s.x=s.width,m.subtract(a.position,h,i.position),i.frustum.xOffset=-p,W7(e,t),ro.clone(a,i)}var C_t=new he(Math.PI,W.PI_OVER_TWO),V_t=new m,L_t=new m,R_t=new A,Z_t=new A,G_t=new m,E_t=new m,I_t=new Ke;function X_t(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Ke.clone(r,I_t);t.viewport=s;let a=C_t,c=V_t;e.mapProjection.project(a,c);let u=m.clone(i.position,L_t),h=A.clone(i.transform,Z_t),p=i.frustum.clone();i._setTransform(A.IDENTITY);let g=A.computeViewportTransformation(s,0,1,R_t),f=i.frustum.projectionMatrix,x=i.positionWC.y,_=m.fromElements(W.sign(x)*c.x-x,0,-i.positionWC.x,G_t),C=Pt.pointToGLWindowCoordinates(f,g,_,E_t);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)zy(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,i.position.x*=W.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=C.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let R=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=C.x,s.width=V+L-C.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=R-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let R=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=V,s.width=C.x-V,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=R-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t)}i._setTransform(h),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function zy(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),SSe(t),i.createPotentiallyVisibleSet(t),e&&(_Se(t),o||TSe(t)),W7(t,n)}var gSe=new hs;li.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof an||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(Lb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;s.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=d&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=gSe.planes;for(let _=0;_<5;++_)g[_]=p.planes[_];p=gSe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let f=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(f)&&x?.url!==f?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new th(f)):!l(f)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function W_t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new op({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function P_t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function SSe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),W_t(e),P_t(e),e._globe&&e._globe.render(t)}function v_t(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new WA:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;B.clone(n,u.color),u.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),x=r.usePostProcess=f.ready,r.usePostProcessSelected=x&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(o.invertClassificationColor.alpha===1&&h&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}li.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=u);let f=this.postProcessStages,x=g.getColorTexture(0),_=p.getColorTexture(0),C=y(u,h).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function w_t(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function F_t(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function CSe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof ul){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=CSe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}li.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Je.CLAMP_TO_TERRAIN||t===Je.RELATIVE_TO_TERRAIN,i=t===Je.CLAMP_TO_3D_TILE||t===Je.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=CSe(this.primitives,e,this);l(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var X7=new he;li.prototype.updateHeight=function(e,t,n){let i=()=>{he.clone(e,X7);let g=this.getHeight(e,n);l(g)&&(X7.height=g,t(X7))},o=n===Je.CLAMP_TO_TERRAIN||n===Je.RELATIVE_TO_TERRAIN,r=n===Je.CLAMP_TO_3D_TILE||n===Je.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,d=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,i,c);a[g.id]=f};if(!o){let g=this.primitives.length;for(let f=0;f<g;++f){let x=this.primitives.get(f);d(x)}}let u=this.primitives.primitiveAdded.addEventListener(d),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},u(),h()}};function A_t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}li.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=F_t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=A_t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function M_t(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new _0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function N_t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function k_t(e){e.primitives.postPassesUpdate(e._frameState),tc.update()}var U_t=new B;function D_t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=n_t;let r=y(e.backgroundColor,B.BLACK);e._hdr&&(r=B.clone(r,U_t),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Xp?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,x_t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function SS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function B_t(e){return e._picking.updateMostDetailedRayPicks(e)}li.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);ySe(this,o,e),t.newFrame=!0}SS(this,N_t),this.primitives.show&&(SS(this,B_t),SS(this,O_t),SS(this,Y_t),i||SS(this,H_t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),SS(this,D_t)),M_t(this,i),SS(this,k_t),w_t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};li.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};li.prototype.requestRender=function(){this._renderRequested=!0};li.prototype.clampLineWidth=function(e){return Math.max(At.minimumAliasedLineWidth,Math.min(e,At.maximumAliasedLineWidth))};li.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};li.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Hy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return wA.fromKeyframeNode(o,s,c,a)};li.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=r9(s,t,n,i);if(!l(a))return;let c=a9(r,n,i);if(!l(c))return;let d=new s9(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};li.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};li.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};li.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};li.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function O_t(e){let t=e._frameState;G7.camera=t.camera,G7.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,G7)}function Y_t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;E7.camera=e.preloadFlightCamera,E7.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,E7)}function H_t(e){e.primitives.updateForPass(e._frameState,i_t)}li.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};li.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};li.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};li.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};li.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};li.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};li.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};li.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};li.prototype.cartesianToCanvasCoordinates=function(e,t){return Di.worldToWindowCoordinates(this,e,t)};li.prototype.completeMorph=function(){this._transitioner.completeMorph()};li.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};li.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};li.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function z_t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}li.prototype.setTerrain=function(e){return z_t(this,e),e};li.prototype.isDestroyed=function(){return!1};li.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),me(this)};var c9=li;var V8i=T(S(),1);var Kji=T(S(),1),RL=`float interpolateByDistance(vec4 nearFarScalar, float distance)
{
    float startDistance = nearFarScalar.x;
    float startValue = nearFarScalar.y;
    float endDistance = nearFarScalar.z;
    float endValue = nearFarScalar.w;
    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
    return mix(startValue, endValue, t);
}

void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
{
    float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;

    // Adjustment to the atmosphere radius applied based on the camera height.
    float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
    float distanceAdjustMax = czm_ellipsoidRadii.x;
    float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
    float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);

    // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
    // for the position on the ellipsoid.
    float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
    float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;

    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);

    underTranslucentGlobe = 0.0;

    // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
    #if defined(GLOBE_TRANSLUCENT)

        // Check for intersection with the inner radius of the atmopshere.
        czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
        if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {

            // Compute position on globe.
            vec3 direction = normalize(positionWC);
            czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
            czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
            vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);

            // Control the color using the camera angle.
            float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));

            // Control the opacity using the distance from Earth.
            opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
            vec3 horizonColor = vec3(0.1, 0.2, 0.3);
            vec3 nearColor = vec3(0.0);

            rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);

            // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
            underTranslucentGlobe = 1.0;
            return;
        }
    #endif

    computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );

    // Alter the opacity based on how close the viewer is to the ground.
    // (0.0 = At edge of atmosphere, 1.0 = On ground)
    float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
    opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);

    // Alter alpha based on time of day (0.0 = night , 1.0 = day)
    float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
    opacity *= pow(nightAlpha, 0.5);
}
`;var Qji=T(S(),1),l9=`in vec3 v_outerPositionWC;

uniform vec3 u_hsbShift;

#ifndef PER_FRAGMENT_ATMOSPHERE
in vec3 v_mieColor;
in vec3 v_rayleighColor;
in float v_opacity;
in float v_translucent;
#endif

void main (void)
{
    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);

    vec3 mieColor;
    vec3 rayleighColor;
    float opacity;
    float translucent;

    #ifdef PER_FRAGMENT_ATMOSPHERE
        computeAtmosphereScattering(
            v_outerPositionWC,
            lightDirection,
            rayleighColor,
            mieColor,
            opacity,
            translucent
        );
    #else
        mieColor = v_mieColor;
        rayleighColor = v_rayleighColor;
        opacity = v_opacity;
        translucent = v_translucent;
    #endif

    vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);

    #ifndef HDR
        color.rgb = czm_pbrNeutralTonemapping(color.rgb);
        color.rgb = czm_inverseGamma(color.rgb);
    #endif

    #ifdef COLOR_CORRECT
        const bool ignoreBlackPixels = true;
        color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
    #endif

    // For the parts of the sky atmosphere that are not behind a translucent globe,
    // we mix in the default opacity so that the sky atmosphere still appears at distance.
    // This is needed because the opacity in the sky atmosphere is initially adjusted based
    // on the camera height.
    if (translucent == 0.0) {
        color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
    }

    out_FragColor = color;
}
`;var qji=T(S(),1),d9=`in vec4 position;

out vec3 v_outerPositionWC;

#ifndef PER_FRAGMENT_ATMOSPHERE
out vec3 v_mieColor;
out vec3 v_rayleighColor;
out float v_opacity;
out float v_translucent;
#endif

void main(void)
{
    vec4 positionWC = czm_model * position;
    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);

    #ifndef PER_FRAGMENT_ATMOSPHERE
        computeAtmosphereScattering(
            positionWC.xyz,
            lightDirection,
            v_rayleighColor,
            v_mieColor,
            v_opacity,
            v_translucent
        );
    #endif

    v_outerPositionWC = positionWC.xyz;
    gl_Position = czm_modelViewProjection * position;
}
`;function ZL(e){e=y(e,ne.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=A.fromScale(n),this._modelMatrix=new A,this._command=new $e({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(ZL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ZL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var P7=new A;ZL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=A.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,P7),o=A.multiplyTransformation(i,Po.Y_UP_TO_Z_UP,P7),r=A.multiply(this._scaleMatrix,o,P7);A.clone(r,this._modelMatrix);let s=e.context,a=K_t(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Us.createGeometry(new Us({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Xe.POSITION_ONLY}));u.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:Fn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),u.renderState=Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let h=a|d<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new De({defines:p,sources:[ch,RL,d9]}),f=new De({defines:p,sources:[ch,RL,l9]});this._spSkyAtmosphere=$t.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function K_t(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}ZL.prototype.isDestroyed=function(){return!1};ZL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),me(this)};var u9=ZL;var j8i=T(S(),1);var R8i=T(S(),1),m9=`uniform samplerCube u_cubeMap;

in vec3 v_texCoord;

void main()
{
    vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
    out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
}
`;var G8i=T(S(),1),h9=`in vec3 position;
out vec3 v_texCoord;

void main()
{
    vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
    gl_Position = czm_projection * vec4(p, 1.0);
    v_texCoord = position.xyz;
}
`;function EL(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new $e({modelMatrix:A.clone(A.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}EL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?dE(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new xr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY})),c=this._attributeLocations=Fn.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Me.STATIC_DRAW}),s.renderState=Ue.fromCache({blending:un.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new De({defines:[t?"HDR":""],sources:[m9]});s.shaderProgram=$t.fromCache({context:r,vertexShaderSource:h9,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};EL.prototype.isDestroyed=function(){return!1};EL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),me(this)};function GL(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}EL.createEarthSkyBox=function(){return new EL({sources:{positiveX:GL("px"),negativeX:GL("mx"),positiveY:GL("py"),negativeY:GL("my"),positiveZ:GL("pz"),negativeZ:GL("mz")}})};var f9=EL;var W7i=T(S(),1);var $8i=T(S(),1),p9=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color = texture(u_texture, v_textureCoordinates);
    out_FragColor = czm_gammaCorrect(color);
}
`;var t7i=T(S(),1),b9=`uniform float u_radiusTS;

in vec2 v_textureCoordinates;

vec2 rotate(vec2 p, vec2 direction)
{
    return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
}

vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
{
    vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
    float radius = length(rotatedPosition) * lengthScalar;
    float burst = 1.0 - smoothstep(0.0, 0.55, radius);
    return vec4(burst);
}

void main()
{
    float lengthScalar = 2.0 / sqrt(2.0);
    vec2 position = v_textureCoordinates - vec2(0.5);
    float radius = length(position) * lengthScalar;
    float surface = step(radius, u_radiusTS);
    vec4 color = vec4(vec2(1.0), surface + 0.2, surface);

    float glow = 1.0 - smoothstep(0.0, 0.55, radius);
    color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;

    vec4 burst = vec4(0.0);

    // The following loop has been manually unrolled for speed, to
    // avoid sin() and cos().
    //
    //for (float i = 0.4; i < 3.2; i += 1.047) {
    //    vec2 direction = vec2(sin(i), cos(i));
    //    burst += 0.4 * addBurst(position, direction, lengthScalar);
    //
    //    direction = vec2(sin(i - 0.08), cos(i - 0.08));
    //    burst += 0.3 * addBurst(position, direction, lengthScalar);
    //}

    burst += 0.4 * addBurst(position, vec2(0.38942,  0.92106), lengthScalar);  // angle == 0.4
    burst += 0.4 * addBurst(position, vec2(0.99235,  0.12348), lengthScalar);  // angle == 0.4 + 1.047
    burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);  // angle == 0.4 + 1.047 * 2.0

    burst += 0.3 * addBurst(position, vec2(0.31457,  0.94924), lengthScalar);  // angle == 0.4 - 0.08
    burst += 0.3 * addBurst(position, vec2(0.97931,  0.20239), lengthScalar);  // angle == 0.4 + 1.047 - 0.08
    burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);  // angle == 0.4 + 1.047 * 2.0 - 0.08

    // End of manual loop unrolling.

    color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;

    out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
}
`;var i7i=T(S(),1),g9=`in vec2 direction;

uniform float u_size;

out vec2 v_textureCoordinates;

void main() 
{
    vec4 position;
    if (czm_morphTime == 1.0)
    {
        position = vec4(czm_sunPositionWC, 1.0);
    }
    else
    {
        position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
    }
    
    vec4 positionEC = czm_view * position;
    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
    
    vec2 halfSize = vec2(u_size * 0.5);
    halfSize *= ((direction * 2.0) - 1.0);
    
    gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
    
    v_textureCoordinates = direction;
}
`;function x9(){this.show=!0,this._drawCommand=new $e({primitiveType:we.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(x9.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var J_t=new D,Q_t=new D,j_t=new se,y9=new se;x9.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let R=Math.max(r,s);R=Math.pow(2,Math.ceil(Math.log(R)/Math.log(2))-2),R=Math.max(1,R);let G=n?o.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._texture=new vt({context:o,width:R,height:R,pixelFormat:it.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,v={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new wc({fragmentShaderSource:b9,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let R={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let I=xt.createVertexBuffer({context:o,typedArray:G,usage:Me.STATIC_DRAW}),v=[{index:R.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],P=xt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=$t.fromCache({context:o,vertexShaderSource:g9,fragmentShaderSource:p9,attributeLocations:R}),a.renderState=Ue.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,h=this._boundingVolume2D;m.clone(c,u.center),h.center.x=d.z,h.center.y=d.x,h.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,h.radius=u.radius,i===oe.SCENE3D?le.clone(u,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=Di.computeActualEllipsoidPosition(e,c,y9),g=m.magnitude(m.subtract(p,e.camera.position,y9)),f=o.uniformState.projection,x=j_t;x.x=0,x.y=0,x.z=-g,x.w=1;let _=A.multiplyByVector(f,x,y9),C=Di.clipToGLWindowCoordinates(t.viewport,_,J_t);x.x=W.SOLAR_RADIUS;let V=A.multiplyByVector(f,x,y9),L=Di.clipToGLWindowCoordinates(t.viewport,V,Q_t);return this._size=D.magnitude(D.subtract(L,C,y9)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};x9.prototype.isDestroyed=function(){return!1};x9.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),me(this)};var _9=x9;var M6i=T(S(),1);var _6i=T(S(),1);var RSe=T(qM(),1);var v7i=T(S(),1);function q_t(e,t,n){return`    float clipDistance = clip(gl_FragCoord, ${e}, ${t}); 
    vec4 clippingPlanesEdgeColor = vec4(1.0); 
    clippingPlanesEdgeColor.rgb = ${n}.rgb; 
    float clippingPlanesEdgeWidth = ${n}.a; 
    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) 
    { 
        out_FragColor = clippingPlanesEdgeColor;
    } 
`}var T9=q_t;var A7i=T(S(),1);var $_t={modifyFragmentShader:function(t){return t=De.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; 
void main() 
{ 
#ifndef SHADOW_MAP
    if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; 
    if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; 
#endif
    czm_splitter_main(); 
} 
`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},IL=$_t;var CS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function S9(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=B.clone(B.DARKGRAY),this._highlightColor=B.clone(B.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=CS.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=A.clone(A.IDENTITY),this._modelMatrix=A.clone(A.IDENTITY),this.time=0,this.shadows=Tn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,kr.NONE),this._splittingEnabled=!1,this._error=void 0,eTt(this,e)}Object.defineProperties(S9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return B.clone(this._highlightColor)},set:function(e){this._highlightColor=B.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function eTt(e,t){let n=hT.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=bb.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=CS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=B.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var tTt=new m,nTt=new m,iTt=new m,VSe,nO;function oTt(e){if(!l(nO)){VSe=new RSe.default(0),nO=new Array(e);for(let t=0;t<e;++t)nO[t]=VSe.random()}return nO}function rTt(e){let n=e.length/3,i=Math.min(n,20),o=oTt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,tTt),c=m.fromElements(s,s,s,nTt);for(let u=0;u<i;++u){let h=Math.floor(o[u]*n),p=m.unpack(e,h*3,iTt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let d=le.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function LSe(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(_t("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var sTt=new se,aTt=new se,cTt=new B,ZSe=0,iO=1,M7=2,GSe=3,lTt=4,v7=new A,dTt=new A;function uTt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,R=e._hasNormals,G=e._hasBatchIds,I,v,P=[],w={};if(e._styleableShaderAttributes=w,u){let U=lTt;for(let Y in d)if(d.hasOwnProperty(Y)){let k=d[Y],H=LSe(k.typedArray,Y);I=k.componentCount,v=Q.fromTypedArray(H);let K=xt.createVertexBuffer({context:n,typedArray:H,usage:Me.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:U,vertexBuffer:K,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(te),w[Y]={location:U,componentCount:I},++U}}let M=xt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=M.sizeInBytes;let b;L&&(b=xt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let Z;R&&(Z=xt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=Z.sizeInBytes);let E;G&&(c.typedArray=LSe(c.typedArray,"batchIds"),E=xt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let X=[];if(h?v=Q.UNSIGNED_SHORT:p?v=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:v=Q.FLOAT,X.push({index:ZSe,vertexBuffer:M,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=rTt(r.typedArray)),L)if(C)X.push({index:iO,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=V?4:3;X.push({index:iO,vertexBuffer:b,componentsPerAttribute:U,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}R&&(g?(I=2,v=Q.UNSIGNED_BYTE):f?(I=2,v=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(I=3,v=Q.FLOAT),X.push({index:M7,vertexBuffer:Z,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&X.push({index:GSe,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(X=X.concat(P));let F=new ni({context:n,attributes:X}),N={depthTest:{enabled:!0}},O={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Ee.CESIUM_3D_TILE&&(N.stencilTest=Ut.setCesium3DTileBit(),N.stencilMask=Ut.CESIUM_3D_TILE_MASK,O.stencilTest=Ut.setCesium3DTileBit(),O.stencilMask=Ut.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(N),e._translucentRenderState=Ue.fromCache(O),e._drawCommand=new $e({boundingVolume:new le,cull:e._cull,modelMatrix:new A,primitiveType:we.POINTS,vertexArray:F,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Ee.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function mTt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=sTt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===oe.SCENE2D||c instanceof an?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return B.TRANSPARENT;let c=B.clone(a.edgeColor,cTt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return A.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);A.multiply(n.uniformState.view3D,c,v7);let d=A.multiply(v7,a.modelMatrix,v7);return A.inverseTranspose(d,dTt)}};IL.addUniforms(e,s),(i||o||r)&&(s=St(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=aTt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function w7(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function F7(e,t){e=e.slice(e.indexOf(`
`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function A7(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var hTt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function fTt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,R=e.clippingPlanes,G=e._attenuation,I,v,P,w=g,M=Ye(hTt),b={},Z=e._styleableShaderAttributes;for(o in Z)Z.hasOwnProperty(o)&&(r=Z[o],M[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let de={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${xe}`,M,de),v=n.getShowShaderFunction(`getShowFromStyle${xe}`,M,de),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,M,de),l(I)&&de.translucent&&(w=!0)}e._styleTranslucent=w;let E=l(I),X=l(v),F=l(P),N=e.isClipped,O=[],U=[];E&&(w7(I,O),F7(I,U)),X&&(w7(v,O),F7(v,U)),F&&(w7(P,O),F7(P,U));let Y=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in Z)if(Z.hasOwnProperty(o)){r=Z[o];let de=O.indexOf(r.location)>=0,xe=A7(L,r.location);xe.enabled=de}let H=f&&(!E||Y);if(f){let de=A7(L,iO);de.enabled=H}let K=x&&(V||C||k);if(x){let de=A7(L,M7);de.enabled=K}let te={a_position:ZSe};H&&(te.a_color=iO),K&&(te.a_normal=M7),_&&(te.a_batchId=GSe);let z="",j=O.length;for(i=0;i<j;++i){let de=O[i];r=b[de];let xe=r.componentCount,Ce=`czm_3dtiles_property_${de}`,Ie;xe===1?Ie="float":Ie=`vec${xe}`,z+=`in ${Ie} ${Ce}; 
`,te[Ce]=r.location}mTt(e,t);let ee=`in vec3 a_position; 
out vec4 v_color; 
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; 
uniform vec4 u_constantColor; 
uniform vec4 u_highlightColor; 
`;ee+=`float u_pointSize; 
float tiles3d_tileset_time; 
`,G&&(ee+=`float u_geometricError; 
float u_depthMultiplier; 
`),ee+=z,H&&(g?ee+=`in vec4 a_color; 
`:p?ee+=`in float a_color; 
const float SHIFT_RIGHT_11 = 1.0 / 2048.0; 
const float SHIFT_RIGHT_5 = 1.0 / 32.0; 
const float SHIFT_LEFT_11 = 2048.0; 
const float SHIFT_LEFT_5 = 32.0; 
const float NORMALIZE_6 = 1.0 / 64.0; 
const float NORMALIZE_5 = 1.0 / 32.0; 
`:ee+=`in vec3 a_color; 
`),K&&(u||h?ee+=`in vec2 a_normal; 
`:ee+=`in vec3 a_normal; 
`),_&&(ee+=`in float a_batchId; 
`),(c||d||h)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; 
`),E&&(ee+=I),X&&(ee+=v),F&&(ee+=P),ee+=`void main() 
{ 
    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; 
    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; 
`,G&&(ee+=`    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; 
    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; 
`),H?g?ee+=`    vec4 color = a_color; 
`:p?ee+=`    float compressed = a_color; 
    float r = floor(compressed * SHIFT_RIGHT_11); 
    compressed -= r * SHIFT_LEFT_11; 
    float g = floor(compressed * SHIFT_RIGHT_5); 
    compressed -= g * SHIFT_LEFT_5; 
    float b = compressed; 
    vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); 
    vec4 color = vec4(rgb, 1.0); 
`:ee+=`    vec4 color = vec4(a_color, 1.0); 
`:ee+=`    vec4 color = u_constantColor; 
`,c||d?ee+=`    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; 
`:ee+=`    vec3 position = a_position; 
`,ee+=`    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); 
`,K?(u?ee+=`    vec3 normal = czm_octDecode(a_normal); 
`:h?ee+=`    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; 
`:ee+=`    vec3 normal = a_normal; 
`,ee+=`    vec3 normalEC = czm_normal * normal; 
`):ee+=`    vec3 normal = vec3(1.0); 
`,E&&(ee+=`    color = getColorFromStyle(position, position_absolute, color, normal); 
`),X&&(ee+=`    float show = float(getShowFromStyle(position, position_absolute, color, normal)); 
`),F?ee+=`    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; 
`:G?ee+=`    vec4 positionEC = czm_modelView * vec4(position, 1.0); 
    float depth = -positionEC.z; 
    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); 
`:ee+=`    gl_PointSize = u_pointSize; 
`,ee+=`    color = color * u_highlightColor; 
`,K&&V&&(ee+=`    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); 
    diffuseStrength = max(diffuseStrength, 0.4); 
    color.xyz *= diffuseStrength * czm_lightColor; 
`),ee+=`    v_color = color; 
    gl_Position = czm_modelViewProjection * vec4(position, 1.0); 
`,K&&C&&(ee+=`    float visible = step(-normalEC.z, 0.0); 
    gl_Position *= visible; 
    gl_PointSize *= visible; 
`),X&&(ee+=`    gl_Position.w *= float(show); 
    gl_PointSize *= float(show); 
`),ee+=`} 
`;let fe=`in vec4 v_color; 
`;N&&(fe+=`uniform highp sampler2D u_clippingPlanes; 
uniform mat4 u_clippingPlanesMatrix; 
uniform vec4 u_clippingPlanesEdgeStyle; 
`,fe+=`
`,fe+=f0(R,s),fe+=`
`),fe+=`void main() 
{ 
    out_FragColor = czm_gammaCorrect(v_color); 
`,N&&(fe+=T9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),fe+=`} 
`,e.splitDirection!==kr.NONE&&(fe=IL.modifyFragmentShader(fe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(fe=e._fragmentShaderLoaded(fe));let Te=e._drawCommand;l(Te.shaderProgram)&&Te.shaderProgram.destroy(),Te.shaderProgram=$t.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:fe,attributeLocations:te});try{Te.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function pTt(e,t){if(e._decodingState===CS.READY)return!1;if(e._decodingState===CS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Sb.decodePointCloud(i,t);l(o)&&(e._decodingState=CS.DECODING,o.then(function(r){e._decodingState=CS.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(h){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];l(g)||(g={}),g[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=CS.FAILED,e._error=r}))}return!0}var bTt=new se,gTt=new m;S9.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(pTt(this,t))return;let i=!1,o=!A.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(uTt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){A.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(A.clone(this._modelMatrix,d),l(this._rtcCenter)&&A.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&A.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=A.getColumn(d,3,bTt);se.equals(p,se.UNIT_W)||Pt.basisTo2D(h,d,d)}let u=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,u),this._cull){let h=u.center;A.multiplyByPoint(d,h,h);let p=A.getScale(d,gTt);u.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==kr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&fTt(this,e,this._style),this._drawCommand.castShadows=Tn.castShadows(this.shadows),this._drawCommand.receiveShadows=Tn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ee.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};S9.prototype.isDestroyed=function(){return!1};S9.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),me(this)};var C9=S9;function LS(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this.shadows=y(e.shadows,Tn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new Pf(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Eb,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(LS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function yTt(e){return`uniform vec4 czm_pickColor;
${e}`}function xTt(e){return function(t){return St(t,{czm_pickColor:function(){return e._pickId.color}})}}function _Tt(){return"czm_pickColor"}LS.prototype.makeStyleDirty=function(){this._styleDirty=!0};LS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var TTt=new q;function k7(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function VS(e,t){return e._intervals.indexOf(t.start)}function STt(e,t){let n=e._intervals,i=e._clock,o=k7(e);if(o===0)return;let r=e._getAverageLoadTime(),s=q.addSeconds(i.currentTime,r*o,TTt),a=n.indexOf(s),c=VS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function CTt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function VTt(e,t,n){let i=k7(e),o=VS(e,t),r=VS(e,n);return i>=0?o>=r:o<=r}function ISe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function LTt(e,t,n){let i=VS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?A.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:xi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ze.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new C9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:yTt,uniformMapLoaded:xTt(e),pickIdLoaded:_Tt})}).catch(ISe(e,c))}return r}function RTt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function ZTt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(XSe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(xi()-t.timestamp)/1e3;RTt(e,a)}}t.touchedFrameNumber=i.frameNumber}var GTt=new A;function ETt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function ITt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var XTt=new Pf;function XSe(e,t,n,i){let o=y(e.shading,XTt),r=t.pointCloud,s=y(t.transform,A.IDENTITY);r.modelMatrix=A.multiplyTransformation(e.modelMatrix,s,GTt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=ETt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=ITt(e);try{r.update(i)}catch(a){ISe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function N7(e,t,n,i){let o=LTt(e,t,i);ZTt(e,o,n,i)}function WTt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function WSe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function PTt(e,t){let n=VS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function ESe(e,t,n,i,o){return l(n)?n.ready?!0:(N7(e,t,i,o),n.ready):!1}function vTt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=VS(e,n),h=VS(e,t);if(u>=h){for(r=u;r>=h;--r)if(s=c.get(r),a=d[r],ESe(e,s,a,i,o))return s}else for(r=u;r<=h;++r)if(s=c.get(r),a=d[r],ESe(e,s,a,i,o))return s;return t}function wTt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var XL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};LS.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time));let t=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&wTt(this,o,s),XL.timeSinceLoad=t,XL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,h=this._previousInterval,p=this._nextInterval,g=CTt(this);if(!l(g))return;let f=!1,x=k7(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!l(h)||_)&&(h=g),(!l(p)||f||VTt(this,g,p))&&(p=STt(this,g)),h=vTt(this,h,g,XL,e);let C=PTt(this,h);l(C)||(N7(this,h,XL,e),C=this._lastRenderedFrame),l(C)&&XSe(this,C,XL,e),l(p)&&N7(this,p,XL,e);let V=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,R=this.maximumMemoryUsage*1024*1024;L>R&&WSe(this,WTt(e));let I=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,u,a,this.boundingSphere)};LS.prototype.isDestroyed=function(){return!1};LS.prototype.destroy=function(){return WSe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var WL=LS;function wSe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function FTt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function FSe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function ASe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=FSe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function MSe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Go(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Bt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Bt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Xn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Xn(t.creditViewport):n,u=y(t.showRenderLoopErrors,!0),h=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new km,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),ASe(this);try{let p=y(t.ellipsoid,ne.default),g=new c9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=m.UNIT_Z,FSe(this),MSe(this);let f=t.globe;l(f)||(f=new bF(p)),f!==!1&&(g.globe=f,g.globe.shadows=y(t.terrainShadows,Tn.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ne.WGS84.equals(p)&&(x=f9.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new _9,ne.WGS84.equals(p)&&(g.moon=new xF));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new u9(p),_.show=t.globe!==!1&&f.show),_!==!1&&(g.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=Ya.fromWorldImagery()),g.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Cd(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(P,w){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,w)},g.renderError.addEventListener(this._onRenderError);let L=t.dataSources,R=!1;l(L)||(L=new Uv,R=!0);let G=new lw({scene:g,dataSourceCollection:L}),I=new ar;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=L,this._destroyDataSourceCollection=R,this._dataSourceDisplay=G,this._eventHelper=I,this._canAnimateUpdateCallback=this._updateCanAnimate,I.add(this._clock.onTick,Go.prototype._onTick,this),I.add(g.morphStart,Go.prototype._clearTrackedObject,this),I.add(L.dataSourceAdded,Go.prototype._onDataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._onDataSourceRemoved,this),I.add(g.postRender,Go.prototype._postRender,this);let v=L.length;for(let P=0;P<v;P++)this._dataSourceAdded(L,L.get(P));this._dataSourceAdded(void 0,G.defaultDataSource),I.add(L.dataSourceAdded,Go.prototype._dataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:',p),p}}Object.defineProperties(Go.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&FTt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,U7(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(A.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,wSe(this.clock,e))}}});Go.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=bf(n);d||(typeof n=="string"&&(n=new Error(n)),t=bf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${f}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(f)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Go.prototype.isDestroyed=function(){return!1};Go.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),me(this)};Go.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,ASe(this),MSe(this),this._scene.requestRender())};Go.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Go.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Go.prototype._onEntityCollectionChanged,this)};Go.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Go.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Go.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};Go.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)&&l(i.boundingSphere)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere)===dt.DONE&&i.update(t,i.boundingSphere)}};Go.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Go.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Go.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&wSe(this.clock,e)};Go.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Go.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Go.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Go.prototype.zoomTo=function(e,t){return NSe(this,e,{offset:t},!1)};Go.prototype.flyTo=function(e,t){return NSe(this,e,t,!0)};function NSe(e,t,n,i){U7(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Ya){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return KT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof WL||r instanceof Hy){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function V9(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function U7(e){let t=e._zoomPromise;l(t)&&(V9(e),e._completeZoom(!1))}Go.prototype._postRender=function(){ATt(this),MTt(this)};var PSe=new le;function ATt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new Pu(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(A.IDENTITY),e._completeZoom(!0)),V9(e)}if(t instanceof WL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),u()});return}if(t instanceof bs||t instanceof Hy){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),V9(e);return}let a=t,c=[];for(let u=0,h=a.length;u<h;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,PSe);if(p===dt.PENDING)return;p!==dt.FAILED&&c.push(le.clone(PSe))}if(c.length===0){U7(e);return}e.trackedEntity=void 0;let d=le.fromBoundingSpheres(c);e._zoomIsFlight?(V9(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(A.IDENTITY),V9(e),e._completeZoom(!0))}var vSe=new le;function MTt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=J.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,vSe);if(r===dt.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==dt.FAILED?vSe:void 0;e._entityView=new uw(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var L9=Go;var Sqi=T(S(),1),R9=`uniform sampler2D u_noiseTexture;
uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
in vec2 v_offset;
in vec3 v_maximumSize;
in vec4 v_color;
in float v_slice;
in float v_brightness;

float wrap(float value, float rangeLength) {
    if(value < 0.0) {
        float absValue = abs(value);
        float modValue = mod(absValue, rangeLength);
        return mod(rangeLength - modValue, rangeLength);
    }
    return mod(value, rangeLength);
}

vec3 wrapVec(vec3 value, float rangeLength) {
    return vec3(wrap(value.x, rangeLength),
                wrap(value.y, rangeLength),
                wrap(value.z, rangeLength));
}

vec2 voxelToUV(vec3 voxelIndex) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    float noiseTextureRows = u_noiseTextureDimensions.y;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;

    float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
    vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
                                            inverseNoiseTextureRows / textureSliceWidth);
    vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
    float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
    float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);

    float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
    float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
    return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
}

// Interpolate a voxel with its neighbor (along the positive X-axis)
vec4 lerpSamplesX(vec3 voxelIndex, float x) {
    vec2 uv0 = voxelToUV(voxelIndex);
    vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
    vec4 sample0 = texture(u_noiseTexture, uv0);
    vec4 sample1 = texture(u_noiseTexture, uv1);
    return mix(sample0, sample1, x);
}

vec4 sampleNoiseTexture(vec3 position) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
    vec3 lerpValue = fract(recenteredPos);
    vec3 voxelIndex = floor(recenteredPos);

    vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
    vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
    vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
    vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);

    vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
    vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
    return mix(yLerp0, yLerp1, lerpValue.z);
}

// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
bool intersectSphere(vec3 origin, vec3 dir, float slice,
                     out vec3 point, out vec3 normal) {
    float A = dot(dir, dir);
    float B = dot(origin, dir);
    float C = dot(origin, origin) - 0.25;
    float discriminant = (B * B) - (A * C);
    if(discriminant < 0.0) {
        return false;
    }
    float root = sqrt(discriminant);
    float t = (-B - root) / A;
    if(t < 0.0) {
        t = (-B + root) / A;
    }
    point = origin + t * dir;

    if(slice >= 0.0) {
        point.z = (slice / 2.0) - 0.5;
        if(length(point) > 0.5) {
            return false;
        }
    }

    normal = normalize(point);
    point -= czm_epsilon2 * normal;
    return true;
}

// Transforms the ray origin and direction into unit sphere space,
// then transforms the result back into the ellipsoid's space.
bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
                        out vec3 point, out vec3 normal) {
    if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
        return false;
    }

    vec3 o = (origin - center) / scale;
    vec3 d = dir / scale;
    vec3 p, n;
    bool intersected = intersectSphere(o, d, slice, p, n);
    if(intersected) {
        point = (p * scale) + center;
        normal = n;
    }
    return intersected;
}

// Assume that if phase shift is being called for octave i,
// the frequency is of i - 1. This saves us from doing extra
// division / multiplication operations.
vec2 phaseShift2D(vec2 p, vec2 freq) {
    return (czm_pi / 2.0) * sin(freq.yx * p.yx);
}

vec2 phaseShift3D(vec3 p, vec2 freq) {
    return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
}

// The cloud texture function derived from Gardner's 1985 paper,
// "Visual Simulation of Clouds."
// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
const float T0    = 0.6;  // contrast of the texture pattern
const float k     = 0.1;  // computed to produce a maximum value of 1
const float C0    = 0.8;  // coefficient
const float FX0   = 0.6;  // frequency X
const float FY0   = 0.6;  // frequency Y
const int octaves = 5;

float T(vec3 point) {
    vec2 sum = vec2(0.0);
    float Ci = C0;
    vec2 FXY = vec2(FX0, FY0);
    vec2 PXY = vec2(0.0);
    for(int i = 1; i <= octaves; i++) {
        PXY = phaseShift3D(point, FXY);
        Ci *= 0.707;
        FXY *= 2.0;
        vec2 sinTerm = sin(FXY * point.xy + PXY);
        sum += Ci * sinTerm + vec2(T0);
    }
    return k * sum.x * sum.y;
}

const float a = 0.5;  // fraction of surface reflection due to ambient or scattered light,
const float t = 0.4;  // fraction of texture shading
const float s = 0.25; // fraction of specular reflection

float I(float Id, float Is, float It) {
    return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
}

const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));

vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
               float brightness) {
    vec3 cloudPoint, cloudNormal;
    if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
                            cloudPoint, cloudNormal)) {
        return vec4(0.0);
    }

    float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);  // diffuse reflection
    float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);   // specular reflection
    float It = T(cloudPoint);                                 // texture function
    float intensity = I(Id, Is, It);
    vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));

    vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
    float W = noise.x;
    float W2 = noise.y;
    float W3 = noise.z;

    // The dot product between the cloud's normal and the ray's direction is greatest
    // in the center of the ellipsoid's surface. It decreases towards the edge.
    // Thus, it is used to blur the areas leading to the edges of the ellipsoid,
    // so that no harsh lines appear.

    // The first (and biggest) layer of worley noise is then subtracted from this.
    // The final result is scaled up so that the base cloud is not too translucent.
    float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
    float TR = pow(ndDot, 3.0) - W; // translucency
    TR *= 1.3;

    // Subtracting the second and third layers of worley noise is more complicated.
    // If these layers of noise were simply subtracted from the current translucency,
    // the shape derived from the first layer of noise would be completely deleted.
    // The erosion of this noise should thus be constricted to the edges of the cloud.
    // However, because the edges of the ellipsoid were already blurred away, mapping
    // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
    // The value of (0.5 - ndDot) provides the best compromise.
    float minusDot = 0.5 - ndDot;

    // Even with the previous calculation, subtracting the second layer of wnoise
    // erode too much of the cloud. The addition of it, however, will detailed
    // volume to the cloud. As long as the noise is only added and not subtracted,
    // the results are aesthetically pleasing.

    // The minusDot product is mapped in a way that it is larger at the edges of
    // the ellipsoid, so a subtraction and min operation are used instead of
    // an addition and max one.
    TR -= min(minusDot * W2, 0.0);

    // The third level of worley noise is subtracted from the result, with some
    // modifications. First, a scalar is added to minusDot so that the noise
    // starts affecting the shape farther away from the center of the ellipsoid's
    // surface. Then, it is scaled down so its impact is not too intense.
    TR -= 0.8 * (minusDot + 0.25) * W3;

    // The texture function's shading does not correlate with the shape of the cloud
    // produced by the layers of noise, so an extra shading scalar is calculated.
    // The darkest areas of the cloud are assigned to be where the noise erodes
    // the cloud the most. This is then interpolated based on the translucency
    // and the diffuse shading term of that point in the cloud.
    float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);

    // To avoid values that are too dark, this scalar is increased by a small amount
    // and clamped so it never goes to zero.
    shading = clamp(shading + 0.2, 0.3, 1.0);

    // Finally, the contrast of the cloud's color is increased.
    vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
    return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
}

void main() {
#ifdef DEBUG_BILLBOARDS
    out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
#endif
    // To avoid calculations with high values,
    // we raycast from an arbitrarily smaller space.
    vec2 coordinate = v_maximumSize.xy * v_offset;

    vec3 ellipsoidScale = 0.82 * v_maximumSize;
    vec3 ellipsoidCenter = vec3(0.0);

    float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
    vec3 eye = vec3(0, 0, -10.0 - zOffset);
    vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
    vec3 rayOrigin = eye;
#ifdef DEBUG_ELLIPSOIDS
    vec3 point, normal;
    if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
                          point, normal)) {
        out_FragColor = v_brightness * v_color;
    }
#else
#ifndef DEBUG_BILLBOARDS
    vec4 cloud = drawCloud(rayOrigin, rayDir,
                           ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
    if(cloud.w < 0.01) {
        discard;
    }
    out_FragColor = cloud;
#endif
#endif
}
`;var Vqi=T(S(),1),Z9=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScaleX;
in vec4 positionLowAndScaleY;
in vec4 packedAttribute0;
in vec4 packedAttribute1;
in vec4 color;

out vec2 v_offset;
out vec3 v_maximumSize;
out vec4 v_color;
out float v_slice;
out float v_brightness;

void main() {
    // Unpack attributes.
    vec3 positionHigh = positionHighAndScaleX.xyz;
    vec3 positionLow = positionLowAndScaleY.xyz;
    vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);

    float show = packedAttribute0.x;
    float brightness = packedAttribute0.y;
    vec2 coordinates = packedAttribute0.wz;
    vec3 maximumSize = packedAttribute1.xyz;
    float slice = packedAttribute1.w;

#ifdef INSTANCED
    vec2 dir = direction;
#else
    vec2 dir = coordinates;
#endif

    vec2 offset = dir - vec2(0.5, 0.5);
    vec2 scaledOffset = scale * offset;
    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;
    positionEC.xy += scaledOffset;
    
    positionEC.xyz *= show;
    gl_Position = czm_projection * positionEC;

    v_offset = offset;
    v_maximumSize = maximumSize;
    v_color = color;
    v_slice = slice;
    v_brightness = brightness;
}
`;var Rqi=T(S(),1),G9=`uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
uniform vec3 u_noiseOffset;
in vec2 v_position;

float wrap(float value, float rangeLength) {
    if(value < 0.0) {
        float absValue = abs(value);
        float modValue = mod(absValue, rangeLength);
        return mod(rangeLength - modValue, rangeLength);
    }
    return mod(value, rangeLength);
}

vec3 wrapVec(vec3 value, float rangeLength) {
    return vec3(wrap(value.x, rangeLength),
                wrap(value.y, rangeLength),
                wrap(value.z, rangeLength));
}

vec3 random3(vec3 p) {
    float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
    float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
    return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
}

// Frequency corresponds to cell size.
// The higher the frequency, the smaller the cell size.
vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    vec3 cell = centerCell + offset;
    cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
    cell += floor(u_noiseOffset / u_noiseDetail);
    vec3 p = offset + random3(cell);
    return p;
}

float worleyNoise(vec3 p, float freq) {
    vec3 centerCell = floor(p * freq);
    vec3 pointInCell = fract(p * freq);
    float shortestDistance = 1000.0;

    for(float z = -1.0; z <= 1.0; z++) {
        for(float y = -1.0; y <= 1.0; y++) {
            for(float x = -1.0; x <= 1.0; x++) {
                vec3 offset = vec3(x, y, z);
                vec3 point = getWorleyCellPoint(centerCell, offset, freq);

                float distance = length(pointInCell - point);
                if(distance < shortestDistance) {
                    shortestDistance = distance;
                }
            }
        }
    }

    return shortestDistance;
}

const float MAX_FBM_ITERATIONS = 10.0;

float worleyFBMNoise(vec3 p, float octaves, float scale) {
    float noise = 0.0;
    float freq = 1.0;
    float persistence = 0.625;
    for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
        if(i >= octaves) {
            break;
        }

        noise += worleyNoise(p * scale, freq * scale) * persistence;
        persistence *= 0.5;
        freq *= 2.0;
    }
    return noise;
}

void main() {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
    float x = mod(v_position.x, textureSliceWidth);
    float y = mod(v_position.y, textureSliceWidth);
    float sliceRow = floor(v_position.y / textureSliceWidth);
    float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;

    vec3 position = vec3(x, y, z);
    position /= u_noiseDetail;
    float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
    float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
    float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
    out_FragColor = vec4(worley0, worley1, worley2, 1.0);
}
`;var Gqi=T(S(),1),E9=`uniform vec3 u_noiseTextureDimensions;
in vec2 position;

out vec2 v_position;

void main()
{
    gl_Position = vec4(position, 0.1, 1.0);

    float textureSliceWidth = u_noiseTextureDimensions.x;
    float noiseTextureRows = u_noiseTextureDimensions.y;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
    vec2 transformedPos = (position * 0.5) + vec2(0.5);
    transformedPos *= textureSliceWidth;
    transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
    transformedPos.y *= noiseTextureRows;
    v_position = transformedPos;
}
`;var Iqi=T(S(),1),I9=`
in vec2 v_textureCoordinates;

void main()
{
    czm_materialInput materialInput;
    
    materialInput.s = v_textureCoordinates.s;
    materialInput.st = v_textureCoordinates;
    materialInput.str = vec3(v_textureCoordinates, 0.0);
    materialInput.normalEC = vec3(0.0, 0.0, -1.0);
    
    czm_material material = czm_getMaterial(materialInput);

    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
}
`;var wqi=T(S(),1);var NTt=new m(1,1,1);function D7(e){e=y(e,NTt),this._dimensions=m.clone(e)}Object.defineProperties(D7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var kTt=new m;D7.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,kTt),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var B7=D7;var Mqi=T(S(),1);function bp(){this.featurePropertiesDirty=!1}Object.defineProperties(bp.prototype,{featuresLength:{get:function(){pe.throwInstantiationError()}},pointsLength:{get:function(){pe.throwInstantiationError()}},trianglesLength:{get:function(){pe.throwInstantiationError()}},geometryByteLength:{get:function(){pe.throwInstantiationError()}},texturesByteLength:{get:function(){pe.throwInstantiationError()}},batchTableByteLength:{get:function(){pe.throwInstantiationError()}},innerContents:{get:function(){pe.throwInstantiationError()}},ready:{get:function(){pe.throwInstantiationError()}},tileset:{get:function(){pe.throwInstantiationError()}},tile:{get:function(){pe.throwInstantiationError()}},url:{get:function(){pe.throwInstantiationError()}},batchTable:{get:function(){pe.throwInstantiationError()}},metadata:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}},group:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}}});bp.prototype.hasProperty=function(e,t){pe.throwInstantiationError()};bp.prototype.getFeature=function(e){pe.throwInstantiationError()};bp.prototype.applyDebugSettings=function(e,t){pe.throwInstantiationError()};bp.prototype.applyStyle=function(e){pe.throwInstantiationError()};bp.prototype.update=function(e,t){pe.throwInstantiationError()};bp.prototype.pick=function(e,t,n){pe.throwInstantiationError()};bp.prototype.isDestroyed=function(){pe.throwInstantiationError()};bp.prototype.destroy=function(){pe.throwInstantiationError()};var O7=bp;var jqi=T(S(),1);var Bqi=T(S(),1);function PL(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,DTt(this,t)}Object.defineProperties(PL.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function UTt(e,t){this.condition=e,this.expression=t}function DTt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new UTt(new Bu(a,t),new Bu(c,t)))}e._runtimeConditions=n}PL.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};PL.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};PL.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=`    ${a===0?"if":"else if"} (${d})
    {
        return ${u};
    }
`}return r=`${i} ${e}
{
${r}    return ${i}(1.0);
}
`,r};PL.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var X9=PL;function Ky(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,BTt(this,e)}function BTt(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Bu(o[r],i))}e._meta=n,e._ready=!0}function rr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Bu(String(t));if(typeof t=="string")return new Bu(t,n);if(l(t.conditions))return new X9(t,n)}else return;return t}function sr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Ky.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=rr(this,e),this._style.show=sr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=rr(this,e),this._style.color=sr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=rr(this,e),this._style.pointSize=sr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=rr(this,e),this._style.pointOutlineColor=sr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=rr(this,e),this._style.pointOutlineWidth=sr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=rr(this,e),this._style.labelColor=sr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=rr(this,e),this._style.labelOutlineColor=sr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=rr(this,e),this._style.labelOutlineWidth=sr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=rr(this,e),this._style.font=sr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=rr(this,e),this._style.labelStyle=sr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=rr(this,e),this._style.labelText=sr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=rr(this,e),this._style.backgroundColor=sr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=rr(this,e),this._style.backgroundPadding=sr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=rr(this,e),this._style.backgroundEnabled=sr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=rr(this,e),this._style.scaleByDistance=sr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=rr(this,e),this._style.translucencyByDistance=sr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=rr(this,e),this._style.distanceDisplayCondition=sr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=rr(this,e),this._style.heightOffset=sr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=rr(this,e),this._style.anchorLineEnabled=sr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=rr(this,e),this._style.anchorLineColor=sr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=rr(this,e),this._style.image=sr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=rr(this,e),this._style.disableDepthTestDistance=sr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=rr(this,e),this._style.horizontalOrigin=sr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=rr(this,e),this._style.verticalOrigin=sr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=rr(this,e),this._style.labelHorizontalOrigin=sr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=rr(this,e),this._style.labelVerticalOrigin=sr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Ky.fromUrl=function(e){return Ze.createIfNeeded(e).fetchJson(e).then(function(n){return new Ky(n)})};Ky.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Ky.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Ky.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Ky.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var RS=Ky;var R$i=T(S(),1);var t$i=T(S(),1);function W9(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new Dx({comparator:W9.comparator})}W9.prototype.addSubtree=function(e){let t=new OTt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};W9.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};W9.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function OTt(e,t){this.subtree=e,this.stamp=t}var P9=W9;function v9(e){e=y(e,y.EMPTY_OBJECT);let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=m.ZERO.clone(),paddingAfter:c=m.ZERO.clone(),globalTransform:d=A.IDENTITY.clone(),shapeTransform:u=A.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:f,maximumTileCount:x}=e;this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=Hh.GLTF,this._minimumValues=g,this._maximumValues=f,this._maximumTileCount=x,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new P9}Object.defineProperties(v9.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});v9.fromUrl=async function(e){let t=Ze.createIfNeeded(e),n=await t.fetchJson();HTt(n);let i=jTt(n,t);await i.load();let{root:o}=n,r=si(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new LT({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=qTt(s,c);Object.assign(d,zTt(o)),d.dimensions=m.unpack(a.dimensions),d.maximumTileCount=YTt(s),l(a.padding)&&(d.paddingBefore=m.unpack(a.padding.before),d.paddingAfter=m.unpack(a.padding.after));let u=new v9(d),h=new ZT(t,o,i.schema);return u._implicitTileset=h,u._availableLevels=h.availableLevels,Ri.unload(i),u};function YTt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(tT.TILESET_TILE_COUNT)}function HTt(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!si(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!si(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!si(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function zTt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=A.unpack(e.transform):n=A.clone(A.IDENTITY),l(t.box))return JTt(t.box,n);if(l(t.region))return KTt(t.region);if(si(t,"3DTILES_bounding_volume_cylinder"))return QTt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function KTt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=A.fromScale(ne.WGS84.radii),c=new m(t,n,r),d=new m(i,o,s);return{shape:Mi.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a,globalTransform:A.clone(A.IDENTITY)}}function JTt(e,t){let n=Gn.unpack(e),i=A.fromRotationTranslation(n.halfAxes,n.center);return{shape:Mi.BOX,minBounds:m.clone(mp.DefaultMinBounds),maxBounds:m.clone(mp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function QTt(e,t){let n=Gn.unpack(e),i=A.fromRotationTranslation(n.halfAxes,n.center);return{shape:Mi.CYLINDER,minBounds:m.clone(hp.DefaultMinBounds),maxBounds:m.clone(hp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function jTt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ri.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ri.getSchemaLoader({schema:i})}function qTt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,f])=>{let{type:x,componentType:_}=f,C=o?.properties[g].min,V=o?.properties[g].max,L=ct.getComponentCount(x),R=kSe(C,L),G=kSe(V,L);return{id:g,type:x,componentType:_,minValue:R,maxValue:G}}),a=s.map(g=>g.id),c=s.map(g=>g.type),d=s.map(g=>g.componentType),u=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=u.some(l);return{className:t,names:a,types:c,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?h:void 0}}function kSe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function $Tt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Kb(a);return o=await eT.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}v9.prototype.requestData=async function(e){e=y(e,y.EMPTY_OBJECT);let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new GT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,d=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await $Tt(this,d);if(!(c?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:f,baseResource:x}=s,_=f[0].getDerivedResource({templateValues:a.getTemplateValues()}),C=x.getDerivedResource({url:_.url});return xS.fromGltf(C)};var Y7=v9;var X$i=T(S(),1);function H7(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(H7.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});H7.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var w9=H7;var Teo=T(S(),1);var P$i=T(S(),1),z7={CUMULUS:0};z7.validate=function(e){return e===z7.CUMULUS};var vL=Object.freeze(z7);var k$i=T(S(),1);function zh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(y(e.scale,new D(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=B.clone(y(e.color,B.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var eSt=zh.SHOW_INDEX=0,tSt=zh.POSITION_INDEX=1,nSt=zh.SCALE_INDEX=2,iSt=zh.MAXIMUM_SIZE_INDEX=3,oSt=zh.SLICE_INDEX=4,rSt=zh.BRIGHTNESS_INDEX=5,sSt=zh.COLOR_INDEX=6;zh.NUMBER_OF_PROPERTIES=7;function ZS(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(zh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,ZS(this,eSt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),ZS(this,tSt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;D.equals(t,e)||(D.clone(e,t),ZS(this,nSt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),ZS(this,iSt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),ZS(this,sSt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,ZS(this,oSt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,ZS(this,rSt))}}});zh.prototype._destroy=function(){this._cloudCollection=void 0};var lu=zh;var du,oO=new m,aSt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},cSt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},lSt=lu.SHOW_INDEX,dSt=lu.POSITION_INDEX,uSt=lu.SCALE_INDEX,mSt=lu.MAXIMUM_SIZE_INDEX,hSt=lu.SLICE_INDEX,fSt=lu.BRIGHTNESS_INDEX,pSt=lu.NUMBER_OF_PROPERTIES,bSt=lu.COLOR_INDEX;function Kh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(pSt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:USe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function USe(e){return function(){return oO.x=e._textureSliceWidth,oO.y=e._noiseTextureRows,oO.z=1/e._noiseTextureRows,oO}}Object.defineProperties(Kh.prototype,{length:{get:function(){return J7(this),this._clouds.length}}});function DSe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Kh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,vL.CUMULUS),n;return t===vL.CUMULUS&&(n=new lu(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Kh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Kh.prototype.removeAll=function(){DSe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function J7(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Kh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Kh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Kh.prototype.get=function(e){return J7(this),this._clouds[e]};var gSt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),ySt=new Uint16Array([0,1,2,0,2,3]);function xSt(e){let t=xt.createVertexBuffer({context:e,typedArray:gSt,usage:Me.STATIC_DRAW}),n=xt.createIndexBuffer({context:e,typedArray:ySt,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var Q7;function _St(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=xt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function TSt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=xt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function SSt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=xt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function CSt(e,t,n){let i=[{index:du.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:du.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:du.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:du.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:du.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:du.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:SSt(e)});let o=n?t:4*t;return new Wp(e,i,o,n)}var K7=new On;function BSe(e,t,n,i){let o,r=n[du.positionHighAndScaleX],s=n[du.positionLowAndScaleY],a=i.position;On.fromCartesian(a,K7);let c=i.scale,d=K7.high,u=K7.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function OSe(e,t,n,i){let o,r=n[du.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function YSe(e,t,n,i){let o,r=n[du.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function HSe(e,t,n,i){let o,r=n[du.color],s=i.color,a=B.floatToByte(s.red),c=B.floatToByte(s.green),d=B.floatToByte(s.blue),u=B.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function VSt(e,t,n,i){BSe(e,t,n,i),OSe(e,t,n,i),YSe(e,t,n,i),HSe(e,t,n,i)}function LSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=xSt(a),o._spNoise=$t.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new vt({context:a,width:r*r/s,height:r*s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:it.RGBA,sampler:new qt({wrapS:Vn.REPEAT,wrapT:Vn.REPEAT,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})});let u=new wc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:USe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function RSt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=CSt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];VSt(e,t,s,c)}n._vaf.commit(Q7(i))}}var ZSt=[];function GSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=ZSt;d.length=0,(c[dSt]||c[uSt])&&d.push(BSe),(c[lSt]||c[fSt])&&d.push(OSe),(c[mSt]||c[hSt])&&d.push(YSe),c[bSt]&&d.push(HSe);let u=d.length,h=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._vaf.commit(Q7(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function ESt(e,t,n,i){let o=t.context,r=e,s=new De({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new De({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=$t.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:du}),r._rs=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function ISt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new $e),u.pass=Ee.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Kh.prototype.update=function(e){if(J7(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&LSt(this,e,E9,G9),this._instanced=e.context.instancedArrays,du=this._instanced?cSt:aSt,Q7=this._instanced?TSt:_St;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?RSt(this,e):r>0&&GSt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&ESt(this,e,Z9,R9),ISt(this,e))};Kh.prototype.isDestroyed=function(){return!1};Kh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),DSe(this._clouds),me(this)};var j7=Kh;var Reo=T(S(),1);var XSt=W.toRadians(30);function q7(e){this._angle=y(e,XSt)}Object.defineProperties(q7.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});q7.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var $7=q7;var Xeo=T(S(),1);function F9(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
`;break}let s=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
${n?"":`in ${i} ${t};
`}out ${i} ${o};
void main()
{
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
${n?`${o} = czm_batchTable_${t}(batchId);
`:`${o} = ${t};
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
}`,a=`in ${i} ${o};
${r}
void main()
{
out_FragColor = getColor();
}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=io.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(F9.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});F9.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;F9.prototype.isTranslucent=io.prototype.isTranslucent;F9.prototype.getRenderState=io.prototype.getRenderState;var e6=F9;var Oeo=T(S(),1);function rO(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._modelMatrix=new A,this.id=e.id,this._id=void 0,this._primitive=void 0}rO.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!A.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=A.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Et({geometry:new $p({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[B.RED,B.RED],arcType:en.NONE}),modelMatrix:A.multiplyByUniformScale(this.modelMatrix,this.length,new A),id:this.id,pickPrimitive:this}),n=new Et({geometry:new $p({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[B.GREEN,B.GREEN],arcType:en.NONE}),modelMatrix:A.multiplyByUniformScale(this.modelMatrix,this.length,new A),id:this.id,pickPrimitive:this}),i=new Et({geometry:new $p({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[B.BLUE,B.BLUE],arcType:en.NONE}),modelMatrix:A.multiplyByUniformScale(this.modelMatrix,this.length,new A),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new es,asynchronous:!1})}this._primitive.update(e)}};rO.prototype.isDestroyed=function(){return!1};rO.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var A9=rO;var Jeo=T(S(),1);function WSt(e){this.direction=m.clone(e.direction),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,1)}var t6=WSt;var cto=T(S(),1);var jeo=T(S(),1),M9=`in vec3 v_positionMC;
in vec3 v_positionEC;
in vec2 v_st;

void main()
{
    czm_materialInput materialInput;

    vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    materialInput.s = v_st.s;
    materialInput.st = v_st;
    materialInput.str = vec3(v_st, 0.0);

    // Convert tangent space material normal to eye space
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);

    // Convert view vector to world space
    vec3 positionToEyeEC = -v_positionEC;
    materialInput.positionToEyeEC = positionToEyeEC;

    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var $eo=T(S(),1),N9=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec2 st;
in float batchId;

out vec3 v_positionMC;
out vec3 v_positionEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionMC = position3DHigh + position3DLow;           // position in model coordinates
    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;     // position in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function GS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,N9),this._fragmentShaderSource=y(e.fragmentShaderSource,M9),this._renderState=io.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(GS.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return GS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});GS.VERTEX_FORMAT=Xe.POSITION_AND_ST;GS.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;GS.prototype.isTranslucent=io.prototype.isTranslucent;GS.prototype.getRenderState=io.prototype.getRenderState;var n6=GS;var bto=T(S(),1);function sd(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,sd.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,sd.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,sd.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,sd.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,sd.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){PSt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){vSt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}sd.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};sd.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new sd({scene:e})),e._frameRateMonitor};Object.defineProperties(sd.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});sd.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};sd.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};sd.prototype.isDestroyed=function(){return!1};sd.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function PSt(e,t){if(e._pauseCount>0)return;let n=xi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Kn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Kn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Kn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function vSt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var k9=sd;var Ito=T(S(),1);var zSe=T(UH(),1);function i6(){this._image=new Image}i6.prototype.isReady=function(){return!0};i6.prototype.shouldDiscardImage=function(e){return e===this._image};function ES(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Hi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new i6),this._errorEvent=new be}Object.defineProperties(ES.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});ES.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new ES(t);return n._metadata=e,n};ES.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};ES.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=Kp.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ho({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=wSt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){II(r.key,d);let u=new Uint8Array(d),h,p=r.protoImagery;if((!l(p)||!p)&&(h=FSt(u)),!l(h)&&(!l(p)||p)){let g=ASt(u);h=g.imageType,u=g.imageData}return!l(h)||!l(u)?o:m_({uint8Array:u,format:h,flipY:!0})})};ES.prototype.pickFeatures=function(e,t,n,i,o){};function wSt(e,t,n,i,o,r){let s=Kp.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function FSt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function ASt(e){let t=zSe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var o6=ES;var Ato=T(S(),1);var MSt=new B(1,1,1,.4),NSt=new B(0,1,0,.05),kSt=new B(0,.5,0,.2);function IS(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Hi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,MSt),this._glowColor=y(e.glowColor,NSt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,kSt),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(IS.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});IS.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};IS.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};IS.prototype.getTileCredits=function(e,t,n){};IS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};IS.prototype.pickFeatures=function(e,t,n,i,o){};var r6=IS;var xio=T(S(),1);var Ono=T(S(),1);var Rno=T(S(),1);var zto=T(S(),1);function Jh(){}Jh._maxDecodingConcurrency=Math.max(Bt.hardwareConcurrency-1,1);Jh._decodeTaskProcessor=new yi("decodeI3S",Jh._maxDecodingConcurrency);Jh._promise=void 0;async function USt(){if(await Jh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Jh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}Jh.decode=async function(e,t,n,i,o){return l(Jh._promise)||(Jh._promise=USt()),Jh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let h=$.fromRotationX(-W.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let g=he.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var U9=Jh;var jto=T(S(),1);function s6(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(s6.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});s6.prototype.load=async function(){return this._data=await Qh.loadJson(this._resource),this._data};var D9=s6;var tno=T(S(),1);function I0(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(I0.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function sO(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function DSt(e){return e==="String"?1:sO(e)}async function BSt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}I0.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=BSt(this).catch(function(e){console.error(e)}),this._loadPromise)};I0.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};I0.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};I0.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};I0.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=sO(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=sO(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};I0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=DSt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};I0.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=sO(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var B9=I0;var cno=T(S(),1);function O9(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(O9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});O9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var OSt=new m,YSt=new m,HSt=new m,zSt=new m,KSt=new m;function a6(e,t,n,i){let o=m.subtract(i,n,OSt),r=m.cross(o,m.subtract(e,n,YSt),zSt),s=m.cross(o,m.subtract(t,n,HSt),KSt);return m.dot(r,s)>=0}var JSt=new m,QSt=new m,jSt=new m,qSt=new m,$St=new m,eCt=new m,tCt=new m,nCt=new m,iCt=new m,oCt=new m;O9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,h;l(u)?h=u.length:h=d.length/3;for(let p=0;p<h;p++){let g,f,x;l(u)?(g=u[p],f=u[p+1],x=u[p+2]):(g=p*3,f=p*3+1,x=p*3+2);let _=m.fromElements(d[g*3],d[g*3+1],d[g*3+2],JSt),C=m.fromElements(d[f*3],d[f*3+1],d[f*3+2],QSt),V=new m(d[x*3],d[x*3+1],d[x*3+2],jSt);if(!a6(i,_,C,V)||!a6(i,C,_,V)||!a6(i,V,_,C))continue;let L=m.subtract(C,_,qSt),R=m.subtract(V,_,$St),G=m.cross(L,R,eCt);if(m.magnitude(G)===0)continue;let I=m.normalize(G,tCt),v=m.subtract(i,_,nCt),P=Math.abs(m.dot(v,I));if(P<o){o=P,r=p;let w=m.magnitudeSquared(m.subtract(i,_,v)),M=m.magnitudeSquared(m.subtract(i,C,iCt)),b=m.magnitudeSquared(m.subtract(i,V,oCt));w<M&&w<b?(a=g,c=_,s=w):M<b?(a=f,c=C,s=M):(a=x,c=V,s=b)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function KSe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(f_(e[i])):t.push(e[i]);return t}O9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let L=this._parent._data.mesh.material.definition;if(L>=0&&L<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[L],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let R="0";if(l(this._layer._data.textureSetDefinitions))for(let G=0;G<this._layer._data.textureSetDefinitions.length;G++){let I=this._layer._data.textureSetDefinitions[G];for(let v=0;v<I.formats.length;v++){let P=I.formats[v];if(P.format==="jpg"){R=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${R}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=KSe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=KSe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:h}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],_=n.length;for(let V=0;V<_;V++){let L=n[V].primitives,R=L.length;for(let G=0;G<R;G++){let I=L[G];if(l(I.material)){for(;I.material>=x.length;){let P=Ye(c,!0);x.push(P)}let v=x[I.material];l(I.extra)&&I.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var wL=O9;function Xc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Xc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Xc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new nm(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Qh.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function JSe(e,t){let n=new B9(e,t);return e._fields[t.name]=n,n.load()}Xc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(JSe(this,i))}return Promise.all(t)};Xc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return JSe(this,o)}return Promise.resolve()};Xc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Xc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Xc.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Xc(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Xc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new wL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new wL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Xc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new D9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Xc.prototype._clearGeometryData=function(){this._geometryData=[]};Xc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=cCt(L.x,L.y,V);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Ra(0,0,0),d=Pt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new ve(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),h=$.inverse(u,new $),p=new A(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),g=A.inverse(p,new A),f=A.clone(p);l(this._parent._globalTransform)&&A.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Xc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Xc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await U9.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function rCt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function sCt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function QSe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await rCt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!sCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Xc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=QSe(this,t);e.push(n)}return Promise.all(e)};nm.prototype._hookedRequestContent=nm.prototype.requestContent;nm.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Ze({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{QSe(e._i3sNode,n)})),e._isLoading=!1,t})}};function aCt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function aO(e,t,n,i){let o=e+t*n;return i[o]}function cCt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=aO(s,a,n.width,n.buffer),h=aO(c,a,n.width,n.buffer),p=aO(s,d,n.width,n.buffer),g=aO(c,d,n.width,n.buffer),f=aCt(o,r,u,h,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(nm.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var FL=Xc;var Wno=T(S(),1);function cO(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(cO.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function c6(e,t){let n=[];for(let i=0;i<e.length;i++){let o=B.byteToFloat(e[i]);i<3?n.push(f_(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function AL(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=c6(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=c6(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=c6(a.color,a.transparency)))}break}}return n}function lCt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=AL(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let h=0;h<d.length;h++){let p=d[h];h===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=AL(o.symbol,t)}return n}}function dCt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(AL(r.symbol,t)))}return i.symbols.push(void 0),i}}cO.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=AL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=AL(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=lCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=AL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=dCt(i,n))}};function jSe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?jSe(s,t,n,i):s}}function uCt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function mCt(e,t,n){let i=t[n],o=uCt(e.ranges,i);return e.symbols[o]}cO.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>jSe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>mCt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var Y9=cO;function ad(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ze({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(ad.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});ad.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new Y9(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};ad.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};ad.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};ad.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new FL(this,t,!0)}else this._rootNode=new FL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};ad.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};ad._fetchJson=function(e){return e.fetchJson()};ad.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=ad._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};ad.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};ad.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ye(e):{},e.outlineColor=B.fromCartesian4(se.fromArray(o))),this._tileset=await bs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};ad.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};ad.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var XS=ad;var Jno=T(S(),1);function lO(e,t){this._dataProvider=e,this._resource=new Ze({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(lO.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});lO.prototype.load=async function(){return this._data=await Qh.loadJson(this._resource),this._data};lO.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var H9=lO;var nio=T(S(),1);function z9(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(z9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});z9._fromData=async function(e,t,n,i){let o=new z9(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=z9._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ze({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Qh.loadJson(o._resource),c=new XS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var K9=z9;var eCe=T(qSe(),1);function xs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(xs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});xs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return me(this)};xs.prototype.isDestroyed=function(){return!1};xs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};xs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};xs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};xs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function hCt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function $Se(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=hCt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=K9._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new H9(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ce.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new XS(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}xs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await xs.loadJson(n),o=new xs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=$Se(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await $Se(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};xs._fetchJson=function(e){return e.fetchJson()};xs.loadJson=async function(e){let t=await xs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(t.error)}return t};xs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ae(`Failed to load binary: ${e.url}`);return t};xs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var fCt=new D;function pCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let h=c.x;h<=d.x;h++)for(let p=c.y;p<=d.y;p++){let g=D.fromElements(h,p,fCt),f=g.toString();if(!o.hasOwnProperty(f)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=x,i.push(x)}}let u=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(h){let p=[];for(let g=0;g<h.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=h[g],_="Geographic";n._projection instanceof Wi&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===Ru.LERC){let V=eCe.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function bCt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await pCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}xs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=bCt(this),this._geoidDataPromise)};xs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};xs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};xs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};xs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Qh=xs;var Gio=T(S(),1);var J9={};J9.createTilesetFromIModelId=async function(e,t){let{exports:n}=await Vs.getExports(e);if(n.length>0&&n.every(a=>a.status===Vs.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===Vs.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Ze({url:r});return bs.fromUrl(s,t)};J9.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Vs.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Vs.RealityDataType.Cesium3DTiles,Vs.RealityDataType.PNTS,Vs.RealityDataType.RealityMesh3DTiles,Vs.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await Vs.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};J9.createDataSourceForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Vs.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Vs.RealityDataType.KML,Vs.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await Vs.getRealityDataURL(e,t,i);return n===Vs.RealityDataType.GeoJSON?Ty.load(r):OT.load(r)};J9.loadGeospatialFeatures=async function(e,t,n){let i=n??1e4,o=`${Vs.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Ze({url:o,headers:{Authorization:`Bearer ${Vs.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return Ty.load(r)};var l6=J9;var Xio=T(S(),1);function tCe(){}Object.defineProperties(tCe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var d6=tCe;var Mio=T(S(),1);var gCt=/\/$/,nCe=new Ct('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function ML(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ze.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();gCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Ct(c))):c=nCe,this._resource=i,this._imageryProvider=new Oa({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ML.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});ML.prototype.getTileCredits=function(e,t,n){};ML.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ML.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ML._defaultCredit=nCe;var u6=ML;var kio=T(S(),1);function m6(e){}m6.prototype.isReady=function(){return!0};m6.prototype.shouldDiscardImage=function(e){return!1};var h6=m6;var Jio=T(S(),1);var yCt=new Ct("MapQuest, Open Street Map and contributors, CC-BY-SA");function uO(e){e=y(e,y.EMPTY_OBJECT);let t=Ze.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new qr({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),r),d=n.positionToTileXY(ce.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),h=y(e.credit,yCt);typeof h=="string"&&(h=new Ct(h)),Oa.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(uO.prototype=Object.create(Oa.prototype),uO.prototype.constructor=uO);var X0=uO;var noo=T(S(),1);var xCt=new D(1,1);function f6(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=B.clone(y(e.startColor,B.WHITE)),this.endColor=B.clone(y(e.endColor,B.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=D.clone(y(e.imageSize,xCt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(f6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var iCe=new m;f6.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,iCe),m.add(this.position,iCe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var NL=f6;var roo=T(S(),1);function oCe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(oCe.prototype,{complete:{get:function(){return this._complete}}});var p6=oCe;var coo=T(S(),1);function rCe(e){}rCe.prototype.emit=function(e){pe.throwInstantiationError()};var b6=rCe;var Coo=T(S(),1);var sCe=new D(1,1);function Q9(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new w9(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=A.clone(y(e.modelMatrix,A.IDENTITY)),this._emitterModelMatrix=A.clone(y(e.emitterModelMatrix,A.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new A,this._startColor=B.clone(y(e.color,y(e.startColor,B.WHITE))),this._endColor=B.clone(y(e.color,y(e.endColor,B.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=D.clone(y(e.imageSize,y(e.minimumImageSize,sCe))),this._maximumImageSize=D.clone(y(e.imageSize,y(e.maximumImageSize,sCe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(Q9.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!A.equals(this._modelMatrix,e),A.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!A.equals(this._emitterModelMatrix,e),A.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){B.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){B.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function _Ct(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let h=0;h<u;++h){let p=new NL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function TCt(e){let t=e._particlePool.pop();return l(t)||(t=new NL),t}function SCt(e,t){e._particlePool.push(t)}function CCt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function VCt(e){l(e._billboard)&&(e._billboard.show=!1)}function aCe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new B(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function LCt(e,t){t.startColor=B.clone(e._startColor,t.startColor),t.endColor=B.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function RCt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var mO=new m;Q9.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Fd),this._updateParticlePool&&(_Ct(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?aCe(this,s):(VCt(s),SCt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=RCt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=A.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=TCt(this),this._emitter.emit(s),m.add(s.position,s.velocity,mO),A.multiplyByPoint(d,mO,mO),s.position=A.multiplyByPoint(d,s.position,s.position),m.subtract(mO,s.position,s.velocity),m.normalize(s.velocity,s.velocity),LCt(this,s),aCe(this,s)}if(this._billboardCollection.update(e),this._previousTime=q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&CCt(this)};Q9.prototype.isDestroyed=function(){return!1};Q9.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var g6=Q9;var Roo=T(S(),1);function uu(){pe.throwInstantiationError()}uu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(uu.prototype,{quadtree:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError}});uu.prototype.update=pe.throwInstantiationError;uu.prototype.beginUpdate=pe.throwInstantiationError;uu.prototype.endUpdate=pe.throwInstantiationError;uu.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;uu.prototype.loadTile=pe.throwInstantiationError;uu.prototype.computeTileVisibility=pe.throwInstantiationError;uu.prototype.showTileThisFrame=pe.throwInstantiationError;uu.prototype.computeDistanceToTile=pe.throwInstantiationError;uu.prototype.isDestroyed=pe.throwInstantiationError;uu.prototype.destroy=pe.throwInstantiationError;var y6=uu;var Xoo=T(S(),1);function x6(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(x6.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});x6.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var _6=x6;var voo=T(S(),1);function j9(){}j9.prototype.evaluate=function(e,t){pe.throwInstantiationError()};j9.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};j9.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};j9.prototype.getVariables=function(){pe.throwInstantiationError()};var T6=j9;var Noo=T(S(),1);function kL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,GCt(this,e)}Object.defineProperties(kL.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});kL.fromWorldTerrain=function(e){return new kL(u_(e))};kL.fromWorldBathymetry=function(e){return new kL(EI(e))};function ZCt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function GCt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){ZCt(e._errorEvent,i)}}var q9=kL;var Doo=T(S(),1);function UL(){}UL.prototype.boundingVolume=void 0;UL.prototype.boundingSphere=void 0;UL.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};UL.prototype.intersectPlane=function(e){pe.throwInstantiationError()};UL.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var S6=UL;var Joo=T(S(),1);function $9(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Hi({ellipsoid:e.ellipsoid}),this._color=y(e.color,B.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties($9.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});$9.prototype.getTileCredits=function(e,t,n){};$9.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};$9.prototype.pickFeatures=function(e,t,n,i,o){};var eM=$9;var qoo=T(S(),1);function C6(e){pe.throwInstantiationError()}C6.prototype.isReady=pe.throwInstantiationError;C6.prototype.shouldDiscardImage=pe.throwInstantiationError;var V6=C6;var ero=T(S(),1),ECt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},L6=Object.freeze(ECt);var mro=T(S(),1);function hO(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=zi.fromType(zi.ColorType,{color:new B(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}hO.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new De({sources:[this._material.shaderSource,I9]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ee.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};hO.prototype.isDestroyed=function(){return!1};hO.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var R6=hO;var pro=T(S(),1);function Z6(){pe.throwInstantiationError()}Object.defineProperties(Z6.prototype,{globalTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shape:{get:pe.throwInstantiationError},minBounds:{get:pe.throwInstantiationError},maxBounds:{get:pe.throwInstantiationError},dimensions:{get:pe.throwInstantiationError},paddingBefore:{get:pe.throwInstantiationError},paddingAfter:{get:pe.throwInstantiationError},names:{get:pe.throwInstantiationError},types:{get:pe.throwInstantiationError},componentTypes:{get:pe.throwInstantiationError},metadataOrder:{get:pe.throwInstantiationError},minimumValues:{get:pe.throwInstantiationError},maximumValues:{get:pe.throwInstantiationError},maximumTileCount:{get:pe.throwInstantiationError},availableLevels:{get:pe.throwInstantiationError},keyframeCount:{get:pe.throwInstantiationError},timeIntervalCollection:{get:pe.throwInstantiationError}});Z6.prototype.requestData=function(e){pe.throwInstantiationError()};var G6=Z6;var yro=T(S(),1);function WS(){pe.throwInstantiationError()}Object.defineProperties(WS.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});WS.prototype.update=pe.throwInstantiationError;WS.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;WS.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;WS.DefaultMinBounds=pe.throwInstantiationError;WS.DefaultMaxBounds=pe.throwInstantiationError;var E6=WS;var vro=T(S(),1);var ICt=new B,XCt=new B,WCt=new B,PCt=new B,cCe=new se,tM=new Uint8Array(4);function lCe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return B.lerp(t.color,n.color,o,i)}function fO(e,t){return{height:e,color:B.clone(t)}}function dCe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?B.equals(t.color,i[n-1].color):!1,a=r?B.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?B.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function vCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],f=W.clamp(g.height,cd._minimumHeight,cd._maximumHeight),x=B.clone(g.color,ICt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(fO(f,x))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||ob(c,function(g,f){return W.sign(g.height-f.height)});let h=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,fO(cd._minimumHeight,c[0].color)),p&&c.splice(c.length,0,fO(cd._maximumHeight,c[c.length-1].color)),c=dCe(c),i.push(c)}return i}function wCt(e){let t=vCt(e),n=[],i=[],o;function r(d,u){n.push(fO(d,u))}function s(d,u,h){let p=B.multiplyByScalar(h,1-u.alpha,PCt);p=B.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,h=0;i=n,n=[];let p=d.length,g=i.length;for(;u<p||h<g;){let f=u<p?d[u]:void 0,x=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,C=h<g?i[h]:void 0,V=h>0?i[h-1]:void 0,L=h<g-1?i[h+1]:void 0;if(l(f)&&l(C)&&f.height===C.height){let R=l(L)&&C.height===L.height,G=!l(V),I=!l(L),v=l(_)&&f.height===_.height,P=!l(x),w=!l(_);R?v?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):P?(r(f.height,C.color),s(f.height,f.color,L.color)):w?(s(f.height,f.color,C.color),r(f.height,L.color)):(s(f.height,f.color,C.color),s(f.height,f.color,L.color)):G?v?(r(f.height,f.color),s(f.height,_.color,C.color)):w?(r(f.height,f.color),r(f.height,C.color)):(P||r(f.height,f.color),s(f.height,f.color,C.color)):I?v?(s(f.height,f.color,C.color),r(f.height,_.color)):P?(r(f.height,C.color),r(f.height,f.color)):w?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):v?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):P?(r(f.height,C.color),s(f.height,f.color,C.color)):w?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=v?2:1,h+=R?2:1}else if(l(f)&&l(C)&&l(V)&&f.height<C.height){let R=lCe(f.height,V,C,WCt);l(x)?l(_)?s(f.height,f.color,R):(s(f.height,f.color,R),r(f.height,R)):(r(f.height,R),s(f.height,f.color,R)),u++}else if(l(C)&&l(f)&&l(x)&&C.height<f.height){let R=lCe(C.height,x,f,XCt);l(V)?l(L)?s(C.height,R,C.color):(s(C.height,R,C.color),r(C.height,R)):(r(C.height,R),s(C.height,R,C.color)),h++}else l(f)&&(!l(C)||f.height<C.height)?(l(C)&&!l(V)&&!l(_)?(r(f.height,f.color),r(f.height,cd._emptyColor),r(C.height,cd._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,cd._emptyColor),r(f.height,cd._emptyColor)),r(f.height,f.color)),u++):l(C)&&(!l(f)||C.height<f.height)&&(r(C.height,C.color),h++)}}return dCe(n)}function cd(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=wCt(n),r=o.length,s,a,c;if(!cd._useFloatTexture(i)){a=je.UNSIGNED_BYTE,c=it.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,cCe),se.pack(cCe,s,g*4)}else{a=je.FLOAT,c=i.webgl2?it.RED:it.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=vt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(tM),h[g*4+0]=tM[0],h[g*4+1]=tM[1],h[g*4+2]=tM[2],h[g*4+3]=tM[3];let p=vt.create({context:i,pixelFormat:it.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR})});return zi.fromType("ElevationBand",{heights:u,colors:p})}cd._useFloatTexture=function(e){return e.floatingPointTexture};cd._maximumHeight=5906376425472;cd._minimumHeight=-5906376425472;cd._emptyColor=new B(0,0,0,0);var I6=cd;var Bro=T(S(),1);async function FCt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),e.onlyUsingWithGoogleGeocoder||_t("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles.  Set the `geocode` property of Viewer constructor options.  You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,Hx.defaultApiKey);if(!l(n))return ACt(t);let i,o=Hx.getDefaultCredit();l(o)&&(i=[o]);let r=new Ze({url:`${Hx.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var uCe={};async function ACt(e){let i=uCe[2275207];l(i)||(i=pd.fromAssetId(2275207),uCe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var X6=FCt;var Qro=T(S(),1);async function MCt(e){let t=await bs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,B.WHITE).toCssColorString();n=new RS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var W6=MCt;var sso=T(S(),1);function NCt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=A.clone(y(e.modelMatrix,A.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Et({geometry:Fn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Et({geometry:Fn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Et({geometry:Fn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Yt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new dn({flat:!0,translucent:!1})})}var P6=NCt;var cso=T(S(),1),v6=`uniform sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
    z_window = czm_reverseLogDepth(z_window);
    float n_range = czm_depthRange.near;
    float f_range = czm_depthRange.far;
    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
    out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
}
`;var bso=T(S(),1);function kCt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,it.RGBA),this.pixelDatatype=y(e.pixelDatatype,je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ze.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Vn.REPEAT:Vn.CLAMP_TO_EDGE;this.sampler=new qt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var w6=kCt;var yso=T(S(),1),UCt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},F6=Object.freeze(UCt);var _so=T(S(),1),DCt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},A6=Object.freeze(DCt);var Cso=T(S(),1);function BCt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${bf(s)}
  with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var M6=BCt;globalThis.CESIUM_VERSION="1.127";var sWo=T(S(),1);var ARo=T(S(),1);var PRo=T(S(),1);var VRo=T(S(),1),nM;typeof ko<"u"&&(nM=ko);(function(){/*!
 * Knockout JavaScript library v3.5.1
 * (c) The Knockout.js team - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,Z){return b===null||typeof b in x?b===Z:!1}function d(b,Z){var E;return function(){E||(E=f.a.setTimeout(function(){E=e,b()},Z))}}function u(b,Z){var E;return function(){clearTimeout(E),E=f.a.setTimeout(b,Z)}}function h(b,Z){Z&&Z!=="change"?Z==="beforeChange"?this.pc(b):this.gb(b,Z):this.qc(b)}function p(b,Z){Z!==null&&Z.s&&Z.s()}function g(b,Z){var E=this.qd,X=E[R];X.ra||(this.Qb&&this.mb[Z]?(E.uc(Z,b,this.mb[Z]),this.mb[Z]=null,--this.Qb):X.I[Z]||E.uc(Z,b,X.J?{da:b}:E.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,Z){for(var E=b.split("."),X=f,F=0;F<E.length-1;F++)X=X[E[F]];X[E[E.length-1]]=Z},f.L=function(b,Z,E){b[Z]=E},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(z,j){for(var ee in z)F.call(z,ee)&&j(ee,z[ee])}function Z(z,j){if(j)for(var ee in j)F.call(j,ee)&&(z[ee]=j[ee]);return z}function E(z,j){return z.__proto__=j,z}function X(z,j,ee,fe){var Te=z[j].match(K)||[];f.a.D(ee.match(K),function(de){f.a.Na(Te,de,fe)}),z[j]=Te.join(" ")}var F=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,O=typeof Symbol=="function",U={},Y={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(U,function(z,j){if(j.length)for(var ee=0,fe=j.length;ee<fe;ee++)Y[j[ee]]=z});var k={propertychange:!0},H=n&&function(){for(var z=3,j=n.createElement("div"),ee=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",ee[0];);return 4<z?z:e}(),K=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,j,ee){for(var fe=0,Te=z.length;fe<Te;fe++)j.call(ee,z[fe],fe,z)},A:typeof Array.prototype.indexOf=="function"?function(z,j){return Array.prototype.indexOf.call(z,j)}:function(z,j){for(var ee=0,fe=z.length;ee<fe;ee++)if(z[ee]===j)return ee;return-1},Lb:function(z,j,ee){for(var fe=0,Te=z.length;fe<Te;fe++)if(j.call(ee,z[fe],fe,z))return z[fe];return e},Pa:function(z,j){var ee=f.a.A(z,j);0<ee?z.splice(ee,1):ee===0&&z.shift()},wc:function(z){var j=[];return z&&f.a.D(z,function(ee){0>f.a.A(j,ee)&&j.push(ee)}),j},Mb:function(z,j,ee){var fe=[];if(z)for(var Te=0,de=z.length;Te<de;Te++)fe.push(j.call(ee,z[Te],Te));return fe},jb:function(z,j,ee){var fe=[];if(z)for(var Te=0,de=z.length;Te<de;Te++)j.call(ee,z[Te],Te)&&fe.push(z[Te]);return fe},Nb:function(z,j){if(j instanceof Array)z.push.apply(z,j);else for(var ee=0,fe=j.length;ee<fe;ee++)z.push(j[ee]);return z},Na:function(z,j,ee){var fe=f.a.A(f.a.bc(z),j);0>fe?ee&&z.push(j):ee||z.splice(fe,1)},Ba:N,extend:Z,setPrototypeOf:E,Ab:N?E:Z,P:b,Ga:function(z,j,ee){if(!z)return z;var fe={},Te;for(Te in z)F.call(z,Te)&&(fe[Te]=j.call(ee,z[Te],Te,z));return fe},Tb:function(z){for(;z.firstChild;)f.removeNode(z.firstChild)},Yb:function(z){z=f.a.la(z);for(var j=(z[0]&&z[0].ownerDocument||n).createElement("div"),ee=0,fe=z.length;ee<fe;ee++)j.appendChild(f.oa(z[ee]));return j},Ca:function(z,j){for(var ee=0,fe=z.length,Te=[];ee<fe;ee++){var de=z[ee].cloneNode(!0);Te.push(j?f.oa(de):de)}return Te},va:function(z,j){if(f.a.Tb(z),j)for(var ee=0,fe=j.length;ee<fe;ee++)z.appendChild(j[ee])},Xc:function(z,j){var ee=z.nodeType?[z]:z;if(0<ee.length){for(var fe=ee[0],Te=fe.parentNode,de=0,xe=j.length;de<xe;de++)Te.insertBefore(j[de],fe);for(de=0,xe=ee.length;de<xe;de++)f.removeNode(ee[de])}},Ua:function(z,j){if(z.length){for(j=j.nodeType===8&&j.parentNode||j;z.length&&z[0].parentNode!==j;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==j;)z.length--;if(1<z.length){var ee=z[0],fe=z[z.length-1];for(z.length=0;ee!==fe;)z.push(ee),ee=ee.nextSibling;z.push(fe)}}return z},Zc:function(z,j){7>H?z.setAttribute("selected",j):z.selected=j},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,j){return z=z||"",j.length>z.length?!1:z.substring(0,j.length)===j},vd:function(z,j){if(z===j)return!0;if(z.nodeType===11)return!1;if(j.contains)return j.contains(z.nodeType!==1?z.parentNode:z);if(j.compareDocumentPosition)return(j.compareDocumentPosition(z)&16)==16;for(;z&&z!=j;)z=z.parentNode;return!!z},Sb:function(z){return f.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!f.a.Lb(z,f.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return f.onError?function(){try{return z.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:z},setTimeout:function(z,j){return setTimeout(f.a.Ac(z),j)},Gc:function(z){setTimeout(function(){throw f.onError&&f.onError(z),z},0)},B:function(z,j,ee){var fe=f.a.Ac(ee);if(ee=k[j],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var Te=function(xe){fe.call(z,xe)},de="on"+j;z.attachEvent(de,Te),f.a.K.za(z,function(){z.detachEvent(de,Te)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(j,fe,!1);else te||(te=typeof o(z).on=="function"?"on":"bind"),o(z)[te](j,fe)},Fb:function(z,j){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(z)==="input"&&z.type&&j.toLowerCase()=="click"?(ee=z.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")ee=n.createEvent(Y[j]||"HTMLEvents"),ee.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(z).trigger(j)},f:function(z){return f.O(z)?z():z},bc:function(z){return f.O(z)?z.v():z},Eb:function(z,j,ee){var fe;j&&(typeof z.classList=="object"?(fe=z.classList[ee?"add":"remove"],f.a.D(j.match(K),function(Te){fe.call(z.classList,Te)})):typeof z.className.baseVal=="string"?X(z.className,"baseVal",j,ee):X(z,"className",j,ee))},Bb:function(z,j){var ee=f.a.f(j);(ee===null||ee===e)&&(ee="");var fe=f.h.firstChild(z);!fe||fe.nodeType!=3||f.h.nextSibling(fe)?f.h.va(z,[z.ownerDocument.createTextNode(ee)]):fe.data=ee,f.a.Ad(z)},Yc:function(z,j){if(z.name=j,7>=H)try{var ee=z.name.replace(/[&<>'"]/g,function(fe){return"&#"+fe.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(z){9<=H&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(H){var j=z.style.width;z.style.width=0,z.style.width=j}},Pd:function(z,j){z=f.a.f(z),j=f.a.f(j);for(var ee=[],fe=z;fe<=j;fe++)ee.push(fe);return ee},la:function(z){for(var j=[],ee=0,fe=z.length;ee<fe;ee++)j.push(z[ee]);return j},Da:function(z){return O?Symbol(z):z},Zd:H===6,$d:H===7,W:H,Lc:function(z,j){for(var ee=f.a.la(z.getElementsByTagName("input")).concat(f.a.la(z.getElementsByTagName("textarea"))),fe=typeof j=="string"?function(xe){return xe.name===j}:function(xe){return j.test(xe.name)},Te=[],de=ee.length-1;0<=de;de--)fe(ee[de])&&Te.push(ee[de]);return Te},Nd:function(z){return typeof z=="string"&&(z=f.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,j,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(z),j,ee)},Od:function(z,j,ee){ee=ee||{};var fe=ee.params||{},Te=ee.includeFields||this.Jc,de=z;if(typeof z=="object"&&f.a.R(z)==="form")for(var de=z.action,xe=Te.length-1;0<=xe;xe--)for(var Ce=f.a.Lc(z,Te[xe]),Ie=Ce.length-1;0<=Ie;Ie--)fe[Ce[Ie].name]=Ce[Ie].value;j=f.a.f(j);var Le=n.createElement("form");Le.style.display="none",Le.action=de,Le.method="post";for(var Ne in j)z=n.createElement("input"),z.type="hidden",z.name=Ne,z.value=f.a.hc(f.a.f(j[Ne])),Le.appendChild(z);b(fe,function(Oe,qe){var Rt=n.createElement("input");Rt.type="hidden",Rt.name=Oe,Rt.value=qe,Le.appendChild(Rt)}),n.body.appendChild(Le),ee.submitter?ee.submitter(Le):Le.submit(),setTimeout(function(){Le.parentNode.removeChild(Le)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var Z=this;if(arguments.length===1)return function(){return Z.apply(b,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var X=E.slice(0);return X.push.apply(X,arguments),Z.apply(b,X)}}),f.a.g=new function(){var b=0,Z="__ko__"+new Date().getTime(),E={},X,F;return f.a.W?(X=function(N,O){var U=N[Z];if(!U||U==="null"||!E[U]){if(!O)return e;U=N[Z]="ko"+b++,E[U]={}}return E[U]},F=function(N){var O=N[Z];return O?(delete E[O],N[Z]=null,!0):!1}):(X=function(N,O){var U=N[Z];return!U&&O&&(U=N[Z]={}),U},F=function(N){return N[Z]?(delete N[Z],!0):!1}),{get:function(N,O){var U=X(N,!1);return U&&U[O]},set:function(N,O,U){(N=X(N,U!==e))&&(N[O]=U)},Ub:function(N,O,U){return N=X(N,!0),N[O]||(N[O]=U)},clear:F,Z:function(){return b+++Z}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(O,U){var Y=f.a.g.get(O,X);return Y===e&&U&&(Y=[],f.a.g.set(O,X,Y)),Y}function Z(O){var U=b(O,!1);if(U)for(var U=U.slice(0),Y=0;Y<U.length;Y++)U[Y](O);f.a.g.clear(O),f.a.K.cleanExternalData(O),N[O.nodeType]&&E(O.childNodes,!0)}function E(O,U){for(var Y=[],k,H=0;H<O.length;H++)if((!U||O[H].nodeType===8)&&(Z(Y[Y.length]=k=O[H]),O[H]!==k))for(;H--&&f.a.A(Y,O[H])==-1;);}var X=f.a.g.Z(),F={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(O,U){if(typeof U!="function")throw Error("Callback must be a function");b(O,!0).push(U)},yb:function(O,U){var Y=b(O,!1);Y&&(f.a.Pa(Y,U),Y.length==0&&f.a.g.set(O,X,e))},oa:function(O){return f.u.G(function(){F[O.nodeType]&&(Z(O),N[O.nodeType]&&E(O.getElementsByTagName("*")))}),O},removeNode:function(O){f.oa(O),O.parentNode&&O.parentNode.removeChild(O)},cleanExternalData:function(O){o&&typeof o.cleanData=="function"&&o.cleanData([O])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],Z=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],X=[1,"<select multiple='multiple'>","</select>"],F={thead:Z,tbody:Z,tfoot:Z,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:X,optgroup:X},N=8>=f.a.W;f.a.ua=function(O,U){var Y;if(o){if(o.parseHTML)Y=o.parseHTML(O,U)||[];else if((Y=o.clean([O],U))&&Y[0]){for(var k=Y[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(Y=U)||(Y=n);var k=Y.parentWindow||Y.defaultView||t,H=f.a.Db(O).toLowerCase(),K=Y.createElement("div"),te;for(te=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&F[H[1]]||b,H=te[0],te="ignored<div>"+te[1]+O+te[2]+"</div>",typeof k.innerShiv=="function"?K.appendChild(k.innerShiv(te)):(N&&Y.body.appendChild(K),K.innerHTML=te,N&&K.parentNode.removeChild(K));H--;)K=K.lastChild;Y=f.a.la(K.lastChild.childNodes)}return Y},f.a.Md=function(O,U){var Y=f.a.ua(O,U);return Y.length&&Y[0].parentElement||f.a.Yb(Y)},f.a.fc=function(O,U){if(f.a.Tb(O),U=f.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(O).html(U);else for(var Y=f.a.ua(U,O.ownerDocument),k=0;k<Y.length;k++)O.appendChild(Y[k])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(E,X){if(E){if(E.nodeType==8){var F=f.aa.Uc(E.nodeValue);F!=null&&X.push({ud:E,Kd:F})}else if(E.nodeType==1)for(var F=0,N=E.childNodes,O=N.length;F<O;F++)b(N[F],X)}}var Z={};return{Xb:function(E){if(typeof E!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var X=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return Z[X]=E,"<!--[ko_memo:"+X+"]-->"},bd:function(E,X){var F=Z[E];if(F===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return F.apply(null,X||[]),!0}finally{delete Z[E]}},cd:function(E,X){var F=[];b(E,F);for(var N=0,O=F.length;N<O;N++){var U=F[N].ud,Y=[U];X&&f.a.Nb(Y,X),f.aa.bd(F[N].Kd,Y),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(F){for(var U=F,Y=0,k;O<F;)if(k=X[O++]){if(O>U){if(5e3<=++Y){O=F,f.a.Gc(Error("'Too much recursion' after processing "+Y+" task groups."));break}U=F}try{k()}catch(H){f.a.Gc(H)}}}}function Z(){b(),O=F=X.length=0}var E,X=[],F=0,N=1,O=0;return t.MutationObserver?E=function(U){var Y=n.createElement("div");return new MutationObserver(U).observe(Y,{attributes:!0}),function(){Y.classList.toggle("foo")}}(Z):E=n&&"onreadystatechange"in n.createElement("script")?function(U){var Y=n.createElement("script");Y.onreadystatechange=function(){Y.onreadystatechange=null,n.documentElement.removeChild(Y),Y=null,U()},n.documentElement.appendChild(Y)}:function(U){setTimeout(U,0)},{scheduler:E,zb:function(U){return F||f.na.scheduler(Z),X[F++]=U,N++},cancel:function(U){U=U-(N-F),U>=O&&U<F&&(X[U]=null)},resetForTesting:function(){var U=F-O;return O=F=X.length=0,U},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,Z){b.throttleEvaluation=Z;var E=null;return f.$({read:b,write:function(X){clearTimeout(E),E=f.a.setTimeout(function(){b(X)},Z)}})},rateLimit:function(b,Z){var E,X,F;typeof Z=="number"?E=Z:(E=Z.timeout,X=Z.method),b.Hb=!1,F=typeof X=="function"?X:X=="notifyWhenChangesStop"?u:d,b.ub(function(N){return F(N,E,Z)})},deferred:function(b,Z){if(Z!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(E){var X,F=!1;return function(){if(!F){f.na.cancel(X),X=f.na.zb(E);try{F=!0,b.notifySubscribers(e,"dirty")}finally{F=!1}}}}))},notify:function(b,Z){b.equalityComparer=Z=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,Z,E){this.da=b,this.lc=Z,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,Z,E){var X=this;E=E||"change";var F=new f.ic(X,Z?b.bind(Z):b,function(){f.a.Pa(X.U[E],F),X.hb&&X.hb(E)});return X.Qa&&X.Qa(E),X.U[E]||(X.U[E]=[]),X.U[E].push(F),F},notifySubscribers:function(b,Z){if(Z=Z||"change",Z==="change"&&this.Gb(),this.Wa(Z)){var E=Z==="change"&&this.ed||this.U[Z].slice(0);try{f.u.xc();for(var X=0,F;F=E[X];++X)F.Ib||F.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var Z=this,E=f.O(Z),X,F,N,O,U;Z.gb||(Z.gb=Z.notifySubscribers,Z.notifySubscribers=h);var Y=b(function(){Z.Ja=!1,E&&O===Z&&(O=Z.nc?Z.nc():Z());var k=F||U&&Z.sb(N,O);U=F=X=!1,k&&Z.gb(N=O)});Z.qc=function(k,H){H&&Z.Ja||(U=!H),Z.ed=Z.U.change.slice(0),Z.Ja=X=!0,O=k,Y()},Z.pc=function(k){X||(N=k,Z.gb(k,"beforeChange"))},Z.rc=function(){U=!0},Z.gd=function(){Z.sb(N,Z.v(!0))&&(F=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var Z=0;return f.a.P(this.U,function(E,X){E!=="dirty"&&(Z+=X.length)}),Z},sb:function(b,Z){return!this.equalityComparer||!this.equalityComparer(b,Z)},toString:function(){return"[object Object]"},extend:function(b){var Z=this;return b&&f.a.P(b,function(E,X){var F=f.Ta[E];typeof F=="function"&&(Z=F(Z,X)||Z)}),Z}};f.L(_,"init",_.qb),f.L(_,"subscribe",_.subscribe),f.L(_,"extend",_.extend),f.L(_,"getSubscriptionsCount",_.Bd),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.T.fn=_,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(N){E.push(X),X=N}function Z(){X=E.pop()}var E=[],X,F=0;return{xc:b,end:Z,cc:function(N){if(X){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");X.od.call(X.pd,N,N.fd||(N.fd=++F))}},G:function(N,O,U){try{return b(),N.apply(O,U||[])}finally{Z()}},qa:function(){if(X)return X.o.qa()},Va:function(){if(X)return X.o.Va()},Ya:function(){if(X)return X.Ya},o:function(){if(X)return X.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var C=f.a.Da("_latestValue");f.ta=function(b){function Z(){return 0<arguments.length?(Z.sb(Z[C],arguments[0])&&(Z.ya(),Z[C]=arguments[0],Z.xa()),this):(f.u.cc(Z),Z[C])}return Z[C]=b,f.a.Ba||f.a.extend(Z,f.T.fn),f.T.fn.qb(Z),f.a.Ab(Z,V),f.options.deferUpdates&&f.Ta.deferred(Z,!0),Z};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(V,f.T.fn);var L=f.ta.Ma="__ko_proto__";V[L]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[L])&&b!==V[L]&&b!==f.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[L]===V[L]||b[L]===f.o.fn[L]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",V),f.L(V,"peek",V.v),f.L(V,"valueHasMutated",V.xa),f.L(V,"valueWillMutate",V.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var Z=this.v(),E=[],X=typeof b!="function"||f.O(b)?function(O){return O===b}:b,F=0;F<Z.length;F++){var N=Z[F];if(X(N)){if(E.length===0&&this.ya(),Z[F]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),Z.splice(F,1),F--}}return E.length&&this.xa(),E},removeAll:function(b){if(b===e){var Z=this.v(),E=Z.slice(0);return this.ya(),Z.splice(0,Z.length),this.xa(),E}return b?this.remove(function(X){return 0<=f.a.A(b,X)}):[]},destroy:function(b){var Z=this.v(),E=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var X=Z.length-1;0<=X;X--){var F=Z[X];E(F)&&(F._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(Z){return 0<=f.a.A(b,Z)}):[]},indexOf:function(b){var Z=this();return f.a.A(Z,b)},replace:function(b,Z){var E=this.indexOf(b);0<=E&&(this.ya(),this.v()[E]=Z,this.xa())},sorted:function(b){var Z=this().slice(0);return b?Z.sort(b):Z.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var Z=this.v();this.ya(),this.zc(Z,b,arguments);var E=Z[b].apply(Z,arguments);return this.xa(),E===Z?this:E}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var Z=this();return Z[b].apply(Z,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,Z){function E(){function K(){if(U){var te=[].concat(b.v()||[]),z;b.Wa("arrayChange")&&((!F||1<U)&&(F=f.a.Pb(Y,te,b.Ob)),z=F),Y=te,F=null,U=0,z&&z.length&&b.notifySubscribers(z,"arrayChange")}}X?K():(X=!0,O=b.subscribe(function(){++U},null,"spectate"),Y=[].concat(b.v()||[]),F=null,N=b.subscribe(K))}if(b.Ob={},Z&&typeof Z=="object"&&f.a.extend(b.Ob,Z),b.Ob.sparse=!0,!b.zc){var X=!1,F=null,N,O,U=0,Y,k=b.Qa,H=b.hb;b.Qa=function(K){k&&k.call(b,K),K==="arrayChange"&&E()},b.hb=function(K){H&&H.call(b,K),K!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),O&&O.s(),O=N=null,X=!1,Y=e)},b.zc=function(K,te,z){function j(Le,Ne,Oe){return ee[ee.length]={status:Le,value:Ne,index:Oe}}if(X&&!U){var ee=[],fe=K.length,Te=z.length,de=0;switch(te){case"push":de=fe;case"unshift":for(te=0;te<Te;te++)j("added",z[te],de+te);break;case"pop":de=fe-1;case"shift":fe&&j("deleted",K[de],de);break;case"splice":te=Math.min(Math.max(0,0>z[0]?fe+z[0]:z[0]),fe);for(var fe=Te===1?fe:Math.min(te+(z[1]||0),fe),Te=te+Te-2,de=Math.max(fe,Te),xe=[],Ce=[],Ie=2;te<de;++te,++Ie)te<fe&&Ce.push(j("deleted",K[te],te)),te<Te&&xe.push(j("added",z[Ie],te));f.a.Kc(Ce,xe);break;default:return}F=ee}}}};var R=f.a.Da("_state");f.o=f.$=function(b,Z,E){function X(){if(0<arguments.length){if(typeof F=="function")F.apply(N.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return N.ra||f.u.cc(X),(N.ka||N.J&&X.Xa())&&X.ha(),N.X}if(typeof b=="object"?E=b:(E=E||{},b&&(E.read=b)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var F=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:Z||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return X[R]=N,X.Nc=typeof F=="function",f.a.Ba||f.a.extend(X,f.T.fn),f.T.fn.qb(X),f.a.Ab(X,G),E.pure?(N.wb=!0,N.J=!0,f.a.extend(X,I)):E.deferEvaluation&&f.a.extend(X,v),f.options.deferUpdates&&f.Ta.deferred(X,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||X.ha(),N.l&&X.ja()&&f.a.K.za(N.l,N.Rb=function(){X.s()}),X};var G={equalityComparer:c,qa:function(){return this[R].V},Va:function(){var b=[];return f.a.P(this[R].I,function(Z,E){b[E.Ka]=E.da}),b},Vb:function(b){if(!this[R].V)return!1;var Z=this.Va();return f.a.A(Z,b)!==-1?!0:!!f.a.Lb(Z,function(E){return E.Vb&&E.Vb(b)})},uc:function(b,Z,E){if(this[R].wb&&Z===this)throw Error("A 'pure' computed must not be called recursively");this[R].I[b]=E,E.Ka=this[R].V++,E.La=Z.ob()},Xa:function(){var b,Z,E=this[R].I;for(b in E)if(Object.prototype.hasOwnProperty.call(E,b)&&(Z=E[b],this.Ia&&Z.da.Ja||Z.da.Dd(Z.La)))return!0},Jd:function(){this.Ia&&!this[R].rb&&this.Ia(!1)},ja:function(){var b=this[R];return b.ka||0<b.V},Rd:function(){this.Ja?this[R].ka&&(this[R].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var Z=b.subscribe(this.Jd,this,"dirty"),E=b.subscribe(this.Rd,this);return{da:b,s:function(){Z.s(),E.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,Z=b.throttleEvaluation;Z&&0<=Z?(clearTimeout(this[R].Ic),this[R].Ic=f.a.setTimeout(function(){b.ha(!0)},Z)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var Z=this[R],E=Z.Sa,X=!1;if(!Z.rb&&!Z.ra){if(Z.l&&!f.a.Sb(Z.l)||E&&E()){if(!Z.jc){this.s();return}}else Z.jc=!1;Z.rb=!0;try{X=this.zd(b)}finally{Z.rb=!1}return X}},zd:function(b){var Z=this[R],X=!1,E=Z.wb?e:!Z.V,X={qd:this,mb:Z.I,Qb:Z.V};f.u.xc({pd:X,od:g,o:this,Ya:E}),Z.I={},Z.V=0;var F=this.yd(Z,X);return Z.V?X=this.sb(Z.X,F):(this.s(),X=!0),X&&(Z.J?this.Gb():this.notifySubscribers(Z.X,"beforeChange"),Z.X=F,this.notifySubscribers(Z.X,"spectate"),!Z.J&&b&&this.notifySubscribers(Z.X),this.rc&&this.rc()),E&&this.notifySubscribers(Z.X,"awake"),X},yd:function(b,Z){try{var E=b.Wc;return b.nb?E.call(b.nb):E()}finally{f.u.end(),Z.Qb&&!b.J&&f.a.P(Z.mb,p),b.sa=b.ka=!1}},v:function(b){var Z=this[R];return(Z.ka&&(b||!Z.V)||Z.J&&this.Xa())&&this.ha(),Z.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[R].J||(this[R].sa?this.ha():this[R].ka=!1),this[R].X},this.Ia=function(Z){this.pc(this[R].X),this[R].ka=!0,Z&&(this[R].sa=!0),this.qc(this,!Z)}},s:function(){var b=this[R];!b.J&&b.I&&f.a.P(b.I,function(Z,E){E.s&&E.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},I={Qa:function(b){var Z=this,E=Z[R];if(!E.ra&&E.J&&b=="change"){if(E.J=!1,E.sa||Z.Xa())E.I=null,E.V=0,Z.ha()&&Z.Gb();else{var X=[];f.a.P(E.I,function(F,N){X[N.Ka]=F}),f.a.D(X,function(F,N){var O=E.I[F],U=Z.$c(O.da);U.Ka=N,U.La=O.La,E.I[F]=U}),Z.Xa()&&Z.ha()&&Z.Gb()}E.ra||Z.notifySubscribers(E.X,"awake")}},hb:function(b){var Z=this[R];Z.ra||b!="change"||this.Wa("change")||(f.a.P(Z.I,function(E,X){X.s&&(Z.I[E]={da:X.da,Ka:X.Ka,La:X.La},X.s())}),Z.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[R];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(G,f.T.fn);var P=f.ta.Ma;G[P]=f.o,f.Oc=function(b){return typeof b=="function"&&b[P]===G[P]},f.Fd=function(b){return f.Oc(b)&&b[R]&&b[R].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",G),f.L(G,"peek",G.v),f.L(G,"dispose",G.s),f.L(G,"isActive",G.ja),f.L(G,"getDependenciesCount",G.qa),f.L(G,"getDependencies",G.Va),f.xb=function(b,Z){return typeof b=="function"?f.o(b,Z,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,Z))},f.b("pureComputed",f.xb),function(){function b(X,F,N){if(N=N||new E,X=F(X),typeof X!="object"||X===null||X===e||X instanceof RegExp||X instanceof Date||X instanceof String||X instanceof Number||X instanceof Boolean)return X;var O=X instanceof Array?[]:{};return N.save(X,O),Z(X,function(U){var Y=F(X[U]);switch(typeof Y){case"boolean":case"number":case"string":case"function":O[U]=Y;break;case"object":case"undefined":var k=N.get(Y);O[U]=k!==e?k:b(Y,F,N)}}),O}function Z(X,F){if(X instanceof Array){for(var N=0;N<X.length;N++)F(N);typeof X.toJSON=="function"&&F("toJSON")}else for(N in X)F(N)}function E(){this.keys=[],this.values=[]}f.ad=function(X){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(X,function(F){for(var N=0;f.O(F)&&10>N;N++)F=F();return F})},f.toJSON=function(X,F,N){return X=f.ad(X),f.a.hc(X,F,N)},E.prototype={constructor:E,save:function(X,F){var N=f.a.A(this.keys,X);0<=N?this.values[N]=F:(this.keys.push(X),this.values.push(F))},get:function(X){return X=f.a.A(this.keys,X),0<=X?this.values[X]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,Z,E){function X(F){var N=f.xb(b,E).extend({ma:"always"}),O=N.subscribe(function(U){U&&(O.s(),F(U))});return N.notifySubscribers(N.v()),O}return typeof Promise!="function"||Z?X(Z.bind(E)):new Promise(X)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,Z,E){switch(f.a.R(b)){case"option":typeof Z=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=Z):(f.a.g.set(b,f.c.options.$b,Z),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof Z=="number"?Z:"");break;case"select":(Z===""||Z===null)&&(Z=e);for(var X=-1,F=0,N=b.options.length,O;F<N;++F)if(O=f.w.M(b.options[F]),O==Z||O===""&&Z===e){X=F;break}(E||0<=X||Z===e&&1<b.size)&&(b.selectedIndex=X,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=X},0));break;default:(Z===null||Z===e)&&(Z=""),b.value=Z}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(U){U=f.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=`
,`;var Y=[],k=U.match(X),H,K=[],te=0;if(1<k.length){for(var z=0,j;j=k[z];++z){var ee=j.charCodeAt(0);if(ee===44){if(0>=te){Y.push(H&&K.length?{key:H,value:K.join("")}:{unknown:H||K.join("")}),H=te=0,K=[];continue}}else if(ee===58){if(!te&&!H&&K.length===1){H=K.pop();continue}}else{if(ee===47&&1<j.length&&(j.charCodeAt(1)===47||j.charCodeAt(1)===42))continue;ee===47&&z&&1<j.length?(ee=k[z-1].match(F))&&!N[ee[0]]&&(U=U.substr(U.indexOf(j)+1),k=U.match(X),z=-1,j="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:H||K.length||ee!==34&&ee!==39||(j=j.slice(1,-1))}K.push(j)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return Y}var Z=["true","false","null","undefined"],E=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,X=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),F=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},O={};return{Ra:[],wa:O,ac:b,vb:function(U,Y){function k(ee,fe){var Te;if(!z){var de=f.getBindingHandler(ee);if(de&&de.preprocess&&!(fe=de.preprocess(fe,ee,k)))return;(de=O[ee])&&(Te=fe,0<=f.a.A(Z,Te)?Te=!1:(de=Te.match(E),Te=de===null?!1:de[1]?"Object("+de[1]+")"+de[2]:Te),de=Te),de&&K.push("'"+(typeof O[ee]=="string"?O[ee]:ee)+"':function(_z){"+Te+"=_z}")}te&&(fe="function(){return "+fe+" }"),H.push("'"+ee+"':"+fe)}Y=Y||{};var H=[],K=[],te=Y.valueAccessors,z=Y.bindingParams,j=typeof U=="string"?b(U):U;return f.a.D(j,function(ee){k(ee.key||ee.unknown,ee.value)}),K.length&&k("_ko_property_writers","{"+K.join(",")+" }"),H.join(",")},Id:function(U,Y){for(var k=0;k<U.length;k++)if(U[k].key==Y)return!0;return!1},eb:function(U,Y,k,H,K){U&&f.O(U)?!f.Za(U)||K&&U.v()===H||U(H):(U=Y.get("_ko_property_writers"))&&U[k]&&U[k](H)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(k){return k.nodeType==8&&N.test(F?k.text:k.nodeValue)}function Z(k){return k.nodeType==8&&O.test(F?k.text:k.nodeValue)}function E(k,H){for(var K=k,te=1,z=[];K=K.nextSibling;){if(Z(K)&&(f.a.g.set(K,Y,!0),te--,te===0))return z;z.push(K),b(K)&&te++}if(!H)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function X(k,H){var K=E(k,H);return K?0<K.length?K[K.length-1].nextSibling:k.nextSibling:null}var F=n&&n.createComment("test").text==="<!--test-->",N=F?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,O=F?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},Y="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(k){return b(k)?E(k):k.childNodes},Ea:function(k){if(b(k)){k=f.h.childNodes(k);for(var H=0,K=k.length;H<K;H++)f.removeNode(k[H])}else f.a.Tb(k)},va:function(k,H){if(b(k)){f.h.Ea(k);for(var K=k.nextSibling,te=0,z=H.length;te<z;te++)K.parentNode.insertBefore(H[te],K)}else f.a.va(k,H)},Vc:function(k,H){var K;b(k)?(K=k.nextSibling,k=k.parentNode):K=k.firstChild,K?H!==K&&k.insertBefore(H,K):k.appendChild(H)},Wb:function(k,H,K){K?(K=K.nextSibling,b(k)&&(k=k.parentNode),K?H!==K&&k.insertBefore(H,K):k.appendChild(H)):f.h.Vc(k,H)},firstChild:function(k){if(b(k))return!k.nextSibling||Z(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&Z(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(b(k)&&(k=X(k)),k.nextSibling&&Z(k.nextSibling)){var H=k.nextSibling;if(Z(H)&&!f.a.g.get(H,Y))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:b,Vd:function(k){return(k=(F?k.text:k.nodeValue).match(N))?k[1]:null},Sc:function(k){if(U[f.a.R(k)]){var H=k.firstChild;if(H)do if(H.nodeType===1){var K;K=H.firstChild;var te=null;if(K)do if(te)te.push(K);else if(b(K)){var z=X(K,!0);z?K=z:te=[K]}else Z(K)&&(te=[K]);while(K=K.nextSibling);if(K=te)for(te=H.nextSibling,z=0;z<K.length;z++)te?k.insertBefore(K[z],te):k.appendChild(K[z])}while(H=H.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,Z){var E=this.getBindingsString(b,Z),E=E?this.parseBindingsString(E,Z,b):null;return f.j.tc(E,b,Z,!1)},getBindingAccessors:function(b,Z){var E=this.getBindingsString(b,Z),E=E?this.parseBindingsString(E,Z,b,{valueAccessors:!0}):null;return f.j.tc(E,b,Z,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,Z,E,X){try{var F=this.nd,N=b+(X&&X.valueAccessors||""),O;if(!(O=F[N])){var U,Y="with($context){with($data||{}){return{"+f.m.vb(b,X)+"}}}";U=new Function("$context","$element",Y),O=F[N]=U}return O(Z,E)}catch(k){throw k.message=`Unable to parse bindings.
Bindings value: `+b+`
Message: `+k.message,k}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(de){var xe=(de=f.a.g.get(de,Te))&&de.N;xe&&(de.N=null,xe.Tc())}function Z(de,xe,Ce){this.node=de,this.yc=xe,this.kb=[],this.H=!1,xe.N||f.a.K.za(de,b),Ce&&Ce.N&&(Ce.N.kb.push(de),this.Kb=Ce)}function E(de){return function(){return de}}function X(de){return de()}function F(de){return f.a.Ga(f.u.G(de),function(xe,Ce){return function(){return de()[Ce]}})}function N(de,xe,Ce){return typeof de=="function"?F(de.bind(null,xe,Ce)):f.a.Ga(de,E)}function O(de,xe){return F(this.getBindings.bind(this,de,xe))}function U(de,xe){var Ce=f.h.firstChild(xe);if(Ce){var Ie,Le=f.ga.instance,Ne=Le.preprocessNode;if(Ne){for(;Ie=Ce;)Ce=f.h.nextSibling(Ie),Ne.call(Le,Ie);Ce=f.h.firstChild(xe)}for(;Ie=Ce;)Ce=f.h.nextSibling(Ie),Y(de,Ie)}f.i.ma(xe,f.i.H)}function Y(de,xe){var Ce=de,Ie=xe.nodeType===1;Ie&&f.h.Sc(xe),(Ie||f.ga.instance.nodeHasBindings(xe))&&(Ce=H(xe,null,de).bindingContextForDescendants),Ce&&!ee[f.a.R(xe)]&&U(Ce,xe)}function k(de){var xe=[],Ce={},Ie=[];return f.a.P(de,function Le(Ne){if(!Ce[Ne]){var Oe=f.getBindingHandler(Ne);Oe&&(Oe.after&&(Ie.push(Ne),f.a.D(Oe.after,function(qe){if(de[qe]){if(f.a.A(Ie,qe)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Le(qe)}}),Ie.length--),xe.push({key:Ne,Mc:Oe})),Ce[Ne]=!0}}),xe}function H(de,xe,Ce){var Ie=f.a.g.Ub(de,Te,{}),Le=Ie.hd;if(!xe){if(Le)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Le||(Ie.context=Ce),Ie.Zb||(Ie.Zb={});var Ne;if(xe&&typeof xe!="function")Ne=xe;else{var Oe=f.ga.instance,qe=Oe.getBindingAccessors||O,Rt=f.$(function(){return(Ne=xe?xe(Ce,de):qe.call(Oe,de,Ce))&&(Ce[te]&&Ce[te](),Ce[j]&&Ce[j]()),Ne},null,{l:de});Ne&&Rt.ja()||(Rt=null)}var Lt=Ce,ke;if(Ne){var zt=function(){return f.a.Ga(Rt?Rt():Ne,X)},ut=Rt?function(mt){return function(){return X(Rt()[mt])}}:function(mt){return Ne[mt]};zt.get=function(mt){return Ne[mt]&&X(ut(mt))},zt.has=function(mt){return mt in Ne},f.i.H in Ne&&f.i.subscribe(de,f.i.H,function(){var mt=(0,Ne[f.i.H])();if(mt){var Pn=f.h.childNodes(de);Pn.length&&mt(Pn,f.Ec(Pn[0]))}}),f.i.pa in Ne&&(Lt=f.i.Cb(de,Ce),f.i.subscribe(de,f.i.pa,function(){var mt=(0,Ne[f.i.pa])();mt&&f.h.firstChild(de)&&mt(de)})),Ie=k(Ne),f.a.D(Ie,function(mt){var Pn=mt.Mc.init,cn=mt.Mc.update,ge=mt.key;if(de.nodeType===8&&!f.h.ea[ge])throw Error("The binding '"+ge+"' cannot be used with virtual elements");try{typeof Pn=="function"&&f.u.G(function(){var Ve=Pn(de,ut(ge),zt,Lt.$data,Lt);if(Ve&&Ve.controlsDescendantBindings){if(ke!==e)throw Error("Multiple bindings ("+ke+" and "+ge+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");ke=ge}}),typeof cn=="function"&&f.$(function(){cn(de,ut(ge),zt,Lt.$data,Lt)},null,{l:de})}catch(Ve){throw Ve.message='Unable to process binding "'+ge+": "+Ne[ge]+`"
Message: `+Ve.message,Ve}})}return Ie=ke===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&Lt}}function K(de,xe){return de&&de instanceof f.fa?de:new f.fa(de,e,e,xe)}var te=f.a.Da("_subscribable"),z=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(de){return f.c[de]};var fe={};f.fa=function(de,xe,Ce,Ie,Le){function Ne(){var ut=Lt?Rt():Rt,mt=f.a.f(ut);return xe?(f.a.extend(Oe,xe),z in xe&&(Oe[z]=xe[z])):(Oe.$parents=[],Oe.$root=mt,Oe.ko=f),Oe[te]=ke,qe?mt=Oe.$data:(Oe.$rawData=ut,Oe.$data=mt),Ce&&(Oe[Ce]=mt),Ie&&Ie(Oe,xe,mt),xe&&xe[te]&&!f.S.o().Vb(xe[te])&&xe[te](),zt&&(Oe[j]=zt),Oe.$data}var Oe=this,qe=de===fe,Rt=qe?e:de,Lt=typeof Rt=="function"&&!f.O(Rt),ke,zt=Le&&Le.dataDependency;Le&&Le.exportDependencies?Ne():(ke=f.xb(Ne),ke.v(),ke.ja()?ke.equalityComparer=null:Oe[te]=e)},f.fa.prototype.createChildContext=function(de,xe,Ce,Ie){if(!Ie&&xe&&typeof xe=="object"&&(Ie=xe,xe=Ie.as,Ce=Ie.extend),xe&&Ie&&Ie.noChildContext){var Le=typeof de=="function"&&!f.O(de);return new f.fa(fe,this,null,function(Ne){Ce&&Ce(Ne),Ne[xe]=Le?de():de},Ie)}return new f.fa(de,this,xe,function(Ne,Oe){Ne.$parentContext=Oe,Ne.$parent=Oe.$data,Ne.$parents=(Oe.$parents||[]).slice(0),Ne.$parents.unshift(Ne.$parent),Ce&&Ce(Ne)},Ie)},f.fa.prototype.extend=function(de,xe){return new f.fa(fe,this,null,function(Ce){f.a.extend(Ce,typeof de=="function"?de(Ce):de)},xe)};var Te=f.a.g.Z();Z.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},Z.prototype.sd=function(de){f.a.Pa(this.kb,de),!this.kb.length&&this.H&&this.Cc()},Z.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(de,xe,Ce,Ie,Le){var Ne=f.a.g.Ub(de,Te,{});return Ne.Fa||(Ne.Fa=new f.T),Le&&Le.notifyImmediately&&Ne.Zb[xe]&&f.u.G(Ce,Ie,[de]),Ne.Fa.subscribe(Ce,Ie,xe)},ma:function(de,xe){var Ce=f.a.g.get(de,Te);if(Ce&&(Ce.Zb[xe]=!0,Ce.Fa&&Ce.Fa.notifySubscribers(de,xe),xe==f.i.H)){if(Ce.N)Ce.N.Cc();else if(Ce.N===e&&Ce.Fa&&Ce.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(de,xe){var Ce=f.a.g.Ub(de,Te,{});return Ce.N||(Ce.N=new Z(de,Ce,xe[z])),xe[z]==Ce?xe:xe.extend(function(Ie){Ie[z]=Ce})}},f.Td=function(de){return(de=f.a.g.get(de,Te))&&de.context},f.ib=function(de,xe,Ce){return de.nodeType===1&&f.h.Sc(de),H(de,xe,K(Ce))},f.ld=function(de,xe,Ce){return Ce=K(Ce),f.ib(de,N(xe,Ce,de),Ce)},f.Oa=function(de,xe){xe.nodeType!==1&&xe.nodeType!==8||U(K(de),xe)},f.vc=function(de,xe,Ce){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");Y(K(de,Ce),xe)},f.Dc=function(de){return!de||de.nodeType!==1&&de.nodeType!==8?e:f.Td(de)},f.Ec=function(de){return(de=f.Dc(de))?de.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function Z(O,U){var Y=Object.prototype.hasOwnProperty.call(F,O)?F[O]:b,k;Y?Y.subscribe(U):(Y=F[O]=new f.T,Y.subscribe(U),E(O,function(H,K){var te=!(!K||!K.synchronous);N[O]={definition:H,Gd:te},delete F[O],k||te?Y.notifySubscribers(H):f.na.zb(function(){Y.notifySubscribers(H)})}),k=!0)}function E(O,U){X("getConfig",[O],function(Y){Y?X("loadComponent",[O,Y],function(k){U(k,Y)}):U(null,null)})}function X(O,U,Y,k){k||(k=f.j.loaders.slice(0));var H=k.shift();if(H){var K=H[O];if(K){var te=!1;if(K.apply(H,U.concat(function(z){te?Y(null):z!==null?Y(z):X(O,U,Y,k)}))!==b&&(te=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else X(O,U,Y,k)}else Y(null)}var F={},N={};f.j={get:function(O,U){var Y=Object.prototype.hasOwnProperty.call(N,O)?N[O]:b;Y?Y.Gd?f.u.G(function(){U(Y.definition)}):f.na.zb(function(){U(Y.definition)}):Z(O,U)},Bc:function(O){delete N[O]},oc:X},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(Y,k,H,K){function te(){--j===0&&K(z)}var z={},j=2,ee=H.template;H=H.viewModel,ee?F(k,ee,function(fe){f.j.oc("loadTemplate",[Y,fe],function(Te){z.template=Te,te()})}):te(),H?F(k,H,function(fe){f.j.oc("loadViewModel",[Y,fe],function(Te){z[U]=Te,te()})}):te()}function Z(Y,k,H){if(typeof k=="function")H(function(te){return new k(te)});else if(typeof k[U]=="function")H(k[U]);else if("instance"in k){var K=k.instance;H(function(){return K})}else"viewModel"in k?Z(Y,k.viewModel,H):Y("Unknown viewModel value: "+k)}function E(Y){switch(f.a.R(Y)){case"script":return f.a.ua(Y.text);case"textarea":return f.a.ua(Y.value);case"template":if(X(Y.content))return f.a.Ca(Y.content.childNodes)}return f.a.Ca(Y.childNodes)}function X(Y){return t.DocumentFragment?Y instanceof DocumentFragment:Y&&Y.nodeType===11}function F(Y,k,H){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),H(K)}):Y("Uses require, but no AMD loader is present"):H(k)}function N(Y){return function(k){throw Error("Component '"+Y+"': "+k)}}var O={};f.j.register=function(Y,k){if(!k)throw Error("Invalid configuration for "+Y);if(f.j.tb(Y))throw Error("Component "+Y+" is already registered");O[Y]=k},f.j.tb=function(Y){return Object.prototype.hasOwnProperty.call(O,Y)},f.j.unregister=function(Y){delete O[Y],f.j.Bc(Y)},f.j.Fc={getConfig:function(Y,k){k(f.j.tb(Y)?O[Y]:null)},loadComponent:function(Y,k,H){var K=N(Y);F(K,k,function(te){b(Y,K,te,H)})},loadTemplate:function(Y,k,H){if(Y=N(Y),typeof k=="string")H(f.a.ua(k));else if(k instanceof Array)H(k);else if(X(k))H(f.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)H(E(k));else if(typeof k=="string"){var K=n.getElementById(k);K?H(E(K)):Y("Cannot find element with ID "+k)}else Y("Unknown element type: "+k);else Y("Unknown template value: "+k)},loadViewModel:function(Y,k,H){Z(N(Y),k,H)}};var U="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=O}(),function(){function b(E,X){var F=E.getAttribute("params");if(F){var F=Z.parseBindingsString(F,X,E,{valueAccessors:!0,bindingParams:!0}),F=f.a.Ga(F,function(U){return f.o(U,null,{l:E})}),N=f.a.Ga(F,function(U){var Y=U.v();return U.ja()?f.o({read:function(){return f.a.f(U())},write:f.Za(Y)&&function(k){U()(k)},l:E}):Y});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=F),N}return{$raw:{}}}f.j.getComponentNameForNode=function(E){var X=f.a.R(E);if(f.j.tb(X)&&(X.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=f.a.W&&E.tagName===X))return X},f.j.tc=function(E,X,F,N){if(X.nodeType===1){var O=f.j.getComponentNameForNode(X);if(O){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:O,params:b(X,F)};E.component=N?function(){return U}:U}}return E};var Z=new f.ga;9>f.a.W&&(f.j.register=function(E){return function(X){return E.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(E){return function(){var X=E(),F=f.j.dd,N;for(N in F);return X}}(n.createDocumentFragment))}(),function(){function b(X,F,N){if(F=F.template,!F)throw Error("Component '"+X+"' has no template");X=f.a.Ca(F),f.h.va(N,X)}function Z(X,F,N){var O=X.createViewModel;return O?O.call(X,F,N):F}var E=0;f.c.component={init:function(X,F,N,O,U){function Y(){var z=k&&k.dispose;typeof z=="function"&&z.call(k),K&&K.s(),H=k=K=null}var k,H,K,te=f.a.la(f.h.childNodes(X));return f.h.Ea(X),f.a.K.za(X,Y),f.o(function(){var z=f.a.f(F()),j,ee;if(typeof z=="string"?j=z:(j=f.a.f(z.name),ee=f.a.f(z.params)),!j)throw Error("No component name specified");var fe=f.i.Cb(X,U),Te=H=++E;f.j.get(j,function(de){if(H===Te){if(Y(),!de)throw Error("Unknown component '"+j+"'");b(j,de,X);var xe=Z(de,ee,{element:X,templateNodes:te});de=fe.createChildContext(xe,{extend:function(Ce){Ce.$component=xe,Ce.$componentTemplateNodes=te}}),xe&&xe.koDescendantsComplete&&(K=f.i.subscribe(X,f.i.pa,xe.koDescendantsComplete,xe)),k=xe,f.Oa(de,X)}})},null,{l:X}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var w={class:"className",for:"htmlFor"};f.c.attr={update:function(b,Z){var E=f.a.f(Z())||{};f.a.P(E,function(X,F){F=f.a.f(F);var N=X.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(X.substr(0,N)),O=F===!1||F===null||F===e;O?N?b.removeAttributeNS(N,X):b.removeAttribute(X):F=F.toString(),8>=f.a.W&&X in w?(X=w[X],O?b.removeAttribute(X):b[X]=F):O||(N?b.setAttributeNS(N,X,F):b.setAttribute(X,F)),X==="name"&&f.a.Yc(b,O?"":F)})}},function(){f.c.checked={after:["value","attr"],init:function(b,Z,E){function X(){var z=b.checked,j=N();if(!f.S.Ya()&&(z||!U&&!f.S.qa())){var ee=f.u.G(Z);if(k){var fe=H?ee.v():ee,Te=te;te=j,Te!==j?z&&(f.a.Na(fe,j,!0),f.a.Na(fe,Te,!1)):f.a.Na(fe,j,z),H&&f.Za(ee)&&ee(fe)}else O&&(j===e?j=z:z||(j=e)),f.m.eb(ee,E,"checked",j,!0)}}function F(){var z=f.a.f(Z()),j=N();k?(b.checked=0<=f.a.A(z,j),te=j):b.checked=O&&j===e?!!z:N()===z}var N=f.xb(function(){if(E.has("checkedValue"))return f.a.f(E.get("checkedValue"));if(K)return E.has("value")?f.a.f(E.get("value")):b.value}),O=b.type=="checkbox",U=b.type=="radio";if(O||U){var Y=Z(),k=O&&f.a.f(Y)instanceof Array,H=!(k&&Y.push&&Y.splice),K=U||k,te=k?N():e;U&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(X,null,{l:b}),f.a.B(b,"click",X),f.o(F,null,{l:b}),Y=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,Z){b.value=f.a.f(Z())}}}(),f.c.class={update:function(b,Z){var E=f.a.Db(f.a.f(Z()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=E,f.a.Eb(b,E,!0)}},f.c.css={update:function(b,Z){var E=f.a.f(Z());E!==null&&typeof E=="object"?f.a.P(E,function(X,F){F=f.a.f(F),f.a.Eb(b,X,F)}):f.c.class.update(b,Z)}},f.c.enable={update:function(b,Z){var E=f.a.f(Z());E&&b.disabled?b.removeAttribute("disabled"):E||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,Z){f.c.enable.update(b,function(){return!f.a.f(Z())})}},f.c.event={init:function(b,Z,E,X,F){var N=Z()||{};f.a.P(N,function(O){typeof O=="string"&&f.a.B(b,O,function(U){var Y,k=Z()[O];if(k){try{var H=f.a.la(arguments);X=F.$data,H.unshift(X),Y=k.apply(X,H)}finally{Y!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}E.get(O+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var Z=b(),E=f.a.bc(Z);return!E||typeof E.length=="number"?{foreach:Z,templateEngine:f.ba.Ma}:(f.a.f(Z),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:f.ba.Ma})}},init:function(b,Z){return f.c.template.init(b,f.c.foreach.Rc(Z))},update:function(b,Z,E,X,F){return f.c.template.update(b,f.c.foreach.Rc(Z),E,X,F)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,Z,E){function X(O){b.__ko_hasfocusUpdating=!0;var U=b.ownerDocument;if("activeElement"in U){var Y;try{Y=U.activeElement}catch{Y=U.body}O=Y===b}U=Z(),f.m.eb(U,E,"hasfocus",O,!0),b.__ko_hasfocusLastValue=O,b.__ko_hasfocusUpdating=!1}var F=X.bind(null,!0),N=X.bind(null,!1);f.a.B(b,"focus",F),f.a.B(b,"focusin",F),f.a.B(b,"blur",N),f.a.B(b,"focusout",N),b.__ko_hasfocusLastValue=!1},update:function(b,Z){var E=!!f.a.f(Z());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===E||(E?b.focus():b.blur(),!E&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,E?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,Z){f.a.fc(b,Z())}},function(){function b(Z,E,X){f.c[Z]={init:function(F,N,O,U,Y){var k,H,K={},te,z,j;if(E){U=O.get("as");var ee=O.get("noChildContext");j=!(U&&ee),K={as:U,noChildContext:ee,exportDependencies:j}}return z=(te=O.get("completeOn")=="render")||O.has(f.i.pa),f.o(function(){var fe=f.a.f(N()),Te=!X!=!fe,de=!H,xe;(j||Te!==k)&&(z&&(Y=f.i.Cb(F,Y)),Te&&((!E||j)&&(K.dataDependency=f.S.o()),xe=E?Y.createChildContext(typeof fe=="function"?fe:N,K):f.S.qa()?Y.extend(null,K):Y),de&&f.S.qa()&&(H=f.a.Ca(f.h.childNodes(F),!0)),Te?(de||f.h.va(F,f.a.Ca(H)),f.Oa(xe,F)):(f.h.Ea(F),te||f.i.ma(F,f.i.H)),k=Te)},null,{l:F}),{controlsDescendantBindings:!0}}},f.m.Ra[Z]=!1,f.h.ea[Z]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,Z,E,X,F){return Z=F.extend(Z),f.Oa(Z,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var M={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,Z,E){function X(){return f.a.jb(b.options,function(ee){return ee.selected})}function F(ee,fe,Te){var de=typeof fe;return de=="function"?fe(ee):de=="string"?ee[fe]:Te}function N(ee,fe){if(z&&k)f.i.ma(b,f.i.H);else if(te.length){var Te=0<=f.a.A(te,f.w.M(fe[0]));f.a.Zc(fe[0],Te),z&&!Te&&f.u.G(f.a.Fb,null,[b,"change"])}}var O=b.multiple,U=b.length!=0&&O?b.scrollTop:null,Y=f.a.f(Z()),k=E.get("valueAllowUnset")&&E.has("value"),H=E.get("optionsIncludeDestroyed");Z={};var K,te=[];k||(O?te=f.a.Mb(X(),f.w.M):0<=b.selectedIndex&&te.push(f.w.M(b.options[b.selectedIndex]))),Y&&(typeof Y.length>"u"&&(Y=[Y]),K=f.a.jb(Y,function(ee){return H||ee===e||ee===null||!f.a.f(ee._destroy)}),E.has("optionsCaption")&&(Y=f.a.f(E.get("optionsCaption")),Y!==null&&Y!==e&&K.unshift(M)));var z=!1;if(Z.beforeRemove=function(ee){b.removeChild(ee)},Y=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(Y=function(ee,fe){N(0,fe),f.u.G(E.get("optionsAfterRender"),null,[fe[0],ee!==M?ee:e])}),f.a.ec(b,K,function(ee,fe,Te){return Te.length&&(te=!k&&Te[0].selected?[f.w.M(Te[0])]:[],z=!0),fe=b.ownerDocument.createElement("option"),ee===M?(f.a.Bb(fe,E.get("optionsCaption")),f.w.cb(fe,e)):(Te=F(ee,E.get("optionsValue"),ee),f.w.cb(fe,f.a.f(Te)),ee=F(ee,E.get("optionsText"),Te),f.a.Bb(fe,ee)),[fe]},Z,Y),!k){var j;O?j=te.length&&X().length<te.length:j=te.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==te[0]:te.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(k||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),U&&20<Math.abs(U-b.scrollTop)&&(b.scrollTop=U)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,Z,E){function X(){var O=Z(),U=[];f.a.D(b.getElementsByTagName("option"),function(Y){Y.selected&&U.push(f.w.M(Y))}),f.m.eb(O,E,"selectedOptions",U)}function F(){var O=f.a.f(Z()),U=b.scrollTop;O&&typeof O.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(Y){var k=0<=f.a.A(O,f.w.M(Y));Y.selected!=k&&f.a.Zc(Y,k)}),b.scrollTop=U}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;f.i.subscribe(b,f.i.H,function(){N?X():(f.a.B(b,"change",X),N=f.o(F,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,Z){var E=f.a.f(Z()||{});f.a.P(E,function(X,F){if(F=f.a.f(F),(F===null||F===e||F===!1)&&(F=""),o)o(b).css(X,F);else if(/^--/.test(X))b.style.setProperty(X,F);else{X=X.replace(/-(\w)/g,function(O,U){return U.toUpperCase()});var N=b.style[X];b.style[X]=F,F===N||b.style[X]!=N||isNaN(F)||(b.style[X]=F+"px")}})}},f.c.submit={init:function(b,Z,E,X,F){if(typeof Z()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(N){var O,U=Z();try{O=U.call(F.$data,b)}finally{O!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,Z){f.a.Bb(b,Z())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(K){if(K)return parseFloat(K[1])},Z=t.navigator.userAgent,E,X,F,N,O;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(O=b(Z.match(/Edge\/([^ ]+)$/)))||b(Z.match(/Chrome\/([^ ]+)/))||(X=b(Z.match(/Version\/([^ ]+) Safari/)))||(F=b(Z.match(/Firefox\/([^ ]+)/)))||(N=f.a.W||b(Z.match(/MSIE ([^ ]+)/)))||(N=b(Z.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var U=f.a.g.Z(),Y=f.a.g.Z(),k=function(K){var te=this.activeElement;(te=te&&f.a.g.get(te,Y))&&te(K)},H=function(K,te){var z=K.ownerDocument;f.a.g.get(z,U)||(f.a.g.set(z,U,!0),f.a.B(z,"selectionchange",k)),f.a.g.set(K,Y,te)};f.c.textInput={init:function(K,te,z){function j(Ne,Oe){f.a.B(K,Ne,Oe)}function ee(){var Ne=f.a.f(te());(Ne===null||Ne===e)&&(Ne=""),Ce!==e&&Ne===Ce?f.a.setTimeout(ee,4):K.value!==Ne&&(Le=!0,K.value=Ne,Le=!1,de=K.value)}function fe(){xe||(Ce=K.value,xe=f.a.setTimeout(Te,4))}function Te(){clearTimeout(xe),Ce=xe=e;var Ne=K.value;de!==Ne&&(de=Ne,f.m.eb(te(),z,"textInput",Ne))}var de=K.value,xe,Ce,Ie=f.a.W==9?fe:Te,Le=!1;N&&j("keypress",Te),11>N&&j("propertychange",function(Ne){Le||Ne.propertyName!=="value"||Ie(Ne)}),N==8&&(j("keyup",Te),j("keydown",Te)),H&&(H(K,Ie),j("dragend",fe)),(!N||9<=N)&&j("input",Ie),5>X&&f.a.R(K)==="textarea"?(j("keydown",fe),j("paste",fe),j("cut",fe)):11>E?j("keydown",fe):4>F?(j("DOMAutoComplete",Te),j("dragdrop",Te),j("drop",Te)):O&&K.type==="number"&&j("keydown",fe),j("change",Te),j("blur",Te),f.o(ee,null,{l:K})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(K,te,z){z("textInput",K)}}}(),f.c.uniqueName={init:function(b,Z){if(Z()){var E="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,E)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,Z,E,X,F){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),Z=F.createChildContext(Z,N),f.Oa(Z,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,Z,E){var X=f.a.R(b),F=X=="input";if(!F||b.type!="checkbox"&&b.type!="radio"){var N=[],O=E.get("valueUpdate"),U=!1,Y=null;O&&(typeof O=="string"?N=[O]:N=f.a.wc(O),f.a.Pa(N,"change"));var k=function(){Y=null,U=!1;var te=Z(),z=f.w.M(b);f.m.eb(te,E,"value",z)};!f.a.W||!F||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(N,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){U=!0}),f.a.B(b,"focus",function(){U=!1}),f.a.B(b,"blur",function(){U&&k()})),f.a.D(N,function(te){var z=k;f.a.Ud(te,"after")&&(z=function(){Y=f.w.M(b),f.a.setTimeout(k,0)},te=te.substring(5)),f.a.B(b,te,z)});var H;if(H=F&&b.type=="file"?function(){var te=f.a.f(Z());te===null||te===e||te===""?b.value="":f.u.G(k)}:function(){var te=f.a.f(Z()),z=f.w.M(b);Y!==null&&te===Y?f.a.setTimeout(H,0):(te!==z||z===e)&&(X==="select"?(z=E.get("valueAllowUnset"),f.w.cb(b,te,z),z||te===f.w.M(b)||f.u.G(k)):f.w.cb(b,te))},X==="select"){var K;f.i.subscribe(b,f.i.H,function(){K?E.get("valueAllowUnset")?H():k():(f.a.B(b,"change",k),K=f.o(H,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",k),f.o(H,null,{l:b})}else f.ib(b,{checkedValue:Z})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,Z){var E=f.a.f(Z()),X=b.style.display!="none";E&&!X?b.style.display="":!E&&X&&(b.style.display="none")}},f.c.hidden={update:function(b,Z){f.c.visible.update(b,function(){return!f.a.f(Z())})}},function(b){f.c[b]={init:function(Z,E,X,F,N){return f.c.event.init.call(this,Z,function(){var O={};return O[b]=E(),O},X,F,N)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(b,Z){if(typeof b=="string"){Z=Z||n;var E=Z.getElementById(b);if(!E)throw Error("Cannot find template with ID "+b);return new f.C.F(E)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,Z,E,X){return b=this.makeTemplateSource(b,X),this.renderTemplateSource(b,Z,E,X)},f.ca.prototype.isTemplateRewritten=function(b,Z){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,Z).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,Z,E){b=this.makeTemplateSource(b,E),Z=Z(b.text()),b.text(Z),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(X,F,N,O){X=f.m.ac(X);for(var U=f.m.Ra,Y=0;Y<X.length;Y++){var k=X[Y].key;if(Object.prototype.hasOwnProperty.call(U,k)){var H=U[k];if(typeof H=="function"){if(k=H(X[Y].value))throw Error(k)}else if(!H)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(X,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",O.createJavaScriptEvaluatorBlock(N)+F}var Z=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(X,F,N){F.isTemplateRewritten(X,N)||F.rewriteTemplate(X,function(O){return f.kc.Ld(O,F)},N)},Ld:function(X,F){return X.replace(Z,function(N,O,U,Y,k){return b(k,O,U,F)}).replace(E,function(N,O){return b(O,"<!-- ko -->","#comment",F)})},md:function(X,F){return f.aa.Xb(function(N,O){var U=N.nextSibling;U&&U.nodeName.toLowerCase()===F&&f.ib(U,X,O)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(E){if(this.F=E){var X=f.a.R(E);this.ab=X==="script"?1:X==="textarea"?2:X=="template"&&E.content&&E.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var X=arguments[0];E==="innerHTML"?f.a.fc(this.F,X):this.F[E]=X};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(E){if(arguments.length===1)return f.a.g.get(this.F,b+E);f.a.g.set(this.F,b+E,arguments[1])};var Z=f.a.g.Z();f.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var X=f.a.g.get(E,Z)||{},F=X.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!F||X.jd){var N=this.text();N&&N!==X.bb&&(F=f.a.Md(N,E.ownerDocument),f.a.g.set(E,Z,{lb:F,bb:N,jd:!0}))}return F}X=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(E,Z,{lb:X})},f.C.ia=function(E){this.F=E},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var E=f.a.g.get(this.F,Z)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}f.a.g.set(this.F,Z,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(Y,k,H){var K;for(k=f.h.nextSibling(k);Y&&(K=Y)!==k;)Y=f.h.nextSibling(K),H(K,Y)}function Z(Y,k){if(Y.length){var H=Y[0],K=Y[Y.length-1],te=H.parentNode,z=f.ga.instance,j=z.preprocessNode;if(j){if(b(H,K,function(ee,fe){var Te=ee.previousSibling,de=j.call(z,ee);de&&(ee===H&&(H=de[0]||fe),ee===K&&(K=de[de.length-1]||Te))}),Y.length=0,!H)return;H===K?Y.push(H):(Y.push(H,K),f.a.Ua(Y,te))}b(H,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(k,ee)}),b(H,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[k])}),f.a.Ua(Y,te)}}function E(Y){return Y.nodeType?Y:0<Y.length?Y[0]:null}function X(Y,k,H,K,te){te=te||{};var z=(Y&&E(Y)||H||{}).ownerDocument,j=te.templateEngine||N;if(f.kc.xd(H,j,z),H=j.renderTemplate(H,K,te,z),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,k){case"replaceChildren":f.h.va(Y,H),z=!0;break;case"replaceNode":f.a.Xc(Y,H),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return z&&(Z(H,K),te.afterRender&&f.u.G(te.afterRender,null,[H,K[te.as||"$data"]]),k=="replaceChildren"&&f.i.ma(Y,f.i.H)),H}function F(Y,k,H){return f.O(Y)?Y():typeof Y=="function"?Y(k,H):Y}var N;f.gc=function(Y){if(Y!=e&&!(Y instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=Y},f.dc=function(Y,k,H,K,te){if(H=H||{},(H.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",K){var z=E(K);return f.$(function(){var ee=k&&k instanceof f.fa?k:new f.fa(k,null,null,null,{exportDependencies:!0}),j=F(Y,ee.$data,ee),ee=X(K,te,j,ee,H);te=="replaceNode"&&(K=ee,z=E(K))},null,{Sa:function(){return!z||!f.a.Sb(z)},l:z&&te=="replaceNode"?z.parentNode:z})}return f.aa.Xb(function(j){f.dc(Y,k,H,j,"replaceNode")})},f.Qd=function(Y,k,H,K,te){function z(Ce,Ie){f.u.G(f.a.ec,null,[K,Ce,ee,H,j,Ie]),f.i.ma(K,f.i.H)}function j(Ce,Ie){Z(Ie,fe),H.afterRender&&H.afterRender(Ie,Ce),fe=null}function ee(Ce,Ie){fe=te.createChildContext(Ce,{as:Te,noChildContext:H.noChildContext,extend:function(Ne){Ne.$index=Ie,Te&&(Ne[Te+"Index"]=Ie)}});var Le=F(Y,Ce,fe);return X(K,"ignoreTargetNode",Le,fe,H)}var fe,Te=H.as,de=H.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!H.includeDestroyed;if(de||H.beforeRemove||!f.Pc(k))return f.$(function(){var Ce=f.a.f(k)||[];typeof Ce.length>"u"&&(Ce=[Ce]),de&&(Ce=f.a.jb(Ce,function(Ie){return Ie===e||Ie===null||!f.a.f(Ie._destroy)})),z(Ce)},null,{l:K});z(k.v());var xe=k.subscribe(function(Ce){z(k(),Ce)},null,"arrayChange");return xe.l(K),xe};var O=f.a.g.Z(),U=f.a.g.Z();f.c.template={init:function(Y,k){var H=f.a.f(k());if(typeof H=="string"||"name"in H)f.h.Ea(Y);else if("nodes"in H){if(H=H.nodes||[],f.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var K=H[0]&&H[0].parentNode;K&&f.a.g.get(K,U)||(K=f.a.Yb(H),f.a.g.set(K,U,!0)),new f.C.ia(Y).nodes(K)}else if(H=f.h.childNodes(Y),0<H.length)K=f.a.Yb(H),new f.C.ia(Y).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(Y,k,H,K,te){var z=k();k=f.a.f(z),H=!0,K=null,typeof k=="string"?k={}:(z="name"in k?k.name:Y,"if"in k&&(H=f.a.f(k.if)),H&&"ifnot"in k&&(H=!f.a.f(k.ifnot)),H&&!z&&(H=!1)),"foreach"in k?K=f.Qd(z,H&&k.foreach||[],k,Y,te):H?(H=te,"data"in k&&(H=te.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),K=f.dc(z,H,k,Y)):f.h.Ea(Y),te=K,(k=f.a.g.get(Y,O))&&typeof k.s=="function"&&k.s(),f.a.g.set(Y,O,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(Y){return Y=f.m.ac(Y),Y.length==1&&Y[0].unknown||f.m.Id(Y,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,Z,E){if(b.length&&Z.length){var X,F,N,O,U;for(X=F=0;(!E||X<E)&&(O=b[F]);++F){for(N=0;U=Z[N];++N)if(O.value===U.value){O.moved=U.index,U.moved=O.index,Z.splice(N,1),X=N=0;break}X+=N}}},f.a.Pb=function(){function b(Z,E,X,F,N){var O=Math.min,U=Math.max,Y=[],k,H=Z.length,K,te=E.length,z=te-H||1,j=H+te+1,ee,fe,Te;for(k=0;k<=H;k++)for(fe=ee,Y.push(ee=[]),Te=O(te,k+z),K=U(0,k-1);K<=Te;K++)ee[K]=K?k?Z[k-1]===E[K-1]?fe[K-1]:O(fe[K]||j,ee[K-1]||j)+1:K+1:k+1;for(O=[],U=[],z=[],k=H,K=te;k||K;)te=Y[k][K]-1,K&&te===Y[k][K-1]?U.push(O[O.length]={status:X,value:E[--K],index:K}):k&&te===Y[k-1][K]?z.push(O[O.length]={status:F,value:Z[--k],index:k}):(--K,--k,N.sparse||O.push({status:"retained",value:E[K]}));return f.a.Kc(z,U,!N.dontLimitMoves&&10*H),O.reverse()}return function(Z,E,X){return X=typeof X=="boolean"?{dontLimitMoves:X}:X||{},Z=Z||[],E=E||[],Z.length<E.length?b(Z,E,"added","deleted",X):b(E,Z,"deleted","added",X)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(X,F,N,O,U){var Y=[],k=f.$(function(){var H=F(N,U,f.a.Ua(Y,X))||[];0<Y.length&&(f.a.Xc(Y,H),O&&f.u.G(O,null,[N,H,U])),Y.length=0,f.a.Nb(Y,H)},null,{l:X,Sa:function(){return!f.a.kd(Y)}});return{Y,$:k.ja()?k:e}}var Z=f.a.g.Z(),E=f.a.g.Z();f.a.ec=function(X,F,N,O,U,Y){function k(mt){Le={Aa:mt,pb:f.ta(fe++)},j.push(Le),z||Ie.push(Le)}function H(mt){Le=te[mt],fe!==Le.pb.v()&&Ce.push(Le),Le.pb(fe++),f.a.Ua(Le.Y,X),j.push(Le)}function K(mt,Pn){if(mt)for(var cn=0,ge=Pn.length;cn<ge;cn++)f.a.D(Pn[cn].Y,function(Ve){mt(Ve,cn,Pn[cn].Aa)})}F=F||[],typeof F.length>"u"&&(F=[F]),O=O||{};var te=f.a.g.get(X,Z),z=!te,j=[],ee=0,fe=0,Te=[],de=[],xe=[],Ce=[],Ie=[],Le,Ne=0;if(z)f.a.D(F,k);else{if(!Y||te&&te._countWaitingForRemove){var Oe=f.a.Mb(te,function(mt){return mt.Aa});Y=f.a.Pb(Oe,F,{dontLimitMoves:O.dontLimitMoves,sparse:!0})}for(var Oe=0,qe,Rt,Lt;qe=Y[Oe];Oe++)switch(Rt=qe.moved,Lt=qe.index,qe.status){case"deleted":for(;ee<Lt;)H(ee++);Rt===e&&(Le=te[ee],Le.$&&(Le.$.s(),Le.$=e),f.a.Ua(Le.Y,X).length&&(O.beforeRemove&&(j.push(Le),Ne++,Le.Aa===E?Le=null:xe.push(Le)),Le&&Te.push.apply(Te,Le.Y))),ee++;break;case"added":for(;fe<Lt;)H(ee++);Rt!==e?(de.push(j.length),H(Rt)):k(qe.value)}for(;fe<F.length;)H(ee++);j._countWaitingForRemove=Ne}f.a.g.set(X,Z,j),K(O.beforeMove,Ce),f.a.D(Te,O.beforeRemove?f.oa:f.removeNode);var ke,zt,ut;try{ut=X.ownerDocument.activeElement}catch{}if(de.length)for(;(Oe=de.shift())!=e;){for(Le=j[Oe],ke=e;Oe;)if((zt=j[--Oe].Y)&&zt.length){ke=zt[zt.length-1];break}for(F=0;ee=Le.Y[F];ke=ee,F++)f.h.Wb(X,ee,ke)}for(Oe=0;Le=j[Oe];Oe++){for(Le.Y||f.a.extend(Le,b(X,N,Le.Aa,U,Le.pb)),F=0;ee=Le.Y[F];ke=ee,F++)f.h.Wb(X,ee,ke);!Le.Ed&&U&&(U(Le.Aa,Le.Y,Le.pb),Le.Ed=!0,ke=Le.Y[Le.Y.length-1])}for(ut&&X.ownerDocument.activeElement!=ut&&ut.focus(),K(O.beforeRemove,xe),Oe=0;Oe<xe.length;++Oe)xe[Oe].Aa=E;K(O.afterMove,Ce),K(O.afterAdd,Ie)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,Z,E,X){return(Z=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(Z.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,X))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var Z=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(E,X,F,N){if(N=N||n,F=F||{},2>Z)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var O=E.data("precompiled");return O||(O=E.text()||"",O=o.template(null,"{{ko_with $item.koBindingContext}}"+O+"{{/ko_with}}"),E.data("precompiled",O)),E=[X.$data],X=o.extend({koBindingContext:X},F.templateOptions),X=o.tmpl(O,E,X),X.appendTo(N.createElement("div")),o.fragments={},X},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,X){n.write("<script type='text/html' id='"+E+"'>"+X+"<\/script>")},0<Z&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var OCt=ko;typeof window<"u"?(ko=window.ko,typeof nM<"u"?window.ko=nM:delete window.ko):(ko=global.ko,typeof nM<"u"?global.ko=nM:delete global.ko);var PS=OCt;var RRo=T(S(),1);/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * MIT license
 */var N6="__knockoutObservables",k6="__knockoutSubscribable";function mCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=hCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===N6||o===k6)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&HCt(n,a)}}),e}function hCe(e,t){var n=e[N6];return!n&&t&&(n={},Object.defineProperty(e,N6,{value:n})),n}function YCt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),mCe.call(i,e,[t]),e}function HCt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=zCt(e,t,i))})}function zCt(e,t,n){var i=KCt(e,n);return i.subscribe(t)}function KCt(e,t){var n=t[k6];if(!n){n=new e.subscribable,Object.defineProperty(t,k6,{value:n});var i={};JCt(t,n,i),QCt(e,t,n,i)}return n}function JCt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function QCt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function fCe(e,t){if(!e)return null;var n=hCe(e,!1);return n&&n[t]||null}function jCt(e,t){var n=fCe(e,t);n&&n.valueHasMutated()}function qCt(e){e.track=mCe,e.getObservable=fCe,e.valueHasMutated=jCt,e.defineProperty=YCt}var iM={attachToKo:qCt};var GRo=T(S(),1),pCe="http://www.w3.org/2000/svg",bCe="cesium-svgPath-svg",$Ct={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(pCe,"svg:svg");i.setAttribute("class",bCe);let o=document.createElementNS(pCe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${bCe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},oM=$Ct;iM.attachToKo(PS);oM.register(PS);var Se=PS;function rM(e){l(e)||(e=new km),this._clock=e,this._eventHelper=new ar,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(q.now()),this.systemTime.equalityComparer=q.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(rM.prototype,{clock:{get:function(){return this._clock}}});rM.prototype.synchronize=function(){let e=this._clock;this.systemTime=q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};rM.prototype.isDestroyed=function(){return!1};rM.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var sM=rM;var kRo=T(S(),1);function e1t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var U6=e1t;var ORo=T(S(),1);var aM={};aM.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};aM.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};aM.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};aM.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var za=aM;var QRo=T(S(),1);function gCe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Se.track(this,["toggled","tooltip"])}Object.defineProperties(gCe.prototype,{command:{get:function(){return this._command}}});var Jy=gCe;var nZo=T(S(),1);function t1t(e,t){t=y(t,!0);let n=new be,i=new be;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Se.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Rn=t1t;var rZo=T(S(),1);function n1t(e,t,n,i,o){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,o)}var Ca=n1t;var yZo=T(S(),1);var uZo=T(S(),1);function yCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Se.getObservable(this,"imageryProviderViewModels"),r=Se.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let _=h[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let _=h[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=l(h)?h.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g}
${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,f=g.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===g[p]){x.remove(L),_=!0;break}}}if(l(h)){let C=h.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=Ya.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=Ya.fromProviderAsync(C);if(V.name=h.name,_)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(h){if(d()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Tf),this._globe.terrainProvider=p;else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),_=new q9(p).readyEvent.addEventListener(C=>{g||(this._globe.depthTestAgainstTerrain=!(C instanceof Tf),this._globe.terrainProvider=C,_())})}d(h),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Rn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(yCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var cM=yCe;function pO(e,t){e=Xn(e);let n=new cM(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let R=document.createElement("img");R.className="cesium-baseLayerPicker-itemIcon",R.setAttribute("data-bind","attr: { src: iconUrl }"),R.setAttribute("draggable","false"),L.appendChild(R);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Se.applyBindings(n,i),Se.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(pO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pO.prototype.isDestroyed=function(){return!1};pO.prototype.destroy=function(){return Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var lM=pO;var VZo=T(S(),1);function xCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(xCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var as=xCe;var GZo=T(S(),1);function i1t(){let e=[],t=devicePixelRatio>=2;return e.push(new as({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return y0({style:g0.AERIAL})}})),e.push(new as({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return y0({style:g0.AERIAL_WITH_LABELS})}})),e.push(new as({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return y0({style:g0.ROAD})}})),e.push(new as({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return p0.fromBasemapType(Uh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new as({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return p0.fromBasemapType(Uh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new as({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data.  The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return p0.fromBasemapType(Uh.OCEANS,{enablePickFeatures:!1})}})),e.push(new as({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new X0({url:"https://tile.openstreetmap.org/"})}})),e.push(new as({name:"Stadia x Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new X0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
           &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
           &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
           &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia x Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new X0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
            &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia Alidade Smooth",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new X0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia Alidade Smooth Dark",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new X0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return b0.fromAssetId(3954)}})),e.push(new as({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return b0.fromAssetId(3845)}})),e.push(new as({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return b0.fromAssetId(3812)}})),e.push(new as({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Fy.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var dM=i1t;var WZo=T(S(),1);function o1t(){let e=[];return e.push(new as({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Tf({ellipsoid:ne.WGS84})}})),e.push(new as({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return u_({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var uM=o1t;var OZo=T(S(),1);var AZo=T(S(),1);function r1t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function TCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},xn.MOUSE_MOVE):(e._eventHandler.removeInputAction(xn.MOUSE_MOVE),e.picking=e.picking)}var s1t={maximumFractionDigits:3};function mM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,s1t):Math.round(t).toLocaleString()}function hM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[wo.PICK]:e._statisticsPerPass[wo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${mM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${mM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${mM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function SCe(){let e=Ri.statistics;return`
  <ul class="cesium-cesiumInspector-statistics">
    <li><strong>Geometry Memory (MB): </strong>${mM(e.geometryByteLength)}</li>
    <li><strong>Texture Memory (MB): </strong>${mM(e.texturesByteLength)}</li>
  </ul>
  `}var a1t=[{text:"Highlight",value:Nl.HIGHLIGHT},{text:"Replace",value:Nl.REPLACE},{text:"Mix",value:Nl.MIX}],_Ce=new B(1,1,0,.4),c1t=new B,bO=new B;function Va(e,t){let n=this,i=e.canvas;this._eventHandler=new Cd(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new _0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Se.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let k=[],H=n._properties();for(let K in H)H.hasOwnProperty(K)&&k.push(K);return k});let o=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Nl.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(H){let K=e.pick(H.endPosition);if(K instanceof Os?(n.feature=K,n.tile=K.content.tile):l(K)&&l(K.content)?(n.feature=void 0,n.tile=K.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(K)&&l(K.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(H.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},xn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(xn.MOUSE_MOVE))}}),this.picking=!0;let c=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let d=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let u=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let V=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let L=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(k){let H=Math.pow(k,6);L(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let R=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let G=r1t(this),I=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(G,xn.LEFT_CLICK):n._eventHandler.removeInputAction(xn.LEFT_CLICK)}});let v=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(k){v(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let P=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(k){k=Number(k),isNaN(k)||(P(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let w=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let M=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let b=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let Z=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return Z()},set:function(k){k=Number(k),isNaN(k)||(Z(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let E=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let X=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return X()},set:function(k){X(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let F=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let N=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let O=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let Y=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return Y()},set:function(k){Y(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||TCe(this,!0)}Object.defineProperties(Va.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return a1t}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=hM(e,!1),this._pickStatisticsText=hM(e,!0),this._resourceCacheStatisticsText=SCe(),TCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,c1t):B.WHITE:t.color=bO,this._scene.requestRender()),l(e)&&(B.clone(e.color,bO),e.color=_Ce,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!D6(t.content)&&(t.color=bO,this._scene.requestRender()),l(e)&&!D6(e.content)&&(B.clone(e.color,bO),e.color=_Ce,this._scene.requestRender()),this._tile=e}}});function D6(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!D6(t[i]))return!1;return!0}return!1}Va.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Va.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Va.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Va.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Va.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Va.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Va.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Va.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Va.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Va.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Va.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new RS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Va.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=`  ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Va.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null,"  ")))}this.showStatistics&&(this._statisticsText=hM(e,!1),this._pickStatisticsText=hM(e,!0),this._resourceCacheStatisticsText=SCe())};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),me(this)};Va.getStatistics=hM;var fM=Va;function gO(e,t){e=Xn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new fM(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=za.createSection,c=za.createCheckbox,d=za.createRangeInput,u=za.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let R=document.createElement("div");R.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(R),h.appendChild(V),h.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(u("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(d("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let w=document.createElement("div");w.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(w);let M=document.createElement("div");M.setAttribute("data-bind","visible: dynamicScreenSpaceError"),M.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),M.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(M),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let Z=document.createElement("div");Z.className="cesium-3dTilesInspector-statistics",Z.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(Z),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(E);let X=document.createElement("div");_.appendChild(X),X.appendChild(document.createTextNode("Color Blend Mode: "));let F=document.createElement("select");F.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),X.appendChild(F);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),X.className="cesium-cesiumInspector-styleEditor",X.appendChild(N);let O=u("Compile (Ctrl+Enter)","compileStyle");X.appendChild(O);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),X.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let Y=document.createElement("div");Y.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(Y);let k=document.createElement("div");k.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let H=document.createElement("div");H.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(H),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(o,n)}Object.defineProperties(gO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gO.prototype.isDestroyed=function(){return!1};gO.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var pM=gO;var oGo=T(S(),1);var QZo=T(S(),1);function l1t(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function B6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var d1t=new pn,u1t=new m;function bM(e,t){let n=this,i=e.canvas,o=new Cd(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Se.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new _0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new A9({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let d=n.depthFrustum+1;return n.depthFrustum=B6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let d=n.depthFrustum-1;return n.depthFrustum=B6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new eM({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,xn.LEFT_CLICK):o.removeInputAction(xn.LEFT_CLICK)});function c(d){let u,h=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,d1t),g=r.pick(p,n._scene,u1t);if(l(g)){let f=h.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<x.length;++_){let C=x[_];if(l(C))for(let V=0;!u&&V<C.length;++V){let L=C[V];ce.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,xn.LEFT_CLICK):o.removeInputAction(xn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(bM.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});bM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=l1t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=B6(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};bM.prototype.isDestroyed=function(){return!1};bM.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),me(this)};var gM=bM;function yO(e,t){e=Xn(e);let n=document.createElement("div"),i=new gM(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=za.createSection,c=za.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(h),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(R),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",I.appendChild(v);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(P),G.className="cesium-cesiumInspector-center",v.appendChild(G);let w=document.createElement("div");v.appendChild(w);let M=document.createElement("input");M.type="button",M.value="Parent",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectSW");let X=document.createElement("input");X.type="button",X.value="SE",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSE");let F=document.createElement("div");F.className="cesium-cesiumInspector-tileText",w.className="cesium-cesiumInspector-frustumStatistics",w.appendChild(F),w.setAttribute("data-bind","visible: hasPickedTile"),F.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",w.appendChild(N);let O=document.createElement("table"),U=document.createElement("tr"),Y=document.createElement("tr"),k=document.createElement("td");k.appendChild(M);let H=document.createElement("td");H.appendChild(b);let K=document.createElement("td");K.appendChild(Z),U.appendChild(k),U.appendChild(H),U.appendChild(K);let te=document.createElement("td"),z=document.createElement("td");z.appendChild(E);let j=document.createElement("td");j.appendChild(X),Y.appendChild(te),Y.appendChild(z),Y.appendChild(j),O.appendChild(U),O.appendChild(Y),w.appendChild(O),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(yO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yO.prototype.isDestroyed=function(){return!1};yO.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var yM=yO;var lGo=T(S(),1);var vS="http://www.w3.org/2000/svg",LCe="http://www.w3.org/1999/xlink",xO,xM=B.fromCssColorString("rgba(247,250,255,0.384)"),_O=B.fromCssColorString("rgba(143,191,255,0.216)"),O6=B.fromCssColorString("rgba(153,197,255,0.098)"),TO=B.fromCssColorString("rgba(255,255,255,0.086)"),m1t=B.fromCssColorString("rgba(255,255,255,0.267)"),h1t=B.fromCssColorString("rgba(255,255,255,0)"),CCe=B.fromCssColorString("rgba(66,67,68,0.3)"),VCe=B.fromCssColorString("rgba(0,0,0,0.5)");function Qy(e){return B.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var _M={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function jh(e){let t=document.createElementNS(vS,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(jh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(LCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Y6(e,t,n){let i=document.createElementNS(vS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(vS,"tspan");return o.textContent=n,i.appendChild(o),i}function f1t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var SO=new B;function cs(e,t){let n=t.alpha,i=1-n;return SO.red=e.red*i+t.red*n,SO.green=e.green*i+t.green*n,SO.blue=e.blue*i+t.blue*n,SO.toCssColorString()}function H6(e,t,n){let i=_M[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return jh(o)}function p1t(e,t,n){let i=_M[n],o=_M.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return jh(r)}function b1t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&xO!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=d-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(xO=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===xO&&(xO=void 0),n.shuttleRingDragging=!1}function W0(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Ca(t,"toggled",this.setToggled,this),Ca(t,"tooltip",this.setTooltip,this),Ca(t.command,"canExecute",this.setEnabled,this)]}W0.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();me(this)};W0.prototype.isDestroyed=function(){return!1};W0.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};W0.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};W0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function DL(e,t){e=Xn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(vS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",LCe);let s=document.createElementNS(vS,"g");this._topG=s,this._realtimeSVG=new W0(p1t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new W0(H6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new W0(H6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new W0(H6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(vS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=jh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=_M.animation_pathSwooshFX,u=_M.animation_pathPointer,h=jh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=jh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=jh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=jh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,f=jh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=Y6(0,-24,""),this._knobTime=Y6(0,-7,""),this._knobStatus=Y6(0,-41,"");let x=jh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),_=document.createElementNS(vS,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(h),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(v){b1t(C,v)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),h.addEventListener("mousedown",V,!0),h.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],R=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],I;this._subscriptions=[Ca(t.pauseViewModel,"toggled",function(v){I!==v&&(I=v,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ca(t,"shuttleRingAngle",function(v){f1t(C._shuttleRingPointer,C._knobOuter,v)}),Ca(t,"dateLabel",function(v){R.textContent!==v&&(R.textContent=v)}),Ca(t,"timeLabel",function(v){L.textContent!==v&&(L.textContent=v)}),Ca(t,"multiplierLabel",function(v){G.textContent!==v&&(G.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(DL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DL.prototype.isDestroyed=function(){return!1};DL.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return me(this)};DL.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};DL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=Qy(this._themeNormal),n=Qy(this._themeHover),i=Qy(this._themeSelect),o=Qy(this._themeDisabled),r=Qy(this._themeKnob),s=Qy(this._themePointer),a=Qy(this._themeSwoosh),c=Qy(this._themeSwooshHover),d=jh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(t,xM)},{tagName:"stop",offset:"12%","stop-color":cs(t,_O)},{tagName:"stop",offset:"46%","stop-color":cs(t,O6)},{tagName:"stop",offset:"81%","stop-color":cs(t,TO)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(n,xM)},{tagName:"stop",offset:"12%","stop-color":cs(n,_O)},{tagName:"stop",offset:"46%","stop-color":cs(n,O6)},{tagName:"stop",offset:"81%","stop-color":cs(n,TO)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(i,xM)},{tagName:"stop",offset:"12%","stop-color":cs(i,_O)},{tagName:"stop",offset:"46%","stop-color":cs(i,O6)},{tagName:"stop",offset:"81%","stop-color":cs(i,TO)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(o,m1t)},{tagName:"stop",offset:"75%","stop-color":cs(o,h1t)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":cs(s,VCe)},{tagName:"stop",offset:"100%","stop-color":cs(s,VCe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":cs(r,xM)},{tagName:"stop",offset:"60%","stop-color":cs(r,CCe)},{tagName:"stop",offset:"85%","stop-color":cs(r,_O)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":cs(r,CCe)},{tagName:"stop",offset:"60%","stop-color":cs(r,xM)},{tagName:"stop",offset:"85%","stop-color":cs(r,TO)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var TM=DL;var gGo=T(S(),1);var g1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jy=15,BL=105;function RCe(e,t){return e-t}function z6(e,t){let n=Xo(t,e,RCe);return n<0?~n:n}function y1t(e,t){if(Math.abs(e)<=jy)return e/jy;let n=jy,i=BL,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function x1t(e,t,n){if(n.clockStep===fo.SYSTEM_CLOCK)return jy;if(Math.abs(e)<=1)return e*jy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=jy,r=BL,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function Tm(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Tm.defaultDateFormatter,this._timeFormatter=Tm.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Tm.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===fo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return x1t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,BL),-BL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===BL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=y1t(s,a);if(t.snapToTicks)d=a[z6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let h=u.toFixed(0).length-2,p=Math.pow(10,h);d=Math.round(d/p)*p|0}else u>jy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===vr.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,h=!1;if(a===vr.LOOP_STOP)h=q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;h=q.greaterThan(d,u)&&q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===vr.UNBOUNDED)return!0;let c=s.systemTime;return q.greaterThanOrEquals(c,s.startTime)&&q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Jy(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Jy(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Jy(o,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==fo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Rn(function(){t._clockViewModel.clockStep=fo.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Jy(r,{toggled:Se.computed(function(){return e.clockStep===fo.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=z6(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=z6(c,a)+1;d<a.length&&(s.multiplier=a[d])})}Tm.defaultDateFormatter=function(e,t){let n=q.toGregorianDate(e);return`${g1t[n.month-1]} ${n.day} ${n.year}`};Tm.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Tm.defaultTimeFormatter=function(e,t){let n=q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Tm.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Tm.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(RCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Tm.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Tm._maxShuttleRingAngle=BL;Tm._realtimeShuttleRingAngle=jy;var SM=Tm;var IGo=T(S(),1);var CGo=T(S(),1);function CO(e,t){l(t)||(t=document.body),t=Xn(t);let n=this,i=Se.observable(br.fullscreen),o=Se.observable(br.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&br.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){br.fullscreen?br.exitFullscreen():br.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Xn(e),r.body),this._callback=function(){i(br.fullscreen)},r.addEventListener(br.changeEventName,this._callback)}Object.defineProperties(CO.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});CO.prototype.isDestroyed=function(){return!1};CO.prototype.destroy=function(){document.removeEventListener(br.changeEventName,this._callback),me(this)};var CM=CO;var _1t="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",T1t="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function VO(e,t){e=Xn(e);let n=new CM(t,e);n._exitFullScreenPath=T1t,n._enterFullScreenPath=_1t;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(VO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});VO.prototype.isDestroyed=function(){return!1};VO.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var VM=VO;var BGo=T(S(),1);var FGo=T(S(),1);var ZCe=1e3;function Sm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new Kx({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=ECe,this._handleArrowUp=GCe;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let o=Se.getObservable(t,"_suggestions")().length>0,r=Se.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Rn(function(i){if(i=y(i,ug.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Z1t(t);else return L1t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?GCe(t):r?ECe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;WCe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Sm.flyToDestination),this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Sm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Sm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Sm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function GCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Sm._adjustSuggestionsScroll(e,n)}function ECe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Sm._adjustSuggestionsScroll(e,i)}function S1t(e,t){let n=l(t)?t.availability:void 0;return l(n)?h_(t,[e]).then(function(i){return e=i[0],e.height+=ZCe,e}):(e.height+=ZCe,Promise.resolve(e))}function C1t(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=ce.center(t):a=KT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=S1t(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:A.IDENTITY})})}async function V1t(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function L1t(e,t,n){let i=e._searchText;if(XCe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await V1t(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,J6(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=ICe(e,vC.getCreditsFromResult(s[0]));l(a)||K6(e,t[o].credit);return}e._searchText=`${i} (not found)`}function K6(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function ICe(e,t){return l(t)&&t.forEach(n=>K6(e,n)),t}function J6(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function R1t(e,t){let n=Xn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function Z1t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function XCe(e){return/^\s*$/.test(e)}function WCe(e){Se.getObservable(e,"_suggestions").removeAll()}async function G1t(e){if(!e.autoComplete)return;let t=e._searchText;if(WCe(e),J6(e),!XCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,ug.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=vC.getCreditsFromResult(r);o=o&&!l(s),ICe(e,s)}),o&&K6(e,n.credit)}if(e._suggestions.length>=5)return}}Sm.flyToDestination=C1t;Sm._updateSearchSuggestions=G1t;Sm._adjustSuggestionsScroll=R1t;Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){return J6(this),me(this)};var LM=Sm;var E1t="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",I1t="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function LO(e){let t=Xn(e.container),n=new LM(e);n._startSearchPath=E1t,n._stopSearchPath=I1t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},Bt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(LO.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});LO.prototype.isDestroyed=function(){return!1};LO.prototype.destroy=function(){let e=this._container;return Bt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var RM=LO;var eEo=T(S(),1);var zGo=T(S(),1);function PCe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(PCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var ZM=PCe;function RO(e,t,n){e=Xn(e);let i=new ZM(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(RO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});RO.prototype.isDestroyed=function(){return!1};RO.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var GM=RO;var dEo=T(S(),1);var oEo=T(S(),1);function X1t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function wCe(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)wCe(e.sublayers[n],t)}function ZO(e){return e.modelName==="FullModel"}function FCe(e){return e.modelName==="Overview"}function ACe(e){return FCe(e)||ZO(e)}function vCe(e,t){if(ACe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Se.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function W1t(e,t){if(ACe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");ZO(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function P1t(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function v1t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Se.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Se.observable(!0),index:-1}],currentLayer:Se.observable(),expandClickHandler:X1t,setOptionDisable:function(i,o){Se.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){W1t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){wCe(n[i],this.viewModel);let o=vCe(n[i],this.viewModel);l(o)&&(FCe(o)||!l(this.viewModel.defaultLayer)&&ZO(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=vCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=ZO(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return P1t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var EM=v1t;function w1t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
        <h3>Building explorer</h3>
        <select
          data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
        ></select>
        <div id="bsl-wrapper">
          <h3>Select Level</h3>
          <select data-bind="options: levels, value: currentLevel"></select>
          <h3>Disciplines & Categories</h3>
          <ul class="layersList" data-bind="foreach: sublayers">
            <ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
              <li>
                <div class="li-wrapper">
                  <span
                    class="expandItem"
                    data-bind="click: $root.expandClickHandler"
                    >+</span
                  >
                  <input
                    type="checkbox"
                    data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
                  />
                  <label data-bind="attr: { for: name}">
                    <span data-bind="text: name"></span>
                  </label>
                </div>
                <ul class="nested" data-bind="attr: { id: name + '-expander'}">
                  <li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
                    <div class="li-wrapper">
                      <input
                        type="checkbox"
                        data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
                      />
                      <label data-bind="attr: { for: name}">
                        <span data-bind="text: name"></span>
                      </label>
                    </div>
                  </li>
                </ul>
              </li>
            </ul>
          </ul>
        </div>`,n.appendChild(i);let o=new EM(t);Se.track(o),Se.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var Q6=w1t;var TEo=T(S(),1);var fEo=T(S(),1);var F1t="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",A1t="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function j6(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?A1t:F1t}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}j6.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(j6.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var IM=j6;function GO(e){e=Xn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="&times;",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new IM;Se.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=Ca(s,"description",function(h){r.style.height="5px",u.innerHTML=h;let p=null,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let _=x["background-color"],C=B.fromCssColorString(_);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(GO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});GO.prototype.isDestroyed=function(){return!1};GO.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var XM=GO;var WEo=T(S(),1);var LEo=T(S(),1);function MCe(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(MCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var WM=MCe;function EO(e){let t=Xn(e.container),n=new WM,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=`            <table>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">Left click + drag</div>                    </td>                </tr>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Right click + drag, or</div>                        <div class="cesium-navigation-help-details">Mouse wheel scroll</div>                    </td>                </tr>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Rotate view</div>                        <div class="cesium-navigation-help-details">Middle click + drag, or</div>                        <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div>                    </td>                </tr>            </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=`            <table>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">One finger drag</div>                    </td>                </tr>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Two finger pinch</div>                    </td>                </tr>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Tilt view</div>                        <div class="cesium-navigation-help-details">Two finger drag, same direction</div>                    </td>                </tr>                <tr>                    <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">Rotate view</div>                        <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div>                    </td>                </tr>            </table>`,s.appendChild(p),Se.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(EO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EO.prototype.isDestroyed=function(){return!1};EO.prototype.destroy=function(){return Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var PM=EO;var HEo=T(S(),1);var NEo=T(S(),1);function q6(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=k9.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(q6.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});q6.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var vM=q6;function IO(e){let t=Xn(e.container),n=new vM(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="&times;",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(IO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});IO.prototype.isDestroyed=function(){return!1};IO.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var wM=IO;var sIo=T(S(),1);var $Eo=T(S(),1);function XO(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new ar,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(XO.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});XO.prototype.isDestroyed=function(){return!1};XO.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var FM=XO;var M1t="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878         -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132         -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285         11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z         M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201         5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461         -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",N1t="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",k1t="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function WO(e,t,n){e=Xn(e);let i=new FM(t,n);i._globePath=M1t,i._flatMapPath=N1t,i._columbusViewPath=k1t;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Se.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(WO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WO.prototype.isDestroyed=function(){return!1};WO.prototype.destroy=function(){return this._viewModel.destroy(),Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var AM=WO;var yIo=T(S(),1);var uIo=T(S(),1);var U1t=new D,PO="-1000px";function MM(e,t,n){this._scene=e,this._screenPositionX=PO,this._screenPositionY=PO,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Di.worldToWindowCoordinates(e,i,o)}}MM.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,U1t);if(!l(e))this._screenPositionX=PO,this._screenPositionY=PO;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};MM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Fr.EXPONENTIAL_OUT})};MM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Fr.EXPONENTIAL_OUT})};Object.defineProperties(MM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var NM=MM;function vO(e,t){e=Xn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new NM(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(vO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vO.prototype.isDestroyed=function(){return!1};vO.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),me(this)};var kM=vO;var XIo=T(S(),1);var VIo=T(S(),1);function wO(e){this._scene=e,this._orthographic=e.camera.frustum instanceof an,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new ar,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof an}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(wO.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});wO.prototype.isDestroyed=function(){return!1};wO.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var UM=wO;var D1t="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",B1t="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function FO(e,t){e=Xn(e);let n=new UM(t);n._perspectivePath=D1t,n._orthographicPath=B1t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic,       "cesium-projectionPicker-buttonOrthographic": _orthographic,       "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress,        "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),       "cesium-projectionPicker-none" : !_orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),       "cesium-projectionPicker-none" : _orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(FO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FO.prototype.isDestroyed=function(){return!1};FO.prototype.destroy=function(){return this._viewModel.destroy(),Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var DM=FO;var BIo=T(S(),1);var vIo=T(S(),1);function wS(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}wS.prototype.getHeight=function(){return this._height};wS.prototype.getBase=function(){return this._base};wS.prototype.getStartTime=function(){return this._start};wS.prototype.getStopTime=function(){return this._stop};wS.prototype.setRange=function(e,t){this._start=e,this._stop=t};wS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var BM=wS;var AIo=T(S(),1);function NCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new B(.5,.5,.5,1),this.backgroundColor=i||new B(0,0,0,0)}NCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=q.addSeconds(t.startJulian,t.duration,new q);if(q.lessThan(n,o)&&q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(q.lessThanOrEquals(n,r)&&q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new q);!l(a)&&q.greaterThanOrEquals(d,n)?a=s:!l(c)&&q.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var OM=NCe;var $6=1e12,Cm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},xl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},qy=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],O1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _l(e,t){e=Xn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Cm.none,this._touchMode=xl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=Y1t(this),this._onMouseUp=H1t(this),this._onMouseMove=z1t(this),this._onMouseWheel=K1t(this),this._onTouchStart=J1t(this),this._onTouchMove=j1t(this),this._onTouchEnd=Q1t(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}_l.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};_l.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};_l.prototype.isDestroyed=function(){return!1};_l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),me(this)};_l.prototype.addHighlightRange=function(e,t,n){let i=new BM(e,t,n);return this._highlightRanges.push(i),this.resize(),i};_l.prototype.addTrack=function(e,t,n,i){let o=new OM(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};_l.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==vr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=q.secondsDifference(o,i),s=q.secondsDifference(i,this._startJulian),a=q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=q.addSeconds(this._endJulian,s,new q),this._startJulian=i,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=q.addSeconds(this._startJulian,a,new q),this._endJulian=o,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};_l.prototype.zoomFrom=function(e){let t=q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(q.addSeconds(this._startJulian,t-t*e,new q),q.addSeconds(this._endJulian,n*e-n,new q))};function eq(e){return e<10?`0${e.toString()}`:e.toString()}_l.prototype.makeLabel=function(e){let t=q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${O1t[t.month-1]} ${t.day} ${t.year} ${eq(t.hour)}:${eq(t.minute)}:${eq(t.second)}${i}`};_l.prototype.smallestTicInPixels=7;_l.prototype._makeTics=function(){let e=this._timeBarEle,t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=q.addSeconds(this._startJulian,a,new q)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=q.addSeconds(this._startJulian,c,new q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(h/p*1e-5,.4),x,_=q.toGregorianDate(g);h>31536e4?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):h>31536e3?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):h>86400?x=q.fromDate(new Date(Date.UTC(_.year,0))):x=q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=q.secondsDifference(this._startJulian,q.addSeconds(x,f,new q)),V=C+h;this._epochJulian=x;function L(k){return Math.floor(C/k)*k}function R(k,H){return Math.ceil(k/H+.5)*H}function G(k){return(k-C)/h}function I(k,H){return k-H*Math.round(k/H)}this._rulerEle.innerHTML=this.makeLabel(q.addSeconds(this._endJulian,-a,new q));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let w={startTime:C,startJulian:g,epochJulian:x,duration:h,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(k){s+=k.render(w)});let M=0,b=0,Z=0,E=v/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let X=-1,F=-1,N=qy.length,O;for(O=0;O<N;++O){let k=qy[O];if(++X,M=k,k>E&&k>u)break;F<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(F=X)}if(X>0){for(;X>0;)if(--X,Math.abs(I(M,qy[X]))<1e-5){qy[X]>=u&&(b=qy[X]);break}if(F>=0)for(;F<X;){if(Math.abs(I(b,qy[F]))<1e-5&&qy[F]>=u){Z=qy[F];break}++F}}u=P,u>d&&Z<1e-5&&Math.abs(u-M)>d&&(Z=u,u<=M+d&&(b=0));let U=-999999,Y;if(p*(Z/this._timeBarSecondsSpan)>=3)for(o=L(Z);o<=V;o=R(o,Z))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=L(b);o<=V;o=R(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(M/this._timeBarSecondsSpan)>=2){this._mainTicSpan=M,V+=M,o=L(M);let k=q.computeTaiMinusUtc(x);for(;o<=V;){let H=q.addSeconds(g,o-C,new q);if(M>2.1){let j=q.computeTaiMinusUtc(H);Math.abs(j-k)>.1&&(o+=j-k,H=q.addSeconds(g,o-C,new q))}let K=Math.round(p*G(o)),te=this.makeLabel(H);this._rulerEle.innerHTML=te,Y=this._rulerEle.offsetWidth,Y<10&&(Y=v);let z=K-(Y/2-1);z>U?(U=z+Y+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=R(o,M)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),w.y=0,this._trackList.forEach(function(k){k.render(r._context,w),w.y+=k.height})};_l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(q.addSeconds(this._startJulian,this._timelineDrag,new q),q.addSeconds(this._endJulian,this._timelineDrag,new q)))};_l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=q.addSeconds(this._startJulian,t,new q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function Y1t(e){return function(t){e._mouseMode!==Cm.touchOnly&&(t.button===0?(e._mouseMode=Cm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Cm.zoom:e._mouseMode=Cm.slide)),t.preventDefault()}}function H1t(e){return function(t){e._mouseMode=Cm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function z1t(e){return function(t){let n;if(e._mouseMode===Cm.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Cm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(q.addSeconds(e._startJulian,i,new q),q.addSeconds(e._endJulian,i,new q))}}else e._mouseMode===Cm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function K1t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;$6=Math.max(Math.min(Math.abs(n),$6),1),n/=$6,e.zoomFrom(Math.pow(1.05,-n))}}function J1t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Cm.touchOnly,n===1?(i=q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=xl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=xl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=xl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=xl.ignore}}function Q1t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xl.singleTap?(e._touchMode=xl.scrub,e._onTouchMove(t)):e._touchMode===xl.scrub&&e._onTouchMove(t),e._mouseMode=Cm.touchOnly,n!==1?e._touchMode=n>0?xl.ignore:xl.none:e._touchMode===xl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function j1t(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===xl.singleTap&&(e._touchMode=xl.slideZoom),e._mouseMode=Cm.touchOnly,e._touchMode===xl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===xl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new q)):(n=e._touchState.centerX-r,a=q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new q)),e.zoomTo(a,q.addSeconds(a,e._timeBarSecondsSpan*c,new q)),e._touchState.centerX=r,e._touchState.spanX=s))}}_l.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var YM=_l;var sXo=T(S(),1);var $Io=T(S(),1);var OCe=T(BCe(),1);function eVt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function YCe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function tVt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(YCe(),e._locked=!1),e._noSleep.disable(),br.exitFullscreen(),n(!1)):(br.fullscreen||br.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=eVt("landscape")),t.useWebVR=!0,n(!0)))}function AO(e,t){let n=this,i=Se.observable(br.enabled),o=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&br.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new ar,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof an)}),this._locked=!1,this._noSleep=new OCe.default,this._command=Rn(function(){tVt(n,e,o,r)},Se.getObservable(this,"isVREnabled")),this._vrElement=y(Xn(t),document.body),this._callback=function(){!br.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(YCe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(br.changeEventName,this._callback)}Object.defineProperties(AO.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});AO.prototype.isDestroyed=function(){return!1};AO.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(br.changeEventName,this._callback),me(this)};var HM=AO;var nVt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",iVt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function MO(e,t,n){e=Xn(e);let i=new HM(t,n);i._exitVRPath=iVt,i._enterVRPath=nVt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(MO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MO.prototype.isDestroyed=function(){return!1};MO.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var zM=MO;var ZXo=T(S(),1);var HCe=new le;function JCe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function oVt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function rVt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function zCe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof $o)return i;if(n instanceof Os)return new $o({name:rVt(n),description:oVt(n),feature:n})}if(l(e.scene.globe))return cVt(e,t.position)}var sVt=new q;function oq(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;q.equals(i,o)&&(o=q.addSeconds(i,W.EPSILON2,sVt)),e.updateFromClock(),e.zoomTo(i,o)}}}var aVt=new m;function cVt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new $o({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=KCe();return}let a=s[0],c=new $o({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,aVt);c.position=new $c(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=KCe())}),r}function KCe(){return new $o({id:"None",description:"No features found."})}function lVt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function qi(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new km,d=new sM(c),u=!0);let h=new L9(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new ar;g.add(c.onTick,qi.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),f=new kM(H,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),x=new XM(H);let K=x.viewModel;g.add(K.cameraClicked,qi.prototype._onInfoBoxCameraClicked,this),g.add(K.closeClicked,qi.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let C;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",_.appendChild(H);let K;typeof t.geocoder=="string"?K=[new Kx({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),C=new RM({container:H,geocoderServices:K,scene:p}),g.add(C.viewModel.search.beforeExecute,qi.prototype._clearObjects,this)}let V;(!l(t.homeButton)||t.homeButton!==!1)&&(V=new GM(_,p),l(C)&&g.add(V.viewModel.command.afterExecute,function(){let H=C.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),g.add(V.viewModel.command.beforeExecute,qi.prototype._clearTrackedObject,this));let L;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(L=new AM(_,p));let R;t.projectionPicker&&(R=new DM(_,p));let G,I;if(n){let H=y(t.imageryProviderViewModels,dM()),K=y(t.terrainProviderViewModels,uM());G=new lM(_,{globe:p.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:K,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),I=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(G.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(G.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let K=window.localStorage.getItem("cesium-hasSeenNavHelp");l(K)&&K?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new PM({container:_,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,H)})}let P;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),P=new TM(H,new SM(d))}let w;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),w=new YM(H,c),w.addEventListener("settime",JCe,!1),w.zoomTo(c.startTime,c.stopTime)}let M,b,Z;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(Z=document.createElement("div"),Z.className="cesium-viewer-fullscreenContainer",o.appendChild(Z),M=new VM(Z,t.fullscreenElement),b=Ca(M.viewModel,"isFullscreenEnabled",function(H){Z.style.display=H?"block":"none",l(w)&&(w.container.style.right=`${Z.clientWidth}px`,w.resize())}));let E,X,F;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),E=new zM(H,p,t.fullScreenElement),X=Ca(E.viewModel,"isVREnabled",function(K){H.style.display=K?"block":"none",l(M)&&(H.style.right=`${Z.clientWidth}px`),l(w)&&(w.container.style.right=`${H.clientWidth}px`,w.resize())}),F=Ca(E.viewModel,"isVRMode",function(K){lVt(i,K)})}this._baseLayerPickerDropDown=I,this._fullscreenSubscription=b,this._vrSubscription=X,this._vrModeSubscription=F,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=f,this._infoBox=x,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=V,this._sceneModePicker=L,this._projectionPicker=R,this._baseLayerPicker=G,this._navigationHelpButton=v,this._animation=P,this._timeline=w,this._fullscreenButton=M,this._vrButton=E,this._geocoder=C,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let N=this._cesiumWidget.dataSources,O=this._cesiumWidget.dataSourceDisplay;g.add(N.dataSourceAdded,qi.prototype._onDataSourceAdded,this),g.add(N.dataSourceRemoved,qi.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,qi.prototype.resize,this);let U=N.length;for(let H=0;H<U;H++)this._dataSourceAdded(N,N.get(H));this._dataSourceAdded(void 0,O.defaultDataSource),g.add(N.dataSourceAdded,qi.prototype._dataSourceAdded,this),g.add(N.dataSourceRemoved,qi.prototype._dataSourceRemoved,this);function Y(H){let K=zCe(i,H);l(K)?J.getValueOrUndefined(K.position,i.clock.currentTime)?i.trackedEntity=K:i.zoomTo(K):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(H){i.selectedEntity=zCe(i,H)}h.screenSpaceEventHandler.setInputAction(k,xn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(Y,xn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(qi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,oq(this._timeline,e))}}});qi.prototype.extend=function(e,t){e(this,t)};qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),h=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,x=this._vrButton,_=c.container,C=_.style;p=_.clientHeight+3,C.left=`${u}px`;let V=0;l(f)&&(V+=f.container.clientWidth),l(x)&&(V+=x.container.clientWidth),C.right=`${V}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};qi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};qi.prototype.render=function(){this._cesiumWidget.render()};qi.prototype.isDestroyed=function(){return!1};qi.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(xn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(xn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",JCe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),me(this)};qi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(qi.prototype._onEntityCollectionChanged,this)};qi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(qi.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};qi.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};qi.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,HCe)!==dt.FAILED?n=HCe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=J.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};qi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};qi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};qi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};qi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};qi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};qi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&oq(this.timeline,e)};qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&oq(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,qi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};qi.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};qi.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};qi.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var rq=qi;var IXo=T(S(),1);function dVt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new pM(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var sq=dVt;var PXo=T(S(),1);function uVt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new yM(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var aq=uVt;var AXo=T(S(),1);function mVt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new be,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Xn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){QCe(s,d),s=u,cq(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?cq(s,d):QCe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){FS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=u.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let f=h[g],x=new FileReader;x.onload=hVt(e,f,c,a),x.onerror=fVt(e,f),x.readAsText(f)}}cq(s,d),e.destroy=wI(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function FS(e){e.stopPropagation(),e.preventDefault()}function QCe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",FS,!1),n.removeEventListener("dragover",FS,!1),n.removeEventListener("dragexit",FS,!1))}function cq(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",FS,!1),e.addEventListener("dragover",FS,!1),e.addEventListener("dragexit",FS,!1)}function hVt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=kv.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Ty.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=OT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=pw.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function fVt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var lq=mVt;var BXo=T(S(),1);function pVt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new wM({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var dq=pVt;var oWo=T(S(),1);var tWo=T(S(),1);var KXo=T(S(),1);function jCe(e){let t=e.split(`
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c}
`}return i}function Vm(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Se.observable();return Se.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=jCe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Mi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Mi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Mi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)},getPrimitiveFunction:function(){t.translationX=A.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)},getPrimitiveFunction:function(){t.translationY=A.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)},getPrimitiveFunction:function(){t.translationZ=A.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)},getPrimitiveFunction:function(){t.scaleX=A.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)},getPrimitiveFunction:function(){t.scaleY=A.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)},getPrimitiveFunction:function(){t.scaleZ=A.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&gp(t)}})}var bVt=new m,gVt=new m,yVt=new Ra,xVt=new $;function gp(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,bVt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,gVt),i=yVt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,xVt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=A.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Vm.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=jCe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,gp(t)}}}});Vm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Vm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Vm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Vm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Vm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Vm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Vm.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new yS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Vm.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=`  ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),me(this)};var KM=Vm;function NO(e,t){e=Xn(e);let n=document.createElement("div"),i=new KM(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=za.createSection,a=za.createCheckbox,c=za.createRangeInput,d=za.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=W.PI;h.appendChild(c("Translation X","translationX",-x,+x)),h.appendChild(c("Translation Y","translationY",-x,+x)),h.appendChild(c("Translation Z","translationZ",-x,+x)),h.appendChild(c("Scale X","scaleX",0,+_)),h.appendChild(c("Scale Y","scaleY",0,+_)),h.appendChild(c("Scale Z","scaleZ",0,+_)),h.appendChild(c("Heading","angleX",-C,+C)),h.appendChild(c("Pitch","angleY",-C,+C)),h.appendChild(c("Roll","angleZ",-C,+C));let V=Mi.getMinBounds(Mi.BOX),L=Mi.getMaxBounds(Mi.BOX),R=m.fromElements(Mi.getMinBounds(Mi.ELLIPSOID).x,Mi.getMinBounds(Mi.ELLIPSOID).y,-ne.WGS84.maximumRadius,new m),G=m.fromElements(Mi.getMaxBounds(Mi.ELLIPSOID).x,Mi.getMaxBounds(Mi.ELLIPSOID).y,1e7,new m),I=Mi.getMinBounds(Mi.CYLINDER),v=Mi.getMaxBounds(Mi.CYLINDER);OL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),OL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",R,G,"shapeIsEllipsoid",p),OL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,v,"shapeIsCylinder",p),OL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",g),OL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",R,G,"shapeIsEllipsoid",g),OL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,v,"shapeIsCylinder",g);let P=document.createElement("div");f.appendChild(P);let w=document.createElement("textarea");w.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(w);let M=d("Compile (Ctrl+Enter)","compileShader");P.appendChild(M);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),P.appendChild(b),Se.applyBindings(i,n)}Object.defineProperties(NO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NO.prototype.isDestroyed=function(){return!1};NO.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function OL(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){let _=za.createRangeInput,C=p,V=g,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${f}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,d,C.y,V.y)),L.appendChild(_(o,u,C.z,V.z)),L.appendChild(_(r,h,C.z,V.z))}var JM=NO;function _Vt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new JM(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var uq=_Vt;globalThis.CESIUM_VERSION="1.127";var TVt="1.127";return o1e(SVt);})();